Class SingleTestElementCallBuilder<T extends org.apache.jmeter.testelement.TestElement>

    • Field Detail

      • testElementClass

        protected final Class<T extends org.apache.jmeter.testelement.TestElement> testElementClass
    • Constructor Detail

      • SingleTestElementCallBuilder

        protected SingleTestElementCallBuilder​(Class<T> testElementClass,
                                               List<Method> builderMethods)
    • Method Detail

      • matches

        public boolean matches​(MethodCallContext context)
        Description copied from class: MethodCallBuilder
        Allows 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:
        matches in class MethodCallBuilder
        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: MethodCallBuilder
        Generates the method call instance for the particular DSL test element.

        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.

        Specified by:
        buildMethodCall in class MethodCallBuilder
        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 a 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.

        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.