Package org.citrusframework
Class CitrusInstanceManager
java.lang.Object
org.citrusframework.CitrusInstanceManager
Instance creation manager creates new Citrus instances or always a singleton based on instance creation strategy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static CitrusInstanceStrategyStrategy decides which instances are created -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddInstanceProcessor(CitrusInstanceProcessor processor) Add instance processor.get()Gets the actual instance that has been created with this manager.static CitrusProvide access to the current Citrus instance.static booleanCheck if there has already been an instance instantiated using this manager.static voidmode(CitrusInstanceStrategy mode) Sets the instance creation strategy.static CitrusInitializing method loads Citrus context and reads bean definitions such as test listeners and test context factory.static CitrusnewInstance(CitrusContextProvider contextProvider) Create new Citrus instance with given context.static voidreset()Removes current Citrus instance if any.
-
Field Details
-
strategy
Strategy decides which instances are created
-
-
Constructor Details
-
CitrusInstanceManager
public CitrusInstanceManager()
-
-
Method Details
-
addInstanceProcessor
Add instance processor.- Parameters:
processor-
-
newInstance
Initializing method loads Citrus context and reads bean definitions such as test listeners and test context factory.- Returns:
-
newInstance
Create new Citrus instance with given context.- Parameters:
contextProvider-- Returns:
-
mode
Sets the instance creation strategy.- Parameters:
mode-
-
get
Gets the actual instance that has been created with this manager.- Returns:
-
getOrDefault
Provide access to the current Citrus instance. Create new instance if it has not been initialized yet.- Returns:
-
hasInstance
public static boolean hasInstance()Check if there has already been an instance instantiated using this manager.- Returns:
-
reset
public static void reset()Removes current Citrus instance if any.
-