Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Wildfly 8.1.0最终版&x2B;Arquillian 1.1.5.Final=Arquillian ServletRunner-未返回结果_Java_Maven_Wildfly_Jboss Arquillian_Shrinkwrap - Fatal编程技术网

Java Wildfly 8.1.0最终版&x2B;Arquillian 1.1.5.Final=Arquillian ServletRunner-未返回结果

Java Wildfly 8.1.0最终版&x2B;Arquillian 1.1.5.Final=Arquillian ServletRunner-未返回结果,java,maven,wildfly,jboss-arquillian,shrinkwrap,Java,Maven,Wildfly,Jboss Arquillian,Shrinkwrap,当我试图在远程Wildfly 8.1.0上运行Arquillian测试时,我在测试结果文件中得到以下stacktrace: ------------------------------------------------------------------------------- Test set: com.tellyo.rtc.test.SimpleTest -----------------------------------------------------------------

当我试图在远程Wildfly 8.1.0上运行Arquillian测试时,我在测试结果文件中得到以下stacktrace:

-------------------------------------------------------------------------------

Test set: com.tellyo.rtc.test.SimpleTest

-------------------------------------------------------------------------------

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 61.214 sec <<< FAILURE!

testApplication(com.tellyo.rtc.test.SimpleTest)  Time elapsed: 1.38 sec  <<< ERROR!

java.lang.IllegalStateException: Error launching test com.tellyo.rtc.test.SimpleTest public void com.tellyo.rtc.test.SimpleTest.testApplication()

at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:103)

at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:109)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)

at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:57)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)

at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:102)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:294)

at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:269)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:193)

at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)

at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)

at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)

at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)

at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)

at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)

at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)

at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)

at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)

at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)

at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

Caused by: java.lang.IllegalStateException: Error launching request at http://0.0.0.0:7080/test/ArquillianServletRunner?outputMode=serializedObject&className=com.tellyo.rtc.test.SimpleTest&methodName=testApplication. No result returned

at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.executeWithRetry(ServletMethodExecutor.java:139)

at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:99)

... 78 more
我真正不明白的是,为什么上面异常中的请求是在0.0.0.0启动的

我可以在服务器日志中看到测试应用程序确实已部署:

2014-08-05 17:00:26,831 INFO  [org.jboss.as.repository] (management-handler-thread - 1) JBAS014900: Content added at location /opt/wildfly/standalone/data/content/f6/1fe7d564c3ef44a17443920a1b8a201787eb19/content

2014-08-05 17:00:26,848 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "test.war" (runtime-name: "test.war")

2014-08-05 17:00:27,236 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment test.war

2014-08-05 17:00:27,492 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: test.war

2014-08-05 17:00:27,585 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment test.war

2014-08-05 17:00:30,595 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017534: Registered web context: /test

2014-08-05 17:00:30,812 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018559: Deployed "test.war" (runtime-name : "test.war")

2014-08-05 17:01:14,637 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017535: Unregistered web context: /test

2014-08-05 17:01:14,674 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016009: Stopping weld service for deployment test.war

2014-08-05 17:01:14,769 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment test.war (runtime-name: test.war) in 139ms

2014-08-05 17:01:15,008 INFO  [org.jboss.as.repository] (management-handler-thread - 1) JBAS014901: Content removed from location /opt/wildfly/standalone/data/content/f6/1fe7d564c3ef44a17443920a1b8a201787eb19/content

2014-08-05 17:01:15,014 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018558: Undeployed "test.war" (runtime-name: "test.war")
尽管我在SimpleTest类的ShrinkWrap.create方法中指定了不同的名称,但我不知道为什么它被部署为test.war

日志文件中的另一个可疑内容是:

2014-08-05 16:38:08,561 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017519: Undertow HTTP listener default listening on /0.0.0.0:7080
为什么不给Undertow分配一个正确的IP地址?这是应该的吗


任何帮助都将不胜感激

我建议您使用Arquillian BOM来管理依赖项。我已经使用下面的配置执行了您的Arquillian测试,并为托管和远程WildFly工作

为了方便起见,您可以在这个GitHub repo中找到代码。确保在POM xml中激活(托管默认为活动的),并在中设置为默认值(default=“true”)。此外,从内部移除
default=“true”

pom.xml

<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.jboss.aerogear</groupId>
    <artifactId>arquillian-wildfly-example</artifactId>
    <packaging>jar</packaging>
    <version>0.0.1</version>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <distribution>repo</distribution>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.org.jboss.arquillian>1.1.5.Final</version.org.jboss.arquillian>
        <version.org.wildfly>8.1.0.Final</version.org.wildfly>
        <version.junit>4.11</version.junit>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.17</version>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>

            <!-- Arquillian BOM (Bill Of Materials). -->
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${version.org.jboss.arquillian}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <!-- JUnit regression testing framework. -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <profiles>

        <!-- Arquillian WildFly managed profile -->
        <profile>
            <id>arq-wildfly-managed</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.wildfly</groupId>
                    <artifactId>wildfly-arquillian-container-managed</artifactId>
                    <version>${version.org.wildfly}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                </testResources>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <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>${version.org.wildfly}</version>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Arquillian WildFly remote profile -->
        <profile>
            <id>arq-widlfly-remote</id>
            <dependencies>
                <dependency>
                    <groupId>org.wildfly</groupId>
                    <artifactId>wildfly-arquillian-container-remote</artifactId>
                    <version>${version.org.wildfly}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

    </profiles>

    <dependencies>

        <!-- JUnit regression testing framework. -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>

        <!-- JUnit Container Implementation for the Arquillian Project -->
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.protocol</groupId>
            <artifactId>arquillian-protocol-servlet</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

</project>
<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">

        <!-- Sets the protocol which is how Arquillian talks and executes the tests inside the container -->
        <defaultProtocol type="Servlet 3.0" />

        <!-- Configuration to be used when the WidlFly remote profile is active -->
        <container qualifier="widlfly-remote">
            <configuration>
                <property name="managementAddress">X.X.X.X</property>
                <property name="managementPort">9990</property>
                <property name="username">admin</property>
                <property name="password">admin</property>
            </configuration>
        </container>

        <!-- Configuration to be used when the WildFly managed profile is active -->
        <container qualifier="widlfly-managed" default="true">
            <configuration>
                <property name="jbossHome">${jbossHome:target/wildfly-8.1.0.Final}</property>
            </configuration>
        </container>

    </arquillian>

4.0.0
org.jboss.aerogear
arquillian野蝇示例
罐子
0.0.1
Apache许可证,版本2.0
回购
http://www.apache.org/licenses/LICENSE-2.0.html
UTF-8
1.1.5.最终版本
8.1.0.1最终版本
4.11
maven编译器插件
3.1
1.7
1.7
maven surefire插件
2.17
org.eclipse.m2e
生命周期映射
1.0.0
org.apache.maven.plugins
maven依赖插件
[2.1,)
打开
org.jboss.arquillian
阿奎利安bom
${version.org.jboss.arquillian}
进口
聚甲醛
朱尼特
朱尼特
${version.junit}
野蝇管理
真的
野生蝇
wildfly arquillian容器管理
${version.org.wildfly}
测试
src/测试/资源
org.apache.maven.plugins
maven依赖插件
打开
过程测试类
打开
野生蝇
野蝇区
${version.org.wildfly}
拉链
假的
${project.build.directory}
广域远程
野生蝇
wildfly arquillian集装箱遥控器
${version.org.wildfly}
测试
朱尼特
朱尼特
org.jboss.arquillian.junit
arquillian junit容器
测试
org.jboss.arquillian.protocol
arquillian协议servlet
测试
arquillian.xml

<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.jboss.aerogear</groupId>
    <artifactId>arquillian-wildfly-example</artifactId>
    <packaging>jar</packaging>
    <version>0.0.1</version>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <distribution>repo</distribution>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.org.jboss.arquillian>1.1.5.Final</version.org.jboss.arquillian>
        <version.org.wildfly>8.1.0.Final</version.org.wildfly>
        <version.junit>4.11</version.junit>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.17</version>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>

            <!-- Arquillian BOM (Bill Of Materials). -->
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${version.org.jboss.arquillian}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <!-- JUnit regression testing framework. -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <profiles>

        <!-- Arquillian WildFly managed profile -->
        <profile>
            <id>arq-wildfly-managed</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.wildfly</groupId>
                    <artifactId>wildfly-arquillian-container-managed</artifactId>
                    <version>${version.org.wildfly}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                </testResources>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <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>${version.org.wildfly}</version>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Arquillian WildFly remote profile -->
        <profile>
            <id>arq-widlfly-remote</id>
            <dependencies>
                <dependency>
                    <groupId>org.wildfly</groupId>
                    <artifactId>wildfly-arquillian-container-remote</artifactId>
                    <version>${version.org.wildfly}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

    </profiles>

    <dependencies>

        <!-- JUnit regression testing framework. -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>

        <!-- JUnit Container Implementation for the Arquillian Project -->
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.protocol</groupId>
            <artifactId>arquillian-protocol-servlet</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

</project>
<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">

        <!-- Sets the protocol which is how Arquillian talks and executes the tests inside the container -->
        <defaultProtocol type="Servlet 3.0" />

        <!-- Configuration to be used when the WidlFly remote profile is active -->
        <container qualifier="widlfly-remote">
            <configuration>
                <property name="managementAddress">X.X.X.X</property>
                <property name="managementPort">9990</property>
                <property name="username">admin</property>
                <property name="password">admin</property>
            </configuration>
        </container>

        <!-- Configuration to be used when the WildFly managed profile is active -->
        <container qualifier="widlfly-managed" default="true">
            <configuration>
                <property name="jbossHome">${jbossHome:target/wildfly-8.1.0.Final}</property>
            </configuration>
        </container>

    </arquillian>

X.X.X.X
9990
管理
管理
${jbossHome:target/wildfly-8.1.0.Final}

嘿,谢谢你的评论。结果表明poms和xmls很好。我的standalone.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">

        <!-- Sets the protocol which is how Arquillian talks and executes the tests inside the container -->
        <defaultProtocol type="Servlet 3.0" />

        <!-- Configuration to be used when the WidlFly remote profile is active -->
        <container qualifier="widlfly-remote">
            <configuration>
                <property name="managementAddress">X.X.X.X</property>
                <property name="managementPort">9990</property>
                <property name="username">admin</property>
                <property name="password">admin</property>
            </configuration>
        </container>

        <!-- Configuration to be used when the WildFly managed profile is active -->
        <container qualifier="widlfly-managed" default="true">
            <configuration>
                <property name="jbossHome">${jbossHome:target/wildfly-8.1.0.Final}</property>
            </configuration>
        </container>

    </arquillian>