Package com.consol.citrus.junit
Class CitrusFrameworkMethod
- java.lang.Object
-
- org.junit.runners.model.FrameworkMember<org.junit.runners.model.FrameworkMethod>
-
- org.junit.runners.model.FrameworkMethod
-
- com.consol.citrus.junit.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCitrusFrameworkMethod.Runner
-
Constructor Summary
Constructors Constructor Description CitrusFrameworkMethod(Method method, String testName, String packageName)Returns a newFrameworkMethodformethodCitrusFrameworkMethod(Method method, String type, String testName, String packageName)Returns a newFrameworkMethodformethod
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String key)Gets attribute value from framework method.RuntimeExceptiongetError()Gets the optional error on this framework method.StringgetPackageName()Gets the test package name.StringgetSource()Gets the test source.StringgetSourceType()StringgetTestName()Gets the test name.booleanhasError()Checks if this framework method has an error.voidsetAttribute(String key, Object value)Adds attribute value to framework method.voidsetError(RuntimeException error)Sets an error on the framework method.voidsetSource(String source)voidsetSourceType(String type)CitrusFrameworkMethodwithError(RuntimeException error)Adds error to this framework method.-
Methods inherited from class org.junit.runners.model.FrameworkMethod
equals, getAnnotation, getAnnotations, getDeclaringClass, getMethod, getModifiers, getName, getReturnType, getType, hashCode, invokeExplosively, isShadowedBy, producesType, toString, validateNoTypeParametersOnArgs, validatePublicVoid, validatePublicVoidNoArg
-
-
-
-
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:
-
setSource
public void setSource(String source)
- Specified by:
setSourcein interfaceTestSourceAware
-
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:
-
withError
public CitrusFrameworkMethod withError(RuntimeException error)
Adds error to this framework method.- Parameters:
error-- 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:
-
-