Note |
---|
In CDI mode, the default reactor strategy is |
...
OpenWebBeans Container
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
...
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
Pax Exam starts a com.caucho.resin.ResinBeanContainer
and uses the CDI BeanManager
to fill all injection points of test classes instantiated by the driver.
CanDI, the Resin CDI implementation, does not have a stand-alone distribution artifact, so this container requires the full com.caucho:resin
artifact as a dependency.
...