public abstract class AbstractTestElement extends Object implements TestElement, Serializable, Searchable
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
AbstractTestElement() |
Modifier and Type | Method and Description |
---|---|
protected void |
addPropertiesValues(List<String> result,
Set<String> propertyNames)
Add to result the values of propertyNames
|
protected void |
addProperty(JMeterProperty property)
Add property to test element without cloning it
|
protected void |
addProperty(JMeterProperty property,
boolean clone)
Add property to test element
|
void |
addTestElement(TestElement el) |
boolean |
canRemove()
Called by Remove to determine if it is safe to remove the element.
|
void |
clear()
Clear the TestElement of all data.
|
protected void |
clearTemporary(JMeterProperty property)
Remove property from temporaryProperties
|
void |
clearTestElementChildren()
This method should clear any test element properties that are merged
by
TestElement.addTestElement(TestElement) . |
Object |
clone() |
protected void |
emptyTemporary()
Clears temporaryProperties
|
boolean |
equals(Object o) |
String |
getComment() |
String |
getName()
Get the name of this test element
|
JMeterProperty |
getProperty(String key)
Get the named property.
|
boolean |
getPropertyAsBoolean(String key)
Return a property as a boolean value.
|
boolean |
getPropertyAsBoolean(String key,
boolean defaultVal)
Return a property as a boolean value or a default value if no property
could be found.
|
double |
getPropertyAsDouble(String key)
Return a property as a double value.
|
float |
getPropertyAsFloat(String key)
Return a property as a float value.
|
int |
getPropertyAsInt(String key)
Return a property as an int value.
|
int |
getPropertyAsInt(String key,
int defaultValue)
Return a property as an int value or a default value if no property
could be found.
|
long |
getPropertyAsLong(String key)
Return a property as a long value.
|
long |
getPropertyAsLong(String key,
long defaultValue)
Return a property as a long value or a default value if no property
could be found.
|
String |
getPropertyAsString(String key)
Return a property as a string value.
|
String |
getPropertyAsString(String key,
String defaultValue)
Return a property as an string value or a default value if no property
could be found.
|
List<String> |
getSearchableTokens()
Get a list of all tokens that should be visible to searching
|
JMeterContext |
getThreadContext() |
String |
getThreadName() |
int |
hashCode() |
boolean |
isEnabled()
Check if ENABLED property is present and true ; defaults to true
|
boolean |
isRunningVersion()
Returns the runningVersion.
|
boolean |
isTemporary(JMeterProperty property)
Test whether a given property is only a temporary resident of the
TestElement
|
protected void |
logProperties()
Log the properties of the test element
|
protected void |
mergeIn(TestElement element)
Add to this the properties of element (by reference)
|
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)
Remove property stored under the
key |
void |
setComment(String comment)
Associates a comment with this element
|
void |
setEnabled(boolean enabled)
Set the enabled status of the test element
|
void |
setName(String name) |
void |
setProperty(JMeterProperty property)
Sets and overwrites a property in the TestElement.
|
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 an int property - but only if it is not the default.
|
void |
setProperty(String name,
long value) |
void |
setProperty(String name,
long value,
long dflt)
Create a long property - but only if it is not the default.
|
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 |
setRunningVersion(boolean runningVersion)
Sets the runningVersion.
|
void |
setTemporary(JMeterProperty property)
Indicate that the given property should be only a temporary property in
the TestElement
|
void |
setThreadContext(JMeterContext inthreadContext) |
void |
setThreadName(String inthreadName) |
void |
traverse(TestElementTraverser traverser)
Convenient way to traverse a test element.
|
protected void |
traverseCollection(CollectionProperty col,
TestElementTraverser traverser) |
protected void |
traverseMap(MapProperty map,
TestElementTraverser traverser) |
protected void |
traverseProperty(TestElementTraverser traverser,
JMeterProperty value) |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
removed
public Object clone()
clone
in interface TestElement
clone
in class Object
public void clear()
clear
in interface TestElement
public void clearTestElementChildren()
TestElement.addTestElement(TestElement)
.
Default implementation - does nothing
clearTestElementChildren
in interface TestElement
public void removeProperty(String key)
key
removeProperty
in interface TestElement
key
- name of the property to be removedpublic void addTestElement(TestElement el)
addTestElement
in interface TestElement
public void setName(String name)
setName
in interface TestElement
name
- of this elementpublic String getName()
TestElement
getName
in interface TestElement
public void setComment(String comment)
TestElement
setComment
in interface TestElement
comment
- to be associatedpublic String getComment()
getComment
in interface TestElement
public JMeterProperty getProperty(String key)
getProperty
in interface TestElement
key
- the name of the property to getJMeterProperty
stored under the name, or
NullProperty
if no property can be foundpublic void traverse(TestElementTraverser traverser)
TestElement
traverse
in interface TestElement
traverser
- The traverser that is notified of the contained elementsprotected void traverseProperty(TestElementTraverser traverser, JMeterProperty value)
protected void traverseMap(MapProperty map, TestElementTraverser traverser)
protected void traverseCollection(CollectionProperty col, TestElementTraverser traverser)
public int getPropertyAsInt(String key)
TestElement
getPropertyAsInt
in interface TestElement
key
- the name of the property to getpublic int getPropertyAsInt(String key, int defaultValue)
TestElement
getPropertyAsInt
in interface TestElement
key
- the name of the property to getdefaultValue
- the default value to usedefaultValue
if no
property could be foundpublic boolean getPropertyAsBoolean(String key)
TestElement
getPropertyAsBoolean
in interface TestElement
key
- the name of the property to getpublic boolean getPropertyAsBoolean(String key, boolean defaultVal)
TestElement
getPropertyAsBoolean
in interface TestElement
key
- the name of the property to getdefaultVal
- the default value to usedefaultValue
if no
property could be foundpublic float getPropertyAsFloat(String key)
TestElement
getPropertyAsFloat
in interface TestElement
key
- the name of the property to getpublic long getPropertyAsLong(String key)
TestElement
getPropertyAsLong
in interface TestElement
key
- the name of the property to getpublic long getPropertyAsLong(String key, long defaultValue)
TestElement
getPropertyAsLong
in interface TestElement
key
- the name of the property to getdefaultValue
- the default value to usedefaultValue
if no
property could be foundpublic double getPropertyAsDouble(String key)
TestElement
getPropertyAsDouble
in interface TestElement
key
- the name of the property to getpublic String getPropertyAsString(String key)
TestElement
getPropertyAsString
in interface TestElement
key
- the name of the property to getpublic String getPropertyAsString(String key, String defaultValue)
TestElement
getPropertyAsString
in interface TestElement
key
- the name of the property to getdefaultValue
- the default value to usedefaultValue
if no
property could be foundprotected void addProperty(JMeterProperty property, boolean clone)
property
- JMeterProperty
to add to current Test Elementclone
- clone propertyprotected void addProperty(JMeterProperty property)
property
- JMeterProperty
protected void clearTemporary(JMeterProperty property)
property
- JMeterProperty
protected void logProperties()
TestElement.setProperty(JMeterProperty)
public void setProperty(JMeterProperty property)
TestElement
setProperty
in interface TestElement
property
- the property to be setpublic void setProperty(String name, String value)
setProperty
in interface TestElement
public void setProperty(String name, String value, String dflt)
setProperty
in interface TestElement
name
- property namevalue
- current valuedflt
- defaultpublic void setProperty(String name, boolean value)
setProperty
in interface TestElement
public void setProperty(String name, boolean value, boolean dflt)
setProperty
in interface TestElement
name
- property namevalue
- current valuedflt
- defaultpublic void setProperty(String name, int value)
setProperty
in interface TestElement
public void setProperty(String name, int value, int dflt)
setProperty
in interface TestElement
name
- property namevalue
- current valuedflt
- defaultpublic void setProperty(String name, long value)
setProperty
in interface TestElement
public void setProperty(String name, long value, long dflt)
setProperty
in interface TestElement
name
- property namevalue
- current valuedflt
- defaultpublic PropertyIterator propertyIterator()
TestElement
propertyIterator
in interface TestElement
protected void mergeIn(TestElement element)
element
- TestElement
public boolean isRunningVersion()
isRunningVersion
in interface TestElement
true
if the element is the running versionpublic void setRunningVersion(boolean runningVersion)
setRunningVersion
in interface TestElement
runningVersion
- the runningVersion to setpublic void recoverRunningVersion()
recoverRunningVersion
in interface TestElement
protected void emptyTemporary()
public boolean isTemporary(JMeterProperty property)
isTemporary
in interface TestElement
property
- the property to be testedtrue
if property is temporarypublic void setTemporary(JMeterProperty property)
setTemporary
in interface TestElement
property
- voidpublic JMeterContext getThreadContext()
getThreadContext
in interface TestElement
public void setThreadContext(JMeterContext inthreadContext)
setThreadContext
in interface TestElement
inthreadContext
- The threadContext to set.public String getThreadName()
getThreadName
in interface TestElement
public void setThreadName(String inthreadName)
setThreadName
in interface TestElement
inthreadName
- The threadName to set.public boolean canRemove()
canRemove
in interface TestElement
public boolean isEnabled()
TestElement
isEnabled
in interface TestElement
public void setEnabled(boolean enabled)
TestElement
setEnabled
in interface TestElement
enabled
- the status to setpublic List<String> getSearchableTokens()
getSearchableTokens
in interface Searchable
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.