Search code examples
javajbossintegration-testingwildfly-8jboss-arquillian

How to deploy WildFly datasource with Arquillian?


I tried to deploy my datasource as follows:

@Deployment(name = "test", order=2)
static WebArchive createDeployment() {
    ShrinkWrap.createFromZipFile(WebArchive, new File("target/test.war")).addAsWebInfResource(new File("src/test/resources/test-DS.xml"), "test-DS.xml")
}

but it seems that my datasource is ignored, I see no info about deployment in jboss console.

Is there any other possibility to deploy datasource with arquillian?

@Deployment(name = "datasource", order=1)
static ? createDSDeployment() {
    ?
}

Solution

  • You could use separate standalone*.xml for arquillian testing and specify your datasource there. For instance, in arquillian.xml:

       <configuration>
           ...
           <property name="serverConfig">standalone-test.xml</property>
           ...
       </configuration>
    

    and datasource can be described in the <datasources> section of that standalone