Class CitrusFrameworkMethod

  • All Implemented Interfaces:
    TestSourceAware, org.junit.runners.model.Annotatable

    public class CitrusFrameworkMethod
    extends org.junit.runners.model.FrameworkMethod
    implements TestSourceAware
    Special framework method also holding test name and package coming from the Citrus test annotation. This way execution can decide which test to invoke in case the annotation has more than one test name defined or a package scan is used in the annotation.
    • Constructor Detail

      • CitrusFrameworkMethod

        public CitrusFrameworkMethod​(Method method,
                                     String testName,
                                     String packageName)
        Returns a new FrameworkMethod for method
        Parameters:
        method -
      • CitrusFrameworkMethod

        public CitrusFrameworkMethod​(Method method,
                                     String type,
                                     String testName,
                                     String packageName)
        Returns a new FrameworkMethod for method
        Parameters:
        method -
    • Method Detail

      • getSourceType

        public String getSourceType()
      • setSourceType

        public void setSourceType​(String type)
      • getTestName

        public String getTestName()
        Gets the test name.
        Returns:
      • getPackageName

        public String getPackageName()
        Gets the test package name.
        Returns:
      • getSource

        public String getSource()
        Gets the test source.
        Returns:
      • setAttribute

        public void setAttribute​(String key,
                                 Object value)
        Adds attribute value to framework method.
        Parameters:
        key -
        value -
      • getAttribute

        public Object getAttribute​(String key)
        Gets attribute value from framework method.
        Parameters:
        key -
        Returns:
      • hasError

        public boolean hasError()
        Checks if this framework method has an error.
        Returns:
      • setError

        public void setError​(RuntimeException error)
        Sets an error on the framework method. Error will be thrown once the framework method is about to be executed.
        Parameters:
        error -
      • getError

        public RuntimeException getError()
        Gets the optional error on this framework method. The caller of this framework method should check the error and throw it accordingly before execution.
        Returns: