Apache JMeter

org.apache.jmeter.testelement
Interface TestElement

All Superinterfaces:
Cloneable
All Known Subinterfaces:
Controller, Sampler
All Known Implementing Classes:
AbstractSampler, AbstractTestElement, BeanShellSampler, BSFSampler, GenericController, ThreadGroup, TransactionController

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)
           
 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(JMeterProperty property)
          Sets and overwrites a property in the TestElement.
 void setProperty(String key, boolean value)
           
 void setProperty(String key, String value)
           
 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

public static final String NAME
See Also:
Constant Field Values

GUI_CLASS

public static final String GUI_CLASS
See Also:
Constant Field Values

ENABLED

public static final String ENABLED
See Also:
Constant Field Values

TEST_CLASS

public static final String TEST_CLASS
See Also:
Constant Field Values

COMMENTS

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

addTestElement

public void addTestElement(TestElement child)

setProperty

public void setProperty(String key,
                        String value)

setProperty

public void setProperty(String key,
                        boolean value)

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

setTemporary

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

Parameters:
property - void

getPropertyAsBoolean

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


getPropertyAsBoolean

public boolean getPropertyAsBoolean(String key,
                                    boolean defaultValue)

getPropertyAsLong

public long getPropertyAsLong(String key)

getPropertyAsInt

public int getPropertyAsInt(String key)

getPropertyAsFloat

public float getPropertyAsFloat(String key)

getPropertyAsDouble

public double getPropertyAsDouble(String key)

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.


recoverRunningVersion

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


clear

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


getPropertyAsString

public String getPropertyAsString(String key)

getPropertyAsString

public String getPropertyAsString(String key,
                                  String defaultValue)

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


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.


propertyIterator

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

Returns:
PropertyIterator

removeProperty

public void removeProperty(String key)

clone

public Object clone()

traverse

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


getThreadContext

public JMeterContext getThreadContext()
Returns:
Returns the threadContext.

setThreadContext

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

getThreadName

public String getThreadName()
Returns:
Returns the threadName.

setThreadName

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

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

getName

public String getName()

setName

public void setName(String name)

getComment

public String getComment()

setComment

public void setComment(String comment)

Apache JMeter

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