Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integration test with Arquillian and Wildfly

I try to run integration test with Arquillian and Wildfly.

My dependencies in Maven look as follows:

<dependency>
  <groupId>org.jboss.arquillian</groupId>
  <artifactId>arquillian-bom</artifactId>
  <version>1.1.2.Final-wildfly-1</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>
<dependency>
  <groupId>org.jboss.arquillian.junit</groupId>
  <artifactId>arquillian-junit-container</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.wildfly</groupId>
  <artifactId>wildfly-arquillian-container-embedded</artifactId>
  <version>8.0.0.Final</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.wildfly</groupId>
  <artifactId>wildfly-embedded</artifactId>
  <version>8.0.0.Final</version>
</dependency>

Is it necessary to include both the wildfly-arquillian-container-embedded and wildfly-embedded?

When running the test, I get the following error:

[main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
Cannot not load JBoss LogManager. The LogManager has likely been accessed prior to this initialization.
[main] INFO  org.jboss.msc - JBoss MSC version 1.2.0.Final
Feb 18, 2014 11:34:08 AM org.jboss.as.server.ApplicationServerService start
INFO: JBAS015899: WildFly 8.0.0.Final "WildFly" starting
Feb 18, 2014 11:34:13 AM org.jboss.as.controller.AbstractOperationContext executeStep
ERROR: JBAS014612: Operation ("parallel-extension-add") failed - address: ([])
java.lang.RuntimeException: JBAS014670: Failed initializing module org.jboss.as.logging
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:99)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:591)
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:469)
at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:273)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:268)
at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:314)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:294)
at org.jboss.as.server.ServerService.boot(ServerService.java:356)
at org.jboss.as.server.ServerService.boot(ServerService.java:331)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:256)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException:
JBAS011592: The logging subsystem requires the log manager to be
org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be
used.
To use JBoss Log Manager you must add the system property "java.util.logging.manager"
and set it to "org.jboss.logmanager.LogManager"
like image 478
user3318442 Avatar asked Feb 18 '14 11:02

user3318442


People also ask

What must you annotate an Arquillian integration test class with?

Write Our First Arquillian Test. If we're going to run our tests inside a container, we need to use the @Deployment annotation. Arquillian does not use the entire classpath to isolate the test archive. Instead, it uses the ShrinkWrap class, that is a Java API for creating archives.

How do you use JUnit integration testing?

JUnit 5 defines an extension interface through which classes can integrate with the JUnit test. We can enable this extension by adding the @ExtendWith annotation to our test classes and specifying the extension class to load. To run the Spring test, we use SpringExtension. class.

How is integration testing done in Java?

Integration testing is the second level of the software testing process comes after unit testing. In this testing, units or individual components of the software are tested in a group. The focus of the integration testing level is to expose defects at the time of interaction between integrated components or units.


1 Answers

I added the following to the plugins section in my pom.xml:

  <plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.12</version>
    <configuration>
      <systemProperties>
        <property>
          <name>java.util.logging.manager</name>
          <value>org.jboss.logmanager.LogManager</value>
        </property>
      </systemProperties>
    </configuration>
  </plugin>

Made the complaints go away. I'm not sure if it is a bug or not. I think it would be better if the embedded container just worked without any extra configuration.

like image 73
Stefan Arentz Avatar answered Oct 05 '22 17:10

Stefan Arentz