T - is the type of the JMeter test element instance used to check if the MethodCallBuilder
applies to it or not.public abstract class SingleTestElementCallBuilder<T extends org.apache.jmeter.testelement.TestElement> extends MethodCallBuilder
In most of the cases a MethodCallBuilder can simply extend this or SingleGuiClassCallBuilder class. Scenarios where these classes would not be used are complex
ones which cover several test elements. Eg:
DslDefaultThreadGroup
handles 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.
| Modifier and Type | Field and Description |
|---|---|
protected Class<T> |
testElementClass |
builderMethods| Modifier | Constructor and Description |
|---|---|
protected |
SingleTestElementCallBuilder(Class<T> testElementClass,
List<Method> builderMethods) |
| Modifier and Type | Method and Description |
|---|---|
protected MethodCall |
buildMethodCall(MethodCallContext context)
Generates the method call instance for the particular DSL test element.
|
protected abstract MethodCall |
buildMethodCall(T testElement,
MethodCallContext context)
Builds a
MethodCall for the given test element. |
boolean |
matches(MethodCallContext context)
Allows checking if this builder can build method calls for the given context.
|
buildMethodCall, getBuilderOptionName, order, propertyIterator2Streampublic boolean matches(MethodCallContext context)
MethodCallBuilderThis method is invoked in every registered MethodCallBuilder, until one is found that matches.
matches in class MethodCallBuildercontext - 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.protected MethodCall buildMethodCall(MethodCallContext context)
MethodCallBuilder
You can check DslTestPlan.CodeBuilder to get an idea
of how a general implementation of this method looks like
If 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.
buildMethodCall in class MethodCallBuildercontext - 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.protected abstract MethodCall buildMethodCall(T testElement, MethodCallContext context)
MethodCall for 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.
testElement - is the test element instance to build the MethodCall for.context - is the context of the method call.Copyright © 2023. All rights reserved.