Class BaseTestElement
- java.lang.Object
-
- us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
-
- All Implemented Interfaces:
DslTestElement
- Direct Known Subclasses:
AutoStopListener,BaseConfigElement,BaseListener,BaseTimer,DslDebugPostProcessor,DslJsonAssertion,DslJsr223TestElement,DslScopedTestElement,TestElementContainer
public abstract class BaseTestElement extends Object implements DslTestElement
Provides the basic logic for allDslTestElement.In particular, it currently allows to set the name of the TestElement and abstracts building of the tree only requiring, from subclasses, to implement the logic to build the JMeter TestElement. The test element name is particularly useful for later reporting and statistics collection to differentiate metrics for each test element.
Subclasses may overwrite
buildTreeUnder(org.apache.jorphan.collections.HashTree, us.abstracta.jmeter.javadsl.core.BuildTreeContext)if they need additional logic (e.g:TestElementContainer).- Since:
- 0.1
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseTestElement(String name, Class<? extends org.apache.jmeter.gui.JMeterGUIComponent> guiClass)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.apache.jmeter.testelement.TestElementbuildConfiguredTestElement()protected abstract org.apache.jmeter.testelement.TestElementbuildTestElement()protected ComponentbuildTestElementGui(org.apache.jmeter.testelement.TestElement testElement)org.apache.jorphan.collections.HashTreebuildTreeUnder(org.apache.jorphan.collections.HashTree parent, BuildTreeContext context)Builds the JMeter HashTree for this TestElement under the provided tree node.protected static org.apache.jmeter.testelement.TestElementconfigureTestElement(org.apache.jmeter.testelement.TestElement ret, String name, Class<? extends org.apache.jmeter.gui.JMeterGUIComponent> guiClass)protected static longdurationToSeconds(Duration duration)static voidloadBeanProperties(org.apache.jmeter.testelement.TestElement bean)protected voidshowAndWaitFrameWith(Component content, String title, int width, int height)protected voidshowFrameWith(Component content, String title, int width, int height, Runnable closeListener)voidshowInGui()Shows the test element in it's defined GUI in a popup window.voidshowTestElementGui(Component guiComponent, Runnable closeListener)
-
-
-
Method Detail
-
buildTreeUnder
public org.apache.jorphan.collections.HashTree buildTreeUnder(org.apache.jorphan.collections.HashTree parent, BuildTreeContext context)Description copied from interface:DslTestElementBuilds the JMeter HashTree for this TestElement under the provided tree node.- Specified by:
buildTreeUnderin interfaceDslTestElement- Parameters:
parent- the node which will be the parent for the created tree.context- context information which contains information shared by elements while building the test plan tree (eg: adding additional items to test plan when a particular protocol element is added).- Returns:
- The tree created under the parent node.
-
buildConfiguredTestElement
protected org.apache.jmeter.testelement.TestElement buildConfiguredTestElement()
-
configureTestElement
protected static org.apache.jmeter.testelement.TestElement configureTestElement(org.apache.jmeter.testelement.TestElement ret, String name, Class<? extends org.apache.jmeter.gui.JMeterGUIComponent> guiClass)
-
buildTestElement
protected abstract org.apache.jmeter.testelement.TestElement buildTestElement()
-
loadBeanProperties
public static void loadBeanProperties(org.apache.jmeter.testelement.TestElement bean)
-
showInGui
public void showInGui()
Description copied from interface:DslTestElementShows the test element in it's defined GUI in a popup window. This might be handy to visualize the element as it looks in JMeter GUI.- Specified by:
showInGuiin interfaceDslTestElement
-
buildTestElementGui
protected Component buildTestElementGui(org.apache.jmeter.testelement.TestElement testElement)
-
showFrameWith
protected void showFrameWith(Component content, String title, int width, int height, Runnable closeListener)
-
showAndWaitFrameWith
protected void showAndWaitFrameWith(Component content, String title, int width, int height)
-
durationToSeconds
protected static long durationToSeconds(Duration duration)
-
-