Class SingleTestElementCallBuilder<T extends org.apache.jmeter.testelement.TestElement>
- java.lang.Object
-
- us.abstracta.jmeter.javadsl.codegeneration.MethodCallBuilder
-
- us.abstracta.jmeter.javadsl.codegeneration.SingleTestElementCallBuilder<T>
-
- Type Parameters:
T- is the type of the JMeter test element instance used to check if the MethodCallBuilder applies to it or not.
- Direct Known Subclasses:
AutoEnabledHttpConfigElement.CodeBuilder,DslAuthManager.CodeBuilder,DslConstantTimer.CodeBuilder,DslCounter.CodeBuilder,DslDebugPostProcessor.CodeBuilder,DslDummySampler.CodeBuilder,DslFlowControlAction.CodeBuilder,DslForEachController.CodeBuilder,DslIfController.CodeBuilder,DslIncludeController.CodeBuilder,DslJsr223TestElement.Jsr223TestElementCallBuilder,DslModuleController.CodeBuilder,DslOnceOnlyController.CodeBuilder,DslProxyControl.CodeBuilder,DslRecordingController.CodeBuilder,DslRuntimeController.CodeBuilder,DslScopedTestElement.ScopedTestElementCallBuilder,DslSimpleController.CodeBuilder,DslSimpleThreadGroup.SimpleThreadGroupCodeBuilder,DslSynchronizingTimer.CodeBuilder,DslTestPlan.CodeBuilder,DslThroughputTimer.CodeBuilder,DslTransactionController.CodeBuilder,DslUniformRandomTimer.CodeBuilder,DslVariables.CodeBuilder,DslWeightedSwitchController.CodeBuilder,DslWhileController.CodeBuilder,ForLoopController.CodeBuilder,HttpHeaders.CodeBuilder,JtlWriter.CodeBuilder,ResponseFileSaver.CodeBuilder
public abstract class SingleTestElementCallBuilder<T extends org.apache.jmeter.testelement.TestElement> extends MethodCallBuilder
Abstracts common logic for usual scenario where MethodCallBuilders apply to only one type of JMeter test element.In most of the cases a
MethodCallBuildercan simply extend this orSingleGuiClassCallBuilderclass. Scenarios where these classes would not be used are complex ones which cover several test elements. Eg:DslDefaultThreadGrouphandles both JMeter default thread groups but also ultimate thread groups.This class abstracts logic of checking if a test element MethodCall should be generated by this builder or not, just comparing if the test element is of the type associated to the MethodCallBuilder instance.
- Since:
- 0.45
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<T>testElementClass-
Fields inherited from class us.abstracta.jmeter.javadsl.codegeneration.MethodCallBuilder
builderMethods
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSingleTestElementCallBuilder(Class<T> testElementClass, List<Method> builderMethods)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract MethodCallbuildMethodCall(T testElement, MethodCallContext context)Builds aMethodCallfor the given test element.protected MethodCallbuildMethodCall(MethodCallContext context)Generates the method call instance for the particular DSL test element.booleanmatches(MethodCallContext context)Allows checking if this builder can build method calls for the given context.-
Methods inherited from class us.abstracta.jmeter.javadsl.codegeneration.MethodCallBuilder
buildMethodCall, getBuilderOptionName, order, propertyIterator2Stream
-
-
-
-
Method Detail
-
matches
public boolean matches(MethodCallContext context)
Description copied from class:MethodCallBuilderAllows checking if this builder can build method calls for the given context.This method is invoked in every registered MethodCallBuilder, until one is found that matches.
- Specified by:
matchesin classMethodCallBuilder- Parameters:
context- provides information used to determine if a method call might be created by this builder. For example: JMeter test plan tree node test element, parent context, a map of entries to host custom information, etc.- Returns:
- true if this builder knows how to build a method call for the context, false otherwise.
-
buildMethodCall
protected MethodCall buildMethodCall(MethodCallContext context)
Description copied from class:MethodCallBuilderGenerates the method call instance for the particular DSL test element.You can check
DslTestPlan.CodeBuilderto get an idea of how a general implementation of this method looks likeIf you find a scenario where your MethodCallBuilder applies to the given context, but no code has to be generated for it, then use
MethodCall.emptyCall()to return a call that generates no code.- Specified by:
buildMethodCallin classMethodCallBuilder- Parameters:
context- provides all information that might be required to generate the method call. For example: JMeter test plan tree node test element, parent context, a map of entries to host custom information, etc.- Returns:
- generated method call for the DSL test element.
-
buildMethodCall
protected abstract MethodCall buildMethodCall(T testElement, MethodCallContext context)
Builds aMethodCallfor the given test element.When this method is invoked, the test element has already been checked to be of the proper type, so no further checking in that regard should be needed.
- Parameters:
testElement- is the test element instance to build the MethodCall for.context- is the context of the method call.- Returns:
- the generated MethodCall instance.
-
-