Arquillian集成测试适用于嵌入式glassfish,但不适用于远程/托管

时间:2014-05-08 17:09:58

标签: java integration-testing jboss-arquillian

Arquillian.xml:

<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.com/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">
  <engine>
    <property name="deploymentExportPath">target/arquillian</property>
  </engine>

  <container qualifier="glassfish-remote" default="true">
    <configuration>
      <property name="adminHost">${glassfish.hostname}</property>
      <property name="adminUser">${glassfish.username}</property>
      <property name="adminPassword">${glassfish.password}</property>
      <property name="adminPort">${glassfish.adminport}</property>
    </configuration>
  </container>

<!-- DIS WORKS -->  
<!--  <container default="true" qualifier="glassfish-embedded">
    <configuration>
      <property name="bindHttpPort">${gf3port}</property>
      <property name="resourcesXml">${gf.resources.file}</property>
    </configuration>
  </container>-->
</arquillian>

一些具体的代表:

<!-- Container dependencies -->
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-glassfish-remote-3.1</artifactId>
            <version>1.0.0.CR4</version>
            <scope>test</scope>
        </dependency>
        <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.arquillian.extension</groupId>
      <artifactId>arquillian-persistence-api</artifactId>      
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.extension</groupId>
      <artifactId>arquillian-persistence-impl</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-depchain</artifactId>
      <type>pom</type>
      <scope>test</scope>
    </dependency>

获得了@ Deployment和@Test,所有这一切都在嵌入式模式下运行。但是,当我切换到远程时,我收到下一个错误:

    Running service.repository.PaaSummarylFilterIT
Configuring TestNG with: TestNG652Configurator
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 13.41 sec <<< FAILURE! - in service.repository.PaaSummarylFilterIT
testList2(service.repository.PaaSummarylFilterIT)  Time elapsed: 0.059 sec  <<< FAILURE!
java.lang.ClassNotFoundException: service.repository.PaaSummarylFilterIT
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
    at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:158)
    at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)
    at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
...

我不知道发生了什么。

P.S.:这个问题更详细:https://community.jboss.org/message/872827

0 个答案:

没有答案