0 Replies Latest reply on Apr 26, 2013 5:16 AM by sky yu

    Arquillian test with real EAR from build War is not loaded

    sky yu Newbie

      For better testing and to avoid to much code, I thought, I could take an EAR file directly from the build process.

       

        @Deployment

                public static EnterpriseArchive createDeployment() {

       

                          // get the ear file

                          File earFile = new File("../ucreate-application/target/ucreate-application.ear");

       

                          EnterpriseArchive archive = ShrinkWrap.createFromZipFile(EnterpriseArchive.class, earFile);

       

                          System.out.println(archive.toString(true));

       

                          return archive;

       

                }

       

      after running the test 

       

      ucreate-application.ear:

      /lib/

      /lib/jspider-custom-0.0.1-SNAPSHOT.jar

      /lib/jsf-api-2.1.7.jar

      /lib/mina-core-2.0.1.jar

      /lib/oscache-2.4.1.jar

      /lib/commons-email-1.0.jar

      /lib/jackrabbit-spi-commons-2.2.13.jar

      /lib/derby-10.5.3.0_1.jar

      /lib/jackrabbit-core-2.2.12.jar

      /lib/commons-io-2.4.jar

      /lib/commons-dbcp-1.3.jar

      /lib/xstream-1.1.3.jar

      /lib/jcl-over-slf4j-1.5.11.jar

      /lib/tika-core-0.8.jar

      /lib/stripe-java-1.1.18.jar

      /lib/stax-1.2.0.jar

      /lib/jackrabbit-jcr-client-2.2.12.jar

      /lib/ftplet-api-1.0.6.jar

      /lib/boilerpipe-1.1.0.jar

      /lib/commons-httpclient-3.1.jar

      /lib/tika-parsers-0.8.jar

      /lib/commons-beanutils-1.7.0.jar

      /lib/ant-launcher-1.7.1.jar

      /lib/ftpserver-core-1.0.6.jar

      /lib/stax-api-1.0.1.jar

      /lib/simple-4.1.14.jar

      /lib/joda-time-1.5.2.jar

      /lib/commons-lang-2.1.jar

      /lib/oro-2.0.8.jar

      /lib/poi-ooxml-3.7.jar

      /lib/jackrabbit-jcr2spi-2.2.12.jar

      /lib/simple-xml-2.1.6.jar

      /lib/tritonus_mp3-0.3.6.jar

      /lib/jackrabbit-spi-2.2.12.jar

      /lib/commons-codec-1.2.jar

      /lib/pdfbox-1.3.1.jar

      /lib/tritonus_share-0.3.6.jar

      /lib/jempbox-1.3.1.jar

      /lib/jackrabbit-api-2.2.12.jar

      /lib/commons-pool-1.5.4.jar

      /lib/jackrabbit-jcr-commons-2.2.12.jar

      /lib/geronimo-stax-api_1.0_spec-1.0.1.jar

      /lib/jackrabbit-webdav-2.2.12.jar

      /lib/velocity-1.5.jar

      /lib/gson-2.2.2.jar

      /lib/fontbox-1.3.1.jar

      /lib/ant-1.7.1.jar

      /lib/lucene-core-2.4.1.jar

      /lib/commons-compress-1.1.jar

      /lib/tagsoup-1.2.jar

      /lib/maxmindgeoip-1.2.0.jar

      /lib/commons-logging-1.0.4.jar

      /lib/poi-ooxml-schemas-3.7.jar

      /lib/concurrent-1.3.4.jar

      /lib/metadata-extractor-2.4.0-beta-1.jar

      /lib/jaudiotagger-1.0.jar

      /lib/ucreate-model.jar

      /lib/rome-0.9.jar

      /lib/netcdf-4.2-min.jar

      /lib/derbyclient-10.9.1.0.jar

      /lib/commons-logging-api-1.1.jar

      /lib/javaee-endorsed-api-6.0.jar

      /lib/poi-3.7.jar

      /lib/itext-2.1.7.jar

      /lib/jdom-1.0.jar

      /lib/slf4j-api-1.5.2.jar

      /lib/asm-3.1.jar

      /lib/quartz-1.5.2.jar

      /lib/jsf-impl-2.1.7.jar

      /lib/commons-collections-3.2.1.jar

      /lib/sshd-core-0.5.0.jar

      /lib/prettytime-1.0.8.Final.jar

      /lib/poi-scratchpad-3.7.jar

      /lib/xmlbeans-2.3.0.jar

      /www.ucreatecms.com.war

      /ucreate-ejb.jar

      /META-INF/

      /META-INF/maven/

      /META-INF/maven/com.ucreatecms/

      /META-INF/maven/com.ucreatecms/ucreate-application/

      /META-INF/maven/com.ucreatecms/ucreate-application/pom.properties

      /META-INF/maven/com.ucreatecms/ucreate-application/pom.xml

      /META-INF/jboss-deployment-structure.xml

      /META-INF/MANIFEST.MF

      /META-INF/application.xml

       

      JBoss no longer walk around down is not closed

       

      My arquillian.xml:

       

      <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="

              http://jboss.org/schema/arquillian

              http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

       

       

                <defaultProtocol type="Servlet 3.0" />

       

       

                <!-- <engine> <property name="deploymentExportPath">target</property> </engine> <container qualifier="jbossas-remote" default="true"> </container> <container qualifier="jbossas-managed"> <configuration>

                          <property name="jbossHome">${jbossHome}</property> </configuration> </container> -->

       

       

                <container qualifier="jbossas-remote" default="false">

                          <configuration>

                                    <property name="managementAddress">127.0.0.1</property>

                                    <property name="managementPort">9999</property>

                                    <property name="username">admin</property>

                                    <property name="password">password</property>

                          </configuration>

                </container>

       

                <container qualifier="jbossas-managed" default="true">

                   <protocol type="Servlet 3.0">

               

                                    <property name="executionType">MANAGED</property>

                          </protocol>

                          <configuration>

                                    <property name="jbossHome">target/jboss-eap-6.0</property>

                                    <property name="allowConnectingToRunningServer">true</property>

                                    <property name="serverConfig">standalone-full.xml</property>

       

                          </configuration>

                </container>

                <extension qualifier="webdriver">

                          <property name="browserCapabilities">htmlUnit</property>

                          <property name="javascriptEnabled">true</property>

                          <property name="remoteAddress">http://localhost:4444/wd/hub/</property>

                </extension>

       

      </arquillian>

       

      my pom.xml

       

      <profile>

                                    <id>arquillian-jbossas-managed</id>

                                    <dependencies>

                                              <dependency>

                                                        <groupId>org.jboss.spec</groupId>

                                                        <artifactId>jboss-javaee-6.0</artifactId>

                                                        <version>1.0.0.Final</version>

                                                        <type>pom</type>

                                                        <scope>provided</scope>

                                              </dependency>

                                              <dependency>

                                                        <groupId>org.jboss.as</groupId>

                                                        <artifactId>jboss-as-arquillian-container-managed</artifactId>

                                                        <version>7.1.3.Final</version>

                                                        <scope>test</scope>

                                              </dependency>

                                              <!-- This is required if test relies on CDI contexts: https://docs.jboss.org/author/display/ARQ/JBoss+AS+7.1,+JBoss+EAP+6.0+-+Managed -->

                                              <dependency>

                                                        <groupId>org.jboss.arquillian.protocol</groupId>

                                                        <artifactId>arquillian-protocol-servlet</artifactId>

                                                        <scope>test</scope>

                                              </dependency>

                                    </dependencies>

                          </profile>