Apache JMeter

org.apache.jmeter.testelement
Interface TestElement

All Superinterfaces:
Cloneable
All Known Subinterfaces:
Controller, Sampler
All Known Implementing Classes:
AbstractChart, AbstractJDBCProcessor, AbstractJDBCTestElement, AbstractListenerElement, AbstractReportWriter, AbstractSampler, AbstractScopedAssertion, AbstractScopedTestElement, AbstractTable, AbstractTestElement, AbstractThreadGroup, AccessLogSampler, AjpSampler, AnchorModifier, Argument, Arguments, AuthManager, Authorization, BarChart, BaseJMSSampler, BeanShellAssertion, BeanShellListener, BeanShellPostProcessor, BeanShellPreProcessor, BeanShellSampler, BeanShellTestElement, BeanShellTimer, BSFAssertion, BSFListener, BSFPostProcessor, BSFPreProcessor, BSFSampler, BSFTestElement, BSFTimer, CacheManager, CompareAssertion, ConfigTestElement, ConstantThroughputTimer, ConstantTimer, Cookie, CookieManager, CounterConfig, CSVDataSet, DataSourceElement, DebugPostProcessor, DebugSampler, DurationAssertion, Example1, Example2, Example3, ExampleSampler, ForeachController, FTPSampler, GaussianRandomTimer, GenericController, Header, HeaderManager, HTMLAssertion, HTMLReportWriter, HTTPArgument, HTTPFileArg, HTTPFileArgs, HttpMirrorControl, HTTPSampler, HTTPSampler2, HTTPSamplerBase, HTTPSamplerProxy, IfController, IncludeController, InterleaveControl, JavaConfig, JavaSampler, JDBCPostProcessor, JDBCPreProcessor, JDBCSampler, JMSSampler, JSR223Assertion, JSR223Listener, JSR223PostProcessor, JSR223PreProcessor, JSR223Sampler, JSR223TestElement, JSR223Timer, JUnitSampler, KeystoreConfig, LDAPArgument, LDAPArguments, LDAPExtSampler, LDAPSampler, LineChart, LoginConfig, LoopController, MailerModel, MailerResultCollector, MailReaderSampler, MD5HexAssertion, ModuleController, MonitorStats, OnceOnlyController, OnErrorTestElement, ParamMask, ParamModifier, PoissonRandomTimer, PostThreadGroup, ProxyControl, PublisherSampler, RandomController, RandomOrderController, RandomTimer, RandomVariableConfig, RecordingController, RegexExtractor, RemoteListenerWrapper, RemoteSampleListenerWrapper, RemoteTestListenerWrapper, ReportPage, ReportPlan, ResponseAssertion, ResultAction, ResultCollector, ResultSaver, RunTime, SetupThreadGroup, SizeAssertion, SMIMEAssertionTestElement, SmtpSampler, SoapSampler, SubscriberSampler, SubstitutionElement, Summariser, SwitchController, SyncTimer, SystemSampler, Table, TCPSampler, TestAction, TestFragmentController, TestPlan, ThreadGroup, ThroughputController, TransactionController, TransactionSampler, UniformRandomTimer, URLRewritingModifier, UserParameters, WebServiceSampler, WhileController, WorkBench, XMLAssertion, XMLSchemaAssertion, XPathAssertion, XPathExtractor

public interface TestElement
extends Cloneable


Field Summary
static String COMMENTS
           
static String ENABLED
           
static String GUI_CLASS
           
static String NAME
           
static String TEST_CLASS
           
 
Method Summary
 void addTestElement(TestElement child)
           
 boolean canRemove()
          Called by Remove to determine if it is safe to remove the element.
 void clear()
          Clear the TestElement of all data.
 void clearTestElementChildren()
          This method should clear any test element properties that are merged by addTestElement(TestElement).
 Object clone()
           
 String getComment()
           
 String getName()
           
 JMeterProperty getProperty(String propName)
          Given the name of the property, returns the appropriate property from JMeter.
 boolean getPropertyAsBoolean(String key)
          Return a property as a boolean value.
 boolean getPropertyAsBoolean(String key, boolean defaultValue)
           
 double getPropertyAsDouble(String key)
           
 float getPropertyAsFloat(String key)
           
 int getPropertyAsInt(String key)
           
 int getPropertyAsInt(String key, int defaultValue)
           
 long getPropertyAsLong(String key)
           
 long getPropertyAsLong(String key, long defaultValue)
           
 String getPropertyAsString(String key)
           
 String getPropertyAsString(String key, String defaultValue)
           
 JMeterContext getThreadContext()
           
 String getThreadName()
           
 boolean isEnabled()
          Check if ENABLED property is present and true ; defaults to true
 boolean isRunningVersion()
          Returns true or false whether the element is the running version.
 boolean isTemporary(JMeterProperty property)
          Test whether a given property is only a temporary resident of the TestElement
 PropertyIterator propertyIterator()
          Get a Property Iterator for the TestElements properties.
 void recoverRunningVersion()
          Tells the test element to return to the state it was in when setRunningVersion(true) was called.
 void removeProperty(String key)
           
 void setComment(String comment)
           
 void setName(String name)
           
 void setProperty(JMeterProperty property)
          Sets and overwrites a property in the TestElement.
 void setProperty(String key, boolean value)
           
 void setProperty(String key, boolean value, boolean dflt)
           
 void setProperty(String key, int value)
           
 void setProperty(String key, int value, int dflt)
           
 void setProperty(String key, String value)
           
 void setProperty(String key, String value, String dflt)
           
 void setRunningVersion(boolean run)
          Make the test element the running version, or make it no longer the running version.
 void setTemporary(JMeterProperty property)
          Indicate that the given property should be only a temporary property in the TestElement
 void setThreadContext(JMeterContext threadContext)
           
 void setThreadName(String threadName)
           
 void traverse(TestElementTraverser traverser)
          Convenient way to traverse a test element.
 

Field Detail

NAME

static final String NAME
See Also:
Constant Field Values

GUI_CLASS

static final String GUI_CLASS
See Also:
Constant Field Values

ENABLED

static final String ENABLED
See Also:
Constant Field Values

TEST_CLASS

static final String TEST_CLASS
See Also:
Constant Field Values

COMMENTS

static final String COMMENTS
See Also:
Constant Field Values
Method Detail

addTestElement

void addTestElement(TestElement child)

clearTestElementChildren

void clearTestElementChildren()
This method should clear any test element properties that are merged by addTestElement(TestElement).


setProperty

void setProperty(String key,
                 String value)

setProperty

void setProperty(String key,
                 String value,
                 String dflt)

setProperty

void setProperty(String key,
                 boolean value)

setProperty

void setProperty(String key,
                 boolean value,
                 boolean dflt)

setProperty

void setProperty(String key,
                 int value)

setProperty

void setProperty(String key,
                 int value,
                 int dflt)

isEnabled

boolean isEnabled()
Check if ENABLED property is present and true ; defaults to true

Returns:
true if element is enabled

isRunningVersion

boolean isRunningVersion()
Returns true or false whether the element is the running version.


isTemporary

boolean isTemporary(JMeterProperty property)
Test whether a given property is only a temporary resident of the TestElement

Parameters:
property -
Returns:
boolean

setTemporary

void setTemporary(JMeterProperty property)
Indicate that the given property should be only a temporary property in the TestElement

Parameters:
property - void

getPropertyAsBoolean

boolean getPropertyAsBoolean(String key)
Return a property as a boolean value.


getPropertyAsBoolean

boolean getPropertyAsBoolean(String key,
                             boolean defaultValue)

getPropertyAsLong

long getPropertyAsLong(String key)

getPropertyAsLong

long getPropertyAsLong(String key,
                       long defaultValue)

getPropertyAsInt

int getPropertyAsInt(String key)

getPropertyAsInt

int getPropertyAsInt(String key,
                     int defaultValue)

getPropertyAsFloat

float getPropertyAsFloat(String key)

getPropertyAsDouble

double getPropertyAsDouble(String key)

setRunningVersion

void setRunningVersion(boolean run)
Make the test element the running version, or make it no longer the running version. This tells the test element that it's current state must be retrievable by a call to recoverRunningVersion(). It is kind of like making the TestElement Read- Only, but not as strict. Changes can be made and the element can be modified, but the state of the element at the time of the call to setRunningVersion() must be recoverable.


recoverRunningVersion

void recoverRunningVersion()
Tells the test element to return to the state it was in when setRunningVersion(true) was called.


clear

void clear()
Clear the TestElement of all data.


getPropertyAsString

String getPropertyAsString(String key)

getPropertyAsString

String getPropertyAsString(String key,
                           String defaultValue)

setProperty

void setProperty(JMeterProperty property)
Sets and overwrites a property in the TestElement. This call will be ignored if the TestElement is currently a "running version".


getProperty

JMeterProperty getProperty(String propName)
Given the name of the property, returns the appropriate property from JMeter. If it is null, a NullProperty object will be returned.


propertyIterator

PropertyIterator propertyIterator()
Get a Property Iterator for the TestElements properties.

Returns:
PropertyIterator

removeProperty

void removeProperty(String key)

clone

Object clone()

traverse

void traverse(TestElementTraverser traverser)
Convenient way to traverse a test element.


getThreadContext

JMeterContext getThreadContext()
Returns:
Returns the threadContext.

setThreadContext

void setThreadContext(JMeterContext threadContext)
Parameters:
threadContext - The threadContext to set.

getThreadName

String getThreadName()
Returns:
Returns the threadName.

setThreadName

void setThreadName(String threadName)
Parameters:
threadName - The threadName to set.

canRemove

boolean canRemove()
Called by Remove to determine if it is safe to remove the element. The element can either clean itself up, and return true, or the element can return false.

Returns:
true if safe to remove the element

getName

String getName()

setName

void setName(String name)

getComment

String getComment()

setComment

void setComment(String comment)

Apache JMeter

Copyright © 1998-2012 Apache Software Foundation. All Rights Reserved.