Versions Compared

Key

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

...

Name

Testing Frameworks Supported

Description

Required Camel Test Dependencies

CamelSpringTestSupport

  • JUnit 3.x (deprecated)
  • JUnit 4.x
  • TestNG - Camel 2.8

Provided by org.apache.camel.test.CamelSpringTestSupport, org.apache.camel.test.junit4.CamelSpringTestSupport, and org.apache.camel.testng.CamelSpringTestSupport.  These base classes provide feature parity with the simple CamelTestSupport classes from Camel Test but do not support Spring annotations on the test class such as @Autowired@DirtiesContext, and @ContextConfiguration.

  • JUnit 3.x (deprecated) - camel-test-spring
  • JUnit 4.x - camel-test-spring
  • TestNG - camel-test-ng

Plain Spring Test

  • JUnit 3.x
  • JUnit 4.x
  • TestNG

Extend the abstract base classes (org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests, org.springframework.test.context.junit38.AbstractJUnit4SpringContextTests, etc.) provided in Spring Test or use the Spring Test JUnit4 runner.  These approaches support both the Camel annotations and Spring annotations, but do not have feature parity with org.apache.camel.test.CamelTestSupport, org.apache.camel.test.junit4.CamelTestSupport, and org.apache.camel.testng.CamelSpringTestSupport.

  • JUnit 3.x (deprecated) - None
  • JUnit 4.x - None
  • TestNG - None

Camel Enhanced Spring Test

  • JUnit 4.x - Camel 2.10
  • TestNG - Camel 2.10

Use the org.apache.camel.test.junit4.CamelSpringJUnit4ClassRunner runner with the @RunWith annotation or extend org.apache.camel.testng.AbstractCamelTestNGSpringContextTests to enable feature parity with org.apache.camel.test.CamelTestSupport and org.apache.camel.test.junit4.CamelTestSupport and also support the full suite of Spring Test annotations such as @Autowired@DirtiesContext, and @ContextConfiguration.

  • JUnit 3.x (deprecated) - camel-test-spring
  • JUnit 4.x - camel-test-spring
  • TestNG - camel-test-ng

CamelSpringTestSupport

org.apache.camel.test.CamelSpringTestSupport, org.apache.camel.test.junit4.CamelSpringTestSupport, and org.apache.camel.testng.CamelSpringTestSupport extend their non-Spring aware counterparts (org.apache.camel.test.CamelTestSupport, org.apache.camel.test.junit4.CamelTestSupport, and org.apache.camel.testng.CamelTestSupport) and deliver integration with Spring into your test classes.  Instead of instantiating the CamelContext and routes programmatically, these classes rely on a Spring context to wire the needed components together.  If your test extends one of these classes, you must provide the Spring context by implementing the following method.

...