简体   繁体   中英

Set an environment variable for embeded wildfly from arquillian test

We use Arquillian with embedded Wildfly to run automated tests for a Java backend application. The Java application uses some environment variables. Can I bring my arquillian test to set up specific environment variables for the launched wildfly process to influence them by the tests?

When you run an Arqullian test at embedded container through Maven you can specify environment variables at a maven plugin configuration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.17</version>
    <configuration>
        <forkMode>always</forkMode>
        <argLine>-Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xmx512m -XX:MaxPermSize=256m -Djboss.socket.binding.port-offset=1000</argLine>  
      <redirectTestOutputToFile>false</redirectTestOutputToFile>
      </configuration>
  </plugin>

OR at arqullian.xml. But this configuration is limited with an embedded container. Message from running tests:

Supported property names: [managementAddress, modulePath, password, bundlePath, managementPort, jbossHome, managementProtocol, cleanServerBaseDir, username]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM