-
1. Re: Environment variable in arquillian.xml
aslak Oct 27, 2011 1:41 PM (in response to sewatech)1 of 1 people found this helpfulyes, in Arquillian Core >= 1.0.0.CR5
-
2. Re: Environment variable in arquillian.xml
zeeman Oct 27, 2011 2:54 PM (in response to aslak)I tried with Arq CR5. It does not work, I have an env variable JBOSS_HOME defined in Ubuntu (.profile file). In pom.xml I have
<JBOSS_HOME>${env.JBOSS_HOME}</JBOSS_HOME>
in arqillian.xml I put
<property name="jbossHome">${JBOSS_HOME}</property>
When I start my test it says ${JBOSS_HOME} does not exist. Variable does not seem to get substituted.
-
3. Re: Environment variable in arquillian.xml
aslak Oct 27, 2011 5:11 PM (in response to zeeman)Are you sure JBOSS_HOME is set in the forked surefire vm?
What does mvn dependency:tree show?
-
4. Re: Environment variable in arquillian.xml
zeeman Oct 27, 2011 6:26 PM (in response to aslak)I define
<JBOSS_HOME>${env.JBOSS_HOME}</JBOSS_HOME>
once In prop section of my pom (I have only one POM). I have one profile for integeration tests. Does JBOSS_HOME need to be defined again in integeration profile?
-
5. Re: Environment variable in arquillian.xml
aslak Oct 27, 2011 7:15 PM (in response to zeeman)1 of 1 people found this helpful<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<JBOSS_HOME>${env.JBOSS_HOME}</JBOSS_HOME>
</systemPropertyVariables>
<skip>false</skip>
</configuration>
</plugin>
-
6. Re: Environment variable in arquillian.xml
zeeman Oct 27, 2011 7:30 PM (in response to aslak)Ok,I can add this xml fragment. But to understand it, if I have JBOSS_HOME as a system variable in my OS. So it should be accessiable by all processes. Why do I need to export it again in surefire plugin?
Thanks for the help Aslak!
-
7. Re: Environment variable in arquillian.xml
sewatech Oct 27, 2011 7:49 PM (in response to zeeman)If I actually understand, it works with surefire <systemPropertyVariables>, but not with <environmentVariables> and for Arquillian Core >= 1.0.0.CR5.
Here is how I'm using it :
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<JBOSS_HOST>localhost</JBOSS_HOST>
</systemPropertyVariables>
<systemProperties>
<arquillian.launch>jbossas7</arquillian.launch>
</systemProperties>
</configuration>
</plugin>
and
<container qualifier="jbossas7">
<configuration>
<property name="managementAddress">${JBOSS_HOST}</property>
<property name="managementPort">9999</property>
</configuration>
</container>
That's fine for me. Thanx again Aslak.
Alexis
-
8. Re: Environment variable in arquillian.xml
aslak Oct 28, 2011 6:30 AM (in response to sewatech)it should work with systemProperties as well i believe
-
9. Re: Environment variable in arquillian.xml
aslak Oct 28, 2011 6:37 AM (in response to zeeman)It depends on how the forked jvm is launched. I believe you can deviced fully how the new env should look.
Not sure what the rules are for surefire, but 'some' env variables doesn't seem to be passed over.