Class Citrus

  • All Implemented Interfaces:
    com.consol.citrus.report.MessageListenerAware, com.consol.citrus.report.TestListenerAware, com.consol.citrus.report.TestReporterAware, com.consol.citrus.report.TestSuiteListenerAware

    public final class Citrus
    extends Object
    implements com.consol.citrus.report.TestListenerAware, com.consol.citrus.report.TestSuiteListenerAware, com.consol.citrus.report.TestReporterAware, com.consol.citrus.report.MessageListenerAware
    Citrus main class initializes a new Citrus runtime environment with a Citrus context. Provides before/after suite action execution and test execution methods.
    Since:
    2.1
    Author:
    Christoph Deppisch
    • Method Detail

      • newInstance

        public static Citrus newInstance()
        Initializing method with given Citrus context and its components such as test listeners and test context factory.
        Returns:
      • newInstance

        public static Citrus newInstance​(CitrusContext citrusContext)
        Initializing method with given Citrus context and its components such as test listeners and test context factory.
        Returns:
      • beforeSuite

        public void beforeSuite​(String suiteName,
                                String... testGroups)
        Performs before suite test actions.
        Parameters:
        suiteName -
        testGroups -
      • afterSuite

        public void afterSuite​(String suiteName,
                               String... testGroups)
        Performs after suite test actions.
        Parameters:
        suiteName -
        testGroups -
      • run

        public void run​(com.consol.citrus.TestAction action)
        Runs a test action which can also be a whole test case.
      • run

        public void run​(com.consol.citrus.TestAction action,
                        com.consol.citrus.context.TestContext testContext)
        Runs test action with given test context. Test action can also be a whole test case.
        Parameters:
        action -
        testContext -
      • getVersion

        public static String getVersion()
        Gets the Citrus version from classpath resource properties.
        Returns:
      • addTestSuiteListener

        public void addTestSuiteListener​(com.consol.citrus.report.TestSuiteListener suiteListener)
        Specified by:
        addTestSuiteListener in interface com.consol.citrus.report.TestSuiteListenerAware
      • addTestListener

        public void addTestListener​(com.consol.citrus.report.TestListener testListener)
        Specified by:
        addTestListener in interface com.consol.citrus.report.TestListenerAware
      • addTestReporter

        public void addTestReporter​(com.consol.citrus.report.TestReporter testReporter)
        Specified by:
        addTestReporter in interface com.consol.citrus.report.TestReporterAware
      • addMessageListener

        public void addMessageListener​(com.consol.citrus.report.MessageListener listener)
        Specified by:
        addMessageListener in interface com.consol.citrus.report.MessageListenerAware
      • getCitrusContext

        public CitrusContext getCitrusContext()
        Obtains the citrusContext.
        Returns:
      • close

        public void close()
        Closing Citrus and its context.