Erro com arquillian

05/01/2016

3

Estou com erro na hora de criar a arquitetura para testes de integração com arquillian. Estou tentando com o maven startar o jboss para teste. o comando no maven é mvn clean install -PintegrationTest-wildfly, mas sempre gera o erro de container não foi iniciado como abaixo:

pom.xml
<properties>
	<version.arquillian_core>1.1.5.Final</version.arquillian_core>
	<version.arquillian.wildfly>8.2.1.Final</version.arquillian.wildfly>
</properties>

<dependencies>
	<dependency>
		<groupId>com.library</groupId>
		<artifactId>library-model</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.library</groupId>
		<artifactId>library-model</artifactId>
		<type>test-jar</type>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.library</groupId>
		<artifactId>library-resource</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.library</groupId>
		<artifactId>library-resource</artifactId>
		<type>test-jar</type>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>com.google.code.gson</groupId>
		<artifactId>gson</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.jboss.resteasy</groupId>
		<artifactId>resteasy-client</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.skyscreamer</groupId>
		<artifactId>jsonassert</artifactId>
		<scope>test</scope>
	</dependency>

	<dependency>
		<groupId>sun.jdk</groupId>
		<artifactId>jconsole</artifactId>
		<version>1.8</version>
		<scope>system</scope>
		<systemPath>C:\Program Files\Java\jdk1.8.0_60\lib\jconsole.jar</systemPath>
	</dependency>
</dependencies>

<profiles>
	<profile>
		<id>ski-int-tests</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<executions>
						<execution>
							<id>default-testCompile</id>
							<phase>test-compile</phase>
							<configuration>
								<testExcludes>
									<exclude>**/*.java</exclude>
								</testExcludes>
							</configuration>
							<goals>
								<goal>testCompile</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
	</profile>

	<profile>
		<id>integrationTest-wildfly</id>
		<properties>
			<jboss.home>target/wildfly-8.2.1.Final</jboss.home>
		</properties>
		<build>
			<testResources>
				<testResource>
					<directory>src/test/resources</directory>
					<filtering>true</filtering>
				</testResource>
			</testResources>
			<plugins>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<executions>
						<execution>
							<id>default-testCompile</id>
							<phase>test-compile</phase>
							<configuration>
								<testIncludes>
									<include>**/*.java</include>
								</testIncludes>
							</configuration>
							<goals>
								<goal>testCompile</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<includes>
							<include>**/*IntTest.java</include>
						</includes>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>unpak</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>unpak</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.wildfly</groupId>
									<artifactId>wildfly-dist</artifactId>
									<version>${version.arquillian.wildfly}</version>
									<type>zip</type>
									<overWrite>false</overWrite>
									<outputDirectory>target</outputDirectory>
								</artifactItem>
							</artifactItems>
					</configuration>
				</plugin>

				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<executions>
						<execution>
							<id>copy-resources</id>
							<phase>process-resources</phase>
							<goals>
								<goal>copy-resources</goal>
							</goals>
							<configuration>
								<outputDirectory>${jboss.home}/standalone/configuration</outputDirectory>
								<resources>
									<resource>
										<directory>src/test/resources</directory>
										<includes>
											<include>standalone-full.xml</include>
										</includes>
										<filtering>true</filtering>
									</resource>
								</resources>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
		<dependencyManagement>
			<dependencies>
				<dependency>
					<groupId>org.jboss.shrinkwrap.resolver</groupId>
					<artifactId>shrinkwrap-resolver-bom</artifactId>
					<version>2.2.0-beta-1</version>
					<type>pom</type>
					<scope>import</scope>
				</dependency>

				<dependency>
					<groupId>org.jboss.arquillian</groupId>
					<artifactId>arquillian-bom</artifactId>
					<version>${version.arquillian_core}</version>
					<type>pom</type>
					<scope>import</scope>
				</dependency>
			</dependencies>
		</dependencyManagement>

		<dependencies>
			<dependency>
				<groupId>org.jboss.arquillian.core</groupId>
				<artifactId>arquillian-core-api</artifactId>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.jboss.arquillian.junit</groupId>
				<artifactId>arquillian-junit-container</artifactId>
				<version>${version.arquillian_core}</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.wildfly</groupId>
				<artifactId>wildfly-arquillian-container-managed</artifactId>
				<version>${version.arquillian.wildfly}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.jboss.shrinkwrap.resolver</groupId>
				<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.jboss.spec</groupId>
				<artifactId>jboss-javaee-7.0</artifactId>
				<version>1.0.0.Final</version>
				<type>pom</type>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</profile>

</profiles>



arquillian.xml
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns: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/arquillian</property>
</engine>

<container qualifier="wildfly" default="true">
    <configuration>
        <property name="jbossHome">target/wildfly-8.2.1.Final</property>
        <property name="serverConfig">standalone-full.xml</property>
        <property name="javaVmArguments">-Xmx512m -Djava.util.logging.manager=org.jboss.logmanager.LogManager</property>
    </configuration>
</container>


e o log do erro

org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:208)
at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:112)
at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:199)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:163)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:157)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:255)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:77)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:221)
at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.client.ContainerEventController.execute(ContainerEventController.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:68)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:104)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.IllegalStateException: Cannot find: target\wildfly-8.2.1.Final\jboss-modules.jar
at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:113)


Não sei como resolver este erro que ocorre.
Responder
×
+1 DevUP
Acesso diário, +1 DevUP
Parabéns, você está investindo na sua carreira