0

We have a Web application that is packaged as a WAR file using Wildly Swarm. The Web application is configured via a custom Main class that is processed when starting the swarm application.

Now we would like to guard our application with Arquillian tests. How can we configure the ShrinkWrap Archive created in the Arquillian test suite to use our Main class when starting the Web application for testing?

user140547
  • 7,750
  • 3
  • 28
  • 80
woelfle
  • 557
  • 1
  • 7
  • 23

1 Answers1

0

Use the dependency

<dependency>
    <groupId>org.wildfly.swarm</groupId>
    <artifactId>arquillian</artifactId>
</dependency>

This provides the annotation @CreateSwarm which you can use in your arquillian test to create a custom Swarm object, just like you are doing in your main-class.

@RunWith(Arquillian.class)
public class SomeTest {
    @Deployment
    public static JavaArchive createTestArchive() { /* ... */ }

    @CreateSwarm
    public static Swarm newContainer() throws Exception {
        Swarm swarm = new Swarm();
        // configure your swarm thingy
        return swarm;
    }

Unfortunately, I have not actually gotten this to work yet. Arquillian with Wildfly Swarm is - at time of posting - still considered unstable.

Joost
  • 3,169
  • 2
  • 22
  • 40