我试图对我的项目进行arquillian测试,但没有成功。 我正在寻找此错误,但没有找到有关它的问题。
当我尝试运行arquillian测试时,请看到RuntimeException。
java.lang.RuntimeException: java.net.MalformedURLException: Unsupported protocol: remote+http
我在pom.xml中的配置文件wildfly-remote-arquillian:
<profile>
<id>wildfly-remote-arquillian</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-websockets-jsr</artifactId>
<version>1.0.0.Beta25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.5.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>3.0.5.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-p-provider</artifactId>
<version>3.0.5.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>${org.wildfly}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
<testResource>
<directory>src/test/resources-wildfly-remote</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
</profile>
我的arquillian.xml:
<?xml version="1.0" encoding="UTF-8"?>
(...)
<engine>
<property name="deploymentExportPath">target/</property>
</engine>
<container qualifier="wildfly" default="true">
<protocol type="jmx-as7">
<property name="executionType">REMOTE</property>
</protocol>
<configuration>
<property name="javaVmArguments">-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=y</property>
<property name="allowConnectingToRunningServer">true</property>
<property name="managementAddress">127.0.0.1</property>
<property name="managementPort">9990</property>
<property name="username">admin</property>
<property name="password">admin</property>
</configuration>
</container>
我的Arquillian测试班:
@RunWith(Arquillian.class)
public class MemberRegistrationTest {
@Deployment
public static Archive<?> createTestArchive() {
return ShrinkWrap.create(WebArchive.class, "test.war")
.addClasses(Member.class, MemberRegistration.class,
Resources.class)
.addAsResource("META-INF/test-persistence.xml", "META- INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
// Deploy our test datasource
.addAsWebInfResource("test-ds.xml");
}
@Inject
MemberRegistration memberRegistration;
@Inject
Logger log;
@Test
public void testRegister() throws Exception {
Member newMember = new Member();
newMember.setName("Jane Doe");
newMember.setEmail("jane@mailinator.com");
newMember.setPhoneNumber("2125551234");
memberRegistration.register(newMember);
assertNotNull(newMember.getId());
(...)
错误控制台: 谢谢你的帮助。