Package com.consol.citrus.common
Interface TestLoader
-
public interface TestLoaderTest loader interface.- Since:
- 2.1
- Author:
- Christoph Deppisch
-
-
Field Summary
Fields Modifier and Type Field Description static StringGROOVYstatic org.slf4j.LoggerLOGLoggerstatic StringRESOURCE_PATHTest loader resource lookup pathstatic StringSPRINGstatic ResourcePathTypeResolverTYPE_RESOLVERDefault Citrus test loader from classpath resource propertiesstatic StringXMLstatic StringYAML
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconfigureTestCase(Consumer<TestCase> handler)Adds test case handler that is called before test case gets executed.voiddoWithTestCase(Consumer<TestCase> handler)Adds test case handler that is called once the test case has been loaded.TestCasegetTestCase()Gets the loaded test case or null if has not been loaded yet.voidload()Loads and creates new test case object..static Map<String,TestLoader>lookup()Resolves all available test loader from resource path lookup.static Optional<TestLoader>lookup(String loader)Resolves test loader from resource path lookup with given resource name.voidsetPackageName(String packageName)voidsetTestClass(Class<?> testClass)voidsetTestName(String testName)
-
-
-
Field Detail
-
LOG
static final org.slf4j.Logger LOG
Logger
-
RESOURCE_PATH
static final String RESOURCE_PATH
Test loader resource lookup path- See Also:
- Constant Field Values
-
TYPE_RESOLVER
static final ResourcePathTypeResolver TYPE_RESOLVER
Default Citrus test loader from classpath resource properties
-
XML
static final String XML
- See Also:
- Constant Field Values
-
YAML
static final String YAML
- See Also:
- Constant Field Values
-
SPRING
static final String SPRING
- See Also:
- Constant Field Values
-
GROOVY
static final String GROOVY
- See Also:
- Constant Field Values
-
-
Method Detail
-
load
void load()
Loads and creates new test case object..
-
configureTestCase
void configureTestCase(Consumer<TestCase> handler)
Adds test case handler that is called before test case gets executed.- Parameters:
handler-
-
doWithTestCase
void doWithTestCase(Consumer<TestCase> handler)
Adds test case handler that is called once the test case has been loaded.- Parameters:
handler-
-
setTestClass
void setTestClass(Class<?> testClass)
-
setTestName
void setTestName(String testName)
-
setPackageName
void setPackageName(String packageName)
-
getTestCase
TestCase getTestCase()
Gets the loaded test case or null if has not been loaded yet.- Returns:
-
lookup
static Map<String,TestLoader> lookup()
Resolves all available test loader from resource path lookup. Scans classpath for test loader meta information and instantiates the components.- Returns:
-
lookup
static Optional<TestLoader> lookup(String loader)
Resolves test loader from resource path lookup with given resource name. Scans classpath for test loader meta information with given name and returns instance of the loader. Returns optional instead of throwing exception when no test loader could be found.- Parameters:
loader-- Returns:
-
-