org.apache.jmeter.testelement

Interface TestElement

All Superinterfaces:
Cloneable
Known Subinterfaces:
Controller, Sampler
Known Implementing Classes:
AbstractChart, AbstractListenerElement, AbstractReportWriter, AbstractSampler, AbstractScopedAssertion, AbstractTable, AbstractTestElement, AccessLogSampler, AjpSampler, AnchorModifier, Argument, Arguments, AuthManager, Authorization, BarChart, BaseJMSSampler, BeanShellAssertion, BeanShellListener, BeanShellPostProcessor, BeanShellPreProcessor, BeanShellSampler, BeanShellTestElement, BeanShellTimer, BSFAssertion, BSFListener, BSFPostProcessor, BSFPreProcessor, BSFSampler, BSFTestElement, CacheManager, ConfigTestElement, ConstantThroughputTimer, ConstantTimer, Cookie, CookieManager, CounterConfig, CSVDataSet, DataSourceElement, DebugPostProcessor, DebugSampler, DurationAssertion, Example1, Example2, ExampleSampler, ForeachController, FTPSampler, GaussianRandomTimer, GenericController, Header, HeaderManager, HttpMirrorControl, HTMLAssertion, HTMLReportWriter, HTTPArgument, HTTPFileArg, HTTPFileArgs, HTTPSampler, HTTPSampler2, HTTPSamplerBase, IfController, IncludeController, InterleaveControl, JavaConfig, JavaSampler, JDBCSampler, JMSSampler, JUnitSampler, LDAPArgument, LDAPArguments, LDAPExtSampler, LDAPSampler, LineChart, LoginConfig, LoopController, MailerModel, MailerResultCollector, MailReaderSampler, MD5HexAssertion, ModuleController, MonitorStats, OnceOnlyController, OnErrorTestElement, ParamMask, ParamModifier, ProxyControl, PublisherSampler, RandomController, RandomOrderController, RandomTimer, RandomVariableConfig, RecordingController, RegexExtractor, RemoteListenerWrapper, RemoteSampleListenerWrapper, RemoteTestListenerWrapper, ReportPage, ReportPlan, ResponseAssertion, ResultAction, ResultCollector, ResultSaver, RunTime, SizeAssertion, SoapSampler, SubscriberSampler, Summariser, SwitchController, SyncTimer, Table, TCPSampler, TestAction, TestPlan, ThreadGroup, ThroughputController, TransactionController, TransactionSampler, UniformRandomTimer, URLRewritingModifier, UserParameterModifier, 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.
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)
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 makeRunningVersion() was called.
void
removeProperty(String key)
void
setComment(String comment)
void
setName(String name)
void
setProperty(String key, String value)
void
setProperty(String key, String value, String dflt)
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(JMeterProperty property)
Sets and overwrites a property in the TestElement.
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 Details

COMMENTS

public static final String COMMENTS

ENABLED

public static final String ENABLED

GUI_CLASS

public static final String GUI_CLASS

NAME

public static final String NAME

TEST_CLASS

public static final String TEST_CLASS

Method Details

addTestElement

public void addTestElement(TestElement child)

canRemove

public 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

clear

public void clear()
Clear the TestElement of all data.

clone

public Object clone()

getComment

public String getComment()

getName

public String getName()

getProperty

public 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.

getPropertyAsBoolean

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

getPropertyAsBoolean

public boolean getPropertyAsBoolean(String key,
                                    boolean defaultValue)

getPropertyAsDouble

public double getPropertyAsDouble(String key)

getPropertyAsFloat

public float getPropertyAsFloat(String key)

getPropertyAsInt

public int getPropertyAsInt(String key)

getPropertyAsInt

public int getPropertyAsInt(String key,
                            int defaultValue)

getPropertyAsLong

public long getPropertyAsLong(String key)

getPropertyAsString

public String getPropertyAsString(String key)

getPropertyAsString

public String getPropertyAsString(String key,
                                  String defaultValue)

getThreadContext

public JMeterContext getThreadContext()
Returns:
Returns the threadContext.

getThreadName

public String getThreadName()
Returns:
Returns the threadName.

isEnabled

public boolean isEnabled()
Check if ENABLED property is present and true ; defaults to true
Returns:
true if element is enabled

isRunningVersion

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

isTemporary

public boolean isTemporary(JMeterProperty property)
Test whether a given property is only a temporary resident of the TestElement
Parameters:
property -
Returns:
boolean

propertyIterator

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

recoverRunningVersion

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

removeProperty

public void removeProperty(String key)

setComment

public void setComment(String comment)

setName

public void setName(String name)

setProperty

public void setProperty(String key,
                        String value)

setProperty

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

setProperty

public void setProperty(String key,
                        boolean value)

setProperty

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

setProperty

public void setProperty(String key,
                        int value)

setProperty

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

setProperty

public 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".

setRunningVersion

public 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.

setTemporary

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

setThreadContext

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

setThreadName

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

traverse

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

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