Class Citrus

java.lang.Object
org.citrusframework.Citrus
All Implemented Interfaces:
org.citrusframework.report.MessageListenerAware, org.citrusframework.report.TestActionListenerAware, org.citrusframework.report.TestListenerAware, org.citrusframework.report.TestReporterAware, org.citrusframework.report.TestSuiteListenerAware

public final class Citrus extends Object implements org.citrusframework.report.TestListenerAware, org.citrusframework.report.TestActionListenerAware, org.citrusframework.report.TestSuiteListenerAware, org.citrusframework.report.TestReporterAware, org.citrusframework.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
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addMessageListener(org.citrusframework.report.MessageListener listener)
     
    void
    addTestActionListener(org.citrusframework.report.TestActionListener testListener)
     
    void
    addTestListener(org.citrusframework.report.TestListener testListener)
     
    void
    addTestReporter(org.citrusframework.report.TestReporter testReporter)
     
    void
    addTestSuiteListener(org.citrusframework.report.TestSuiteListener suiteListener)
     
    void
    afterSuite(String suiteName, String... testGroups)
    Performs after suite test actions.
    void
    beforeSuite(String suiteName, String... testGroups)
    Performs before suite test actions.
    void
    Closing Citrus and its context.
    Obtains the citrusContext.
    static String
    Gets the Citrus version from classpath resource properties.
    static Citrus
    Initializing method creating a Citrus instance with new default CitrusContext and its components such as test listeners and test context factory.
    static Citrus
    Initializing method creating a Citrus instance with given Citrus context provider.
    void
    run(org.citrusframework.TestAction action)
    Runs a test action which can also be a whole test case.
    void
    run(org.citrusframework.TestAction action, org.citrusframework.context.TestContext testContext)
    Runs test action with given test context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • newInstance

      public static Citrus newInstance()
      Initializing method creating a Citrus instance with new default CitrusContext and its components such as test listeners and test context factory.
      Returns:
    • newInstance

      public static Citrus newInstance(CitrusContextProvider contextProvider)
      Initializing method creating a Citrus instance with given Citrus context provider. Provider creates new CitrusContext 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(org.citrusframework.TestAction action)
      Runs a test action which can also be a whole test case.
    • run

      public void run(org.citrusframework.TestAction action, org.citrusframework.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.
    • addTestSuiteListener

      public void addTestSuiteListener(org.citrusframework.report.TestSuiteListener suiteListener)
      Specified by:
      addTestSuiteListener in interface org.citrusframework.report.TestSuiteListenerAware
    • addTestListener

      public void addTestListener(org.citrusframework.report.TestListener testListener)
      Specified by:
      addTestListener in interface org.citrusframework.report.TestListenerAware
    • addTestActionListener

      public void addTestActionListener(org.citrusframework.report.TestActionListener testListener)
      Specified by:
      addTestActionListener in interface org.citrusframework.report.TestActionListenerAware
    • addTestReporter

      public void addTestReporter(org.citrusframework.report.TestReporter testReporter)
      Specified by:
      addTestReporter in interface org.citrusframework.report.TestReporterAware
    • addMessageListener

      public void addMessageListener(org.citrusframework.report.MessageListener listener)
      Specified by:
      addMessageListener in interface org.citrusframework.report.MessageListenerAware
    • getCitrusContext

      public CitrusContext getCitrusContext()
      Obtains the citrusContext.
    • close

      public void close()
      Closing Citrus and its context.