Stijn Hooft
Stijn Hooft

Reputation: 300

Configure Wildfly in Docker so that Arquillian can deploy to it

I would like to create Arquillian tests that run on a Wildfly server in a Docker container.

Step 1: let's keep it simple, and leave Docker out of the picture

I have written Arquillian tests that deploy on a remote Wildfly.

When I set up an unchanged, empty, standalone Wildfly server, Arquillian deploys the tests + dependent ears and then they run without any issue. Awesome!

Step 2 (here comes the problem): let's replace the local Wildfly with a containerized Wildfly

The next step is to put Wildfly in a Docker container, and let my Arquillian tests run on that containerised Wildfly. As far as I can tell, I have to make sure that

I think I have done that correctly. When I run my Docker image,

When I run the tests, I get

Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

Weird, since I can get in the browser to the management console just fine.

Does anyone see my oversight? Did I forget anything?

Docker-compose.yml

version: '2'
services:
  arquillian-cube-wildfly-test:
    build: .
    ports:
      - "8080:8080"
      - "9990:9990"
      - "8787:8787"

Dockerfile

# Base image: Wildfly 10 with 8080 port exposed
FROM jboss/wildfly:10.1.0.Final

# Open management port
EXPOSE 9990
EXPOSE 8787

# Add management user with password
RUN /opt/jboss/wildfly/bin/add-user.sh admin admin --silent

# Set the default command to run on boot
# This will boot WildFly in the standalone mode and bind to all interface
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]

The test project

Check out https://github.com/stainii/arquillian-cube-and-multiple-deployments-experiment. It's a multi-module Maven project, containing

To run this:

  1. start up the Docker container by going to src/test/resources/wildfly, and execute docker-compose up.
  2. Build the project and start the tests with mvn clean dependency:copy-dependencies install. The 2 webapps will be built, their ears will be copied to the target of the test project, and the Arquillian tests will deploy these ears and run tests.

Upvotes: 1

Views: 1394

Answers (1)

Dipak Pawar
Dipak Pawar

Reputation: 71

There are two issues in your projects.

1.Wrong configuration in arquillian.xml. Check https://git.io/vNaYu for correct configuration of arquillian.xml

2.You are using old version of arquillian-container in your profile arq-widlfly-remote. It should be

<dependency>
  <groupId>org.wildfly.arquillian</groupId>
  <artifactId>wildfly-arquillian-container-remote</artifactId>
  <version>2.0.0.Final</version>
  <scope>test</scope>
</dependency> 

Upvotes: 2

Related Questions