...
Pax Exam starts an org.apache.webbeans.cditest.CdiTestContainer and uses the CDI BeanManager to fill all injection points of test classes instantiated by the driver.
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
<!-- Pax Exam -->
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-openwebbeans</artifactId>
<version>${exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-junit4</artifactId>
<version>${exam.version}</version>
<scope>test</scope>
</dependency>
<!-- Java EE APIs -->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<scope>provided</scope>
</dependency>
<!-- Logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>0.9.29</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.29</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<scope>test</scope>
</dependency> |
To work with the OpenWebBeans Container, you need the pax-exam-container-openwebbeans artifact and a test driver. At the moment, only pax-exam-junit4 is supported. In addition, you need (a subset of) the Java EE APIs and some logging artifacts.
Pax Exam uses SLF4J whereas OpenWebBeans uses java.util.logging internally. Using the jul-to-slf4j bridge, you can redirect java.util.logging messages to SLF4J.
| Anchor | ||||
|---|---|---|---|---|
|
Weld Container
Pax Exam starts an org.jboss.weld.environment.se.WeldContainer and uses the CDI BeanManager to fill all injection points of test classes instantiated by the driver.
To work with the Weld Container, you need the pax-exam-container-weld artifact and a test driver. At the moment, only pax-exam-junit4 is supported. In addition, you need (a subset of) the Java EE APIs and some logging artifacts.
| Code Block | ||||
|---|---|---|---|---|
| ||||
<!-- Pax Exam --> <dependency> <groupId>org.ops4j.pax.exam</groupId> <artifactId>pax-exam-container-weld</artifactId> <version>${exam.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.ops4j.pax.exam</groupId> <artifactId>pax-exam-junit4</artifactId> <version>${exam.version}</version> <scope>test</scope> </dependency> <!-- Java EE APIs --> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-atinject_1.0_spec</artifactId> <scope>provided</scope> </dependency> <!-- Logging --> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>0.9.29</version> <scope>test</scope> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.29</version> <scope>test</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> |
| Anchor | ||||
|---|---|---|---|---|
|
CanDI Container
...