Итак, я пытаюсь протестировать проект maven с использованием Arquilian на Eclipse для школьного проекта, однако, когда я пытаюсь выполнить тест через мвн чистый тест Я получаю следующую трассировку стека:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.361 sec {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testCapAnalogique.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"testCapAnalogique.war\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class fr.esisar.locVoiture.stateless.CapAnalogiqueStateless with ClassLoader ModuleClassLoader for Module \"deployment.testCapAnalogique.war\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: Failed to link fr/esisar/locVoiture/entities/CapAnalogique (Module \"deployment.testCapAnalogique.war\" from Service Module Loader): fr/esisar/locVoiture/entities/Capteur"}}}}
Я использую следующий arquillian. xml:
<?xml version="1.0" encoding="UTF-8"?>
<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" />
<container qualifier="jboss" default="true">
<configuration>
<property name="jbossHome">home/user/CS513-Archive/wildfly-
16.0.0.Final</property>
</configuration>
</container>
</arquillian>
И следующую сохраняемость теста. xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="test">
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
и test-ds. xml выглядит следующим образом:
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
<!-- The datasource is bound into JNDI at this location. We reference
this in META-INF/test-persistence.xml -->
<datasource jndi-name="java:jboss/datasources/BeanValidationQuickstartTestDS"
pool-name="bean-validation-quickstart-test" enabled="true"
use-java-context="true">
<connection-url>jdbc:h2:mem:bean-validation-quickstart-test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
с зависимостями в пом. xml:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<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>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.13.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>arq-managed</id>
<dependencies>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>2.1.0.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>arq-remote</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>2.1.0.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
Обратите внимание, я Я новичок в Maven и Arquillian, и я могу упустить что-то тривиальное.