Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameTesting Frameworks SupportedDescription
Camel CDI Test
  • JUnit 4

Available as of Camel 2.17

The Camel CDI test module (camel-test-cdi) provides a JUnit runner that bootstraps a test environment using CDI so that you don't have to be familiar with any CDI testing frameworks and can concentrate on the testing logic of your Camel CDI applications.

Arquillian
  • JUnit 4
  • TestNG 5
Arquillian is a testing platform that handles all the plumbing of in-container testing with support for a wide range of target containers. Arquillian can be configured to run your test classes in embedded (in JVM CDI), managed (a real Web server or Java EE application server instance started in a separate process) or remote (the lifecycle of the container isn't managed by Arquillian) modes. You have to create the System Under Test (SUT) in your test classes using ShrinkWrap descriptors. The benefit is that you have a very fine-grained control over the application configuration that you want to test. The downside is more code and more complex classpath / class loading structure.
PAX Exam
  • JUnit 4
  • TestNG 6
PAX Exam lets you test your Camel applications in OSGi, Java EE or standalone CDI containers with the ability to finely configure your System Under Test (SUT), similarly to Arquillian. You can use it to test your Camel CDI applications that target OSGi environments like Karaf with PAX CDI, but you can use it as well to test your Camel CDI applications in standalone CDI containers, Web containers and Java EE containers.

...

Code Block
languagexml
<dependencies>


    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.shrinkwrap.descriptors</groupId>
      <artifactId>shrinkwrap-descriptors-depchain</artifactId>
      <type>pom</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-weld-se-embedded-1.1</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-core</artifactId>
      <scope>test</scope>
    </dependency>

</dependencies>

...

Code Block
languagexml
</dependencies>
 
  <dependency>
    <groupId>org.jboss.arquillian.junit</groupId>
    <artifactId>arquillian-junit-container</artifactId>
    <scope>test</scope>
  </dependency>

  <dependency>
    <groupId>org.jboss.arquillian.testenricher</groupId>
    <artifactId>arquillian-testenricher-resource</artifactId>
    <scope>test</scope>
  </dependency>

  <dependency>
    <groupId>org.jboss.shrinkwrap.descriptors</groupId>
    <artifactId>shrinkwrap-descriptors-depchain</artifactId>
    <type>pom</type>
    <scope>test</scope>
  </dependency>

  <dependency>
    <groupId>org.jboss.weld.servlet</groupId>
    <artifactId>weld-servlet</artifactId>
    <scope>test</scope>
  </dependency>
 
  <dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-webapp</artifactId>
    <scope>test</scope>
  </dependency>

  <dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-annotations</artifactId>
    <scope>test</scope>
  </dependency>

  <dependency>
    <groupId>org.jboss.arquillian.container</groupId>
    <artifactId>arquillian-jetty-embedded-9</artifactId>
    <scope>test</scope>
  </dependency>

</dependencies>

...