Package org.citrusframework
Class CitrusContext
java.lang.Object
org.citrusframework.CitrusContext
- All Implemented Interfaces:
MessageListenerAware,TestActionListenerAware,TestListenerAware,TestReporterAware,TestSuiteListenerAware,ReferenceRegistry
public class CitrusContext
extends Object
implements TestListenerAware, TestActionListenerAware, TestSuiteListenerAware, TestReporterAware, MessageListenerAware, ReferenceRegistry
Default Citrus context implementation holds basic components used in Citrus.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCitrusContext(CitrusContext.Builder builder) Protected constructor using given builder to construct this instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(String name, Object component) voidaddMessageListener(MessageListener listener) voidaddTestActionListener(TestActionListener testActionListener) voidaddTestListener(TestListener testListener) voidaddTestReporter(TestReporter testReporter) voidaddTestSuiteListener(TestSuiteListener suiteListener) voidvoidclose()Closes the context and all its components.static CitrusContextcreate()Initializing method loads default configuration class and reads component definitions such as test listeners and test context factory.Creates a new test context.Gets list of after suite actions in this context.Gets list of before suite actions in this context.Obtains the endpointFactory.Obtains the functionRegistry.Obtains the globalVariables.Gets the logModifier.Obtains the messageListeners.Obtains the messageProcessors.Obtains the messageValidatorRegistry.Obtains the namespaceContextBuilder.Obtains the referenceResolver.Gets the test action listeners in this context.Obtains the testContextFactory.Gets test listeners in this context.Gets test suite listeners in this context.Obtains the typeConverter.Obtains the validationMatcherRegistry.voidhandleTestResults(TestResults testResults) voidparseConfiguration(Class<?> configClass) Parse given configuration class and bind annotated fields, methods to reference registry.voidparseConfiguration(Object configuration) Parse given configuration class and bind annotated fields, methods to reference registry.
-
Constructor Details
-
CitrusContext
Protected constructor using given builder to construct this instance.- Parameters:
builder- the instance builder.
-
-
Method Details
-
create
Initializing method loads default configuration class and reads component definitions such as test listeners and test context factory.- Returns:
-
parseConfiguration
Parse given configuration class and bind annotated fields, methods to reference registry.- Parameters:
configClass-
-
parseConfiguration
Parse given configuration class and bind annotated fields, methods to reference registry.- Parameters:
configuration-
-
createTestContext
Creates a new test context.- Returns:
- the new citrus test context.
-
addTestSuiteListener
- Specified by:
addTestSuiteListenerin interfaceTestSuiteListenerAware
-
addTestListener
- Specified by:
addTestListenerin interfaceTestListenerAware
-
addTestActionListener
- Specified by:
addTestActionListenerin interfaceTestActionListenerAware
-
addTestReporter
- Specified by:
addTestReporterin interfaceTestReporterAware
-
addMessageListener
- Specified by:
addMessageListenerin interfaceMessageListenerAware
-
close
public void close()Closes the context and all its components. -
getAfterSuite
Gets list of after suite actions in this context.- Returns:
-
getBeforeSuite
Gets list of before suite actions in this context.- Returns:
-
getTestListeners
Gets test listeners in this context.- Returns:
-
getTestActionListeners
Gets the test action listeners in this context.- Returns:
-
getTestSuiteListeners
Gets test suite listeners in this context.- Returns:
-
getFunctionRegistry
Obtains the functionRegistry.- Returns:
-
getValidationMatcherRegistry
Obtains the validationMatcherRegistry.- Returns:
-
getGlobalVariables
Obtains the globalVariables.- Returns:
-
getMessageValidatorRegistry
Obtains the messageValidatorRegistry.- Returns:
-
getMessageListeners
Obtains the messageListeners.- Returns:
-
getEndpointFactory
Obtains the endpointFactory.- Returns:
-
getReferenceResolver
Obtains the referenceResolver.- Returns:
-
getMessageProcessors
Obtains the messageProcessors.- Returns:
-
getNamespaceContextBuilder
Obtains the namespaceContextBuilder.- Returns:
-
getTypeConverter
Obtains the typeConverter.- Returns:
-
getLogModifier
Gets the logModifier.- Returns:
-
getTestContextFactory
Obtains the testContextFactory.- Returns:
-
bind
- Specified by:
bindin interfaceReferenceRegistry
-
getTestResults
-
handleTestResults
-
addComponent
-