A DeployableContainer implementation that can run and connect to a embedded (same JVM) Jetty 6.1 Servlet Container. The minimum recommended
version is Jetty 6.1.12, though you can use an earlier 6.1 version if you aren't using JNDI resources. Only select EE APIs are available, such as
JNDI and Servlet 2.5. This implementation has lifecycle support, so the container will be started and stopped as part of the test run.
Container Injection Support Matrix
@Resource
|
@EJB
|
@EJB (no-interface)
|
@Inject (CDI)
|
@Inject (MC)
|
@PersistenceContext @PersistenceUnit
|
|
|
|
|
|
|
CDI support requires use of Weld Servlet.
Configuration
Default Protocol: Servlet 2.5
Container Configuration Options
Name
|
Type
|
Default
|
Description
|
bindHttpPort
|
int
|
9090
|
The HTTP port the server should bind to.
|
bindAddress
|
String
|
localhost
|
The host the server should be run on.
|
jettyPlus
|
boolean
|
true
|
Activates the Jetty plus configuration to support JNDI resources (requires jetty-plus and jetty-naming artifacts on the classpath).
|
configurationClasses
|
String
|
null
|
Specify your own Jetty configuration classes as a comma separated list.
|
Example of Maven profile setup
<profile>
<id>jetty-embedded</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jetty-embedded-6.1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.12</version>
<scope>test</scope>
</dependency>
<!-- plus and naming requires for using JNDI -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-plus</artifactId>
<version>6.1.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-naming</artifactId>
<version>6.1.12</version>
<scope>test</scope>
</dependency>
<!-- Weld servlet, EL and JSP required for testing CDI injections -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>1.0.1-Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>