org.apache.jmeter.testelement

Class AbstractTestElement

Implemented Interfaces:
Cloneable, Serializable, TestElement
Known Direct Subclasses:
AbstractChart, AbstractListenerElement, AbstractReportWriter, AbstractSampler, AbstractScopedAssertion, AbstractTable, AnchorModifier, Argument, Authorization, BeanShellTestElement, BSFTestElement, ConfigTestElement, ConstantThroughputTimer, ConstantTimer, Cookie, CounterConfig, DataSourceElement, DebugPostProcessor, GenericController, Header, HttpMirrorControl, HTMLAssertion, HTTPFileArg, LDAPArgument, MailerModel, MD5HexAssertion, MonitorStats, OnErrorTestElement, ParamMask, ParamModifier, RegexExtractor, RemoteListenerWrapper, RemoteSampleListenerWrapper, RemoteTestListenerWrapper, ReportPage, ReportPlan, ResultSaver, Summariser, SyncTimer, TestPlan, ThreadGroup, URLRewritingModifier, UserParameters, WorkBench, XMLAssertion, XMLSchemaAssertion, XPathAssertion, XPathExtractor

public abstract class AbstractTestElement
extends Object
implements TestElement, Serializable

Fields inherited from interface org.apache.jmeter.testelement.TestElement

COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

Constructor Summary

AbstractTestElement()

Method Summary

protected void
addProperty(JMeterProperty property)
void
addTestElement(TestElement el)
boolean
canRemove()
void
clear()
protected void
clearTemporary(JMeterProperty property)
Object
clone()
protected void
emptyTemporary()
boolean
equals(Object o)
String
getComment()
String
getName()
JMeterProperty
getProperty(String key)
Get the named property.
boolean
getPropertyAsBoolean(String key)
boolean
getPropertyAsBoolean(String key, boolean defaultVal)
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()
int
hashCode()
boolean
isEnabled()
boolean
isRunningVersion()
Returns the runningVersion.
boolean
isTemporary(JMeterProperty property)
protected void
logProperties()
Log the properties of the test element
protected void
mergeIn(TestElement element)
PropertyIterator
propertyIterator()
void
recoverRunningVersion()
void
removeProperty(String key)
void
setComment(String comment)
void
setName(String name)
void
setProperty(String name, String value)
void
setProperty(String name, String value, String dflt)
Create a String property - but only if it is not the default.
void
setProperty(String name, boolean value)
void
setProperty(String name, boolean value, boolean dflt)
Create a boolean property - but only if it is not the default.
void
setProperty(String name, int value)
void
setProperty(String name, int value, int dflt)
Create a boolean property - but only if it is not the default.
void
setProperty(JMeterProperty property)
void
setRunningVersion(boolean runningVersion)
Sets the runningVersion.
void
setTemporary(JMeterProperty property)
void
setThreadContext(JMeterContext inthreadContext)
void
setThreadName(String inthreadName)
void
traverse(TestElementTraverser traverser)
protected void
traverseCollection(CollectionProperty col, TestElementTraverser traverser)
protected void
traverseMap(MapProperty map, TestElementTraverser traverser)
protected void
traverseProperty(TestElementTraverser traverser, JMeterProperty value)

Constructor Details

AbstractTestElement

public AbstractTestElement()

Method Details

addProperty

protected void addProperty(JMeterProperty property)

addTestElement

public void addTestElement(TestElement el)
Specified by:
addTestElement in interface TestElement

canRemove

public boolean canRemove()
Specified by:
canRemove in interface TestElement

clear

public void clear()
Specified by:
clear in interface TestElement

clearTemporary

protected void clearTemporary(JMeterProperty property)

clone

public Object clone()
Specified by:
clone in interface TestElement

emptyTemporary

protected void emptyTemporary()

equals

public boolean equals(Object o)

getComment

public String getComment()
Specified by:
getComment in interface TestElement

getName

public String getName()
Specified by:
getName in interface TestElement

getProperty

public JMeterProperty getProperty(String key)
Get the named property. If it doesn't exist, a new NullProperty object is created with the same name and returned.
Specified by:
getProperty in interface TestElement

getPropertyAsBoolean

public boolean getPropertyAsBoolean(String key)
Specified by:
getPropertyAsBoolean in interface TestElement

getPropertyAsBoolean

public boolean getPropertyAsBoolean(String key,
                                    boolean defaultVal)
Specified by:
getPropertyAsBoolean in interface TestElement

getPropertyAsDouble

public double getPropertyAsDouble(String key)
Specified by:
getPropertyAsDouble in interface TestElement

getPropertyAsFloat

public float getPropertyAsFloat(String key)
Specified by:
getPropertyAsFloat in interface TestElement

getPropertyAsInt

public int getPropertyAsInt(String key)
Specified by:
getPropertyAsInt in interface TestElement

getPropertyAsInt

public int getPropertyAsInt(String key,
                            int defaultValue)
Specified by:
getPropertyAsInt in interface TestElement

getPropertyAsLong

public long getPropertyAsLong(String key)
Specified by:
getPropertyAsLong in interface TestElement

getPropertyAsString

public String getPropertyAsString(String key)
Specified by:
getPropertyAsString in interface TestElement

getPropertyAsString

public String getPropertyAsString(String key,
                                  String defaultValue)
Specified by:
getPropertyAsString in interface TestElement

getThreadContext

public JMeterContext getThreadContext()
Specified by:
getThreadContext in interface TestElement
Returns:
Returns the threadContext.

getThreadName

public String getThreadName()
Specified by:
getThreadName in interface TestElement
Returns:
Returns the threadName.

hashCode

public int hashCode()

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface TestElement

isRunningVersion

public boolean isRunningVersion()
Returns the runningVersion.
Specified by:
isRunningVersion in interface TestElement

isTemporary

public boolean isTemporary(JMeterProperty property)
Specified by:
isTemporary in interface TestElement

logProperties

protected void logProperties()
Log the properties of the test element

mergeIn

protected void mergeIn(TestElement element)

propertyIterator

public PropertyIterator propertyIterator()
Specified by:
propertyIterator in interface TestElement

recoverRunningVersion

public void recoverRunningVersion()
Specified by:
recoverRunningVersion in interface TestElement

removeProperty

public void removeProperty(String key)
Specified by:
removeProperty in interface TestElement

setComment

public void setComment(String comment)
Specified by:
setComment in interface TestElement

setName

public void setName(String name)
Specified by:
setName in interface TestElement

setProperty

public void setProperty(String name,
                        String value)
Specified by:
setProperty in interface TestElement

setProperty

public void setProperty(String name,
                        String value,
                        String dflt)
Create a String property - but only if it is not the default. This is intended for use when adding new properties to JMeter so that JMX files are not expanded unnecessarily. N.B. - must agree with the default applied when reading the property.
Specified by:
setProperty in interface TestElement
Parameters:
name - property name
value - current value
dflt - default

setProperty

public void setProperty(String name,
                        boolean value)
Specified by:
setProperty in interface TestElement

setProperty

public void setProperty(String name,
                        boolean value,
                        boolean dflt)
Create a boolean property - but only if it is not the default. This is intended for use when adding new properties to JMeter so that JMX files are not expanded unnecessarily. N.B. - must agree with the default applied when reading the property.
Specified by:
setProperty in interface TestElement
Parameters:
name - property name
value - current value
dflt - default

setProperty

public void setProperty(String name,
                        int value)
Specified by:
setProperty in interface TestElement

setProperty

public void setProperty(String name,
                        int value,
                        int dflt)
Create a boolean property - but only if it is not the default. This is intended for use when adding new properties to JMeter so that JMX files are not expanded unnecessarily. N.B. - must agree with the default applied when reading the property.
Specified by:
setProperty in interface TestElement
Parameters:
name - property name
value - current value
dflt - default

setProperty

public void setProperty(JMeterProperty property)
Specified by:
setProperty in interface TestElement

setRunningVersion

public void setRunningVersion(boolean runningVersion)
Sets the runningVersion.
Specified by:
setRunningVersion in interface TestElement
Parameters:
runningVersion - the runningVersion to set

setTemporary

public void setTemporary(JMeterProperty property)
Specified by:
setTemporary in interface TestElement

setThreadContext

public void setThreadContext(JMeterContext inthreadContext)
Specified by:
setThreadContext in interface TestElement
Parameters:
inthreadContext - The threadContext to set.

setThreadName

public void setThreadName(String inthreadName)
Specified by:
setThreadName in interface TestElement
Parameters:
inthreadName - The threadName to set.

traverse

public void traverse(TestElementTraverser traverser)
Specified by:
traverse in interface TestElement

traverseCollection

protected void traverseCollection(CollectionProperty col,
                                  TestElementTraverser traverser)

traverseMap

protected void traverseMap(MapProperty map,
                           TestElementTraverser traverser)

traverseProperty

protected void traverseProperty(TestElementTraverser traverser,
                                JMeterProperty value)

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