Apache JMeter
2.0.1.20050615

org.apache.jmeter.testelement
Interface TestElement

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

public interface TestElement
extends Cloneable

Version:
$Revision: 1.12.2.1 $
Author:
Michael Stover

Field Summary
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()
           
 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.
 float getPropertyAsFloat(String key)
           
 int getPropertyAsInt(String key)
           
 long getPropertyAsLong(String key)
           
 String getPropertyAsString(String key)
           
 JMeterContext getThreadContext()
           
 String getThreadName()
           
 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 setProperty(JMeterProperty property)
          Sets and overwrites a property in the TestElement.
 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 threadFinished()
          Called at the end of each thread.
 void threadStarted()
          Called at the start of each thread.
 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
Method Detail

addTestElement

public void addTestElement(TestElement child)

setProperty

public void setProperty(String key,
                        String value)

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.


getPropertyAsLong

public long getPropertyAsLong(String key)

getPropertyAsInt

public int getPropertyAsInt(String key)

getPropertyAsFloat

public float getPropertyAsFloat(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)

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.

threadStarted

public void threadStarted()
Called at the start of each thread. TODO - should it hava a parameter?


threadFinished

public void threadFinished()
Called at the end of each thread. TODO - should it hava a parameter?


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

Apache JMeter
2.0.1.20050615

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