Skip to end of metadata
Go to start of metadata

A DeployableContainer implementation that can run and connect to a embedded (same JVM) Jetty 7 Servlet Container. Only select EE APIs are available, such as JNDI and parts of Servlet (support for web-fragement.xml is the important bit). 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 3.0

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

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Aug 03, 2012

    I had to use version 1.0.0.CR1 of arquillian-jetty-embedded-7 to avoid package inconsistencies.  JettyEmbeddedContainer was looking for org.jboss.arquillian.spi.client.container.DeployableContainer instead of org.jboss.arquillian.container.spi.client.container.DeploymentException.  As a result, I was seeing " ValidationException: DeploymentScenario contains a target (DEFAULT) not matching any defined Container in the registry".

  2. Oct 23, 2013

    Example of arquillian.xml

    Attributes qualifier="jetty" can be default="true" are optional (helpful in case of configuration for different containers)