JBoss Community Archive (Read Only)

Arquillian

WildFly 8.1.0 - Embedded

Container Injection Support Matrix

@EJB

@EJB (no-interface)

@Inject (CDI)

@Resource

@PersistenceContext / @PersistenceUnit

images/author/images/icons/emoticons/check.gif

images/author/images/icons/emoticons/check.gif

images/author/images/icons/emoticons/check.gif

images/author/images/icons/emoticons/check.gif

images/author/images/icons/emoticons/check.gif

Note: Widfly 8.1 does not ship an 'uber-jar' version like GlassFish 3.1.2 Embedded Examples. We actually need to download automatically (see example below) or manually the server

Configuration

The profile below,assumes that you have already defined basic Arquillian dependencies on your pom, as indicated in the Getting Started Guide. When used  the defined plugins will perform the following

  • Download and unzip under the /target directory a fresh copy of Wildly 8.1, that will be used as a managed-container to run the tests.

  • Configure the maven-surefire plugin to the above directory.

<profile>
    <id>wildfy81-embedded</id>
    <!-- the dependencies for Wildfly8.1  -->
   <dependencies>
    <dependency>
     <groupId>org.wildfly</groupId>
     <artifactId>wildfly-arquillian-container-embedded</artifactId>
     <version>8.1.0.Final</version>
    </dependency>
    <dependency>
     <groupId>org.wildfly</groupId>
     <artifactId>wildfly-embedded</artifactId>
     <version>8.1.0.Final</version>
   </dependency>
 </dependencies>

 <build>
    <plugins>
      <!-- You need the maven dependency plugin to download locally a zip with the server, unless you provide your own, it will download under the /target directory -->
         <plugin>
	    <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
             <version>2.8</version>
             <executions>
                  <execution>
                     <id>unpack</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wildfly</groupId>
                                    <artifactId>wildfly-dist</artifactId>
                                    <version>8.1.0.Final</version>
                                    <type>zip</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>target</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                 <version>2.17</version>
                <configuration>
                    <!-- Fork every test because it will launch a separate AS instance -->
                    <forkMode>always</forkMode>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                          <!-- the maven dependency plugin will have already downloaded the server on /target -->
                        <jboss.home>${project.basedir}/target/wildfly-8.1.0.Final</jboss.home>
                        <module.path>${project.basedir}/target/wildfly-8.1.0.Final/modules</module.path>
                    </systemPropertyVariables>
                    <redirectTestOutputToFile>false</redirectTestOutputToFile>
                </configuration>
            </plugin>        
    </plugins>
  </build>
</profile>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 09:41:38 UTC, last content change 2014-09-04 18:51:45 UTC.