IVCTool / IVCT_Framework

For IVCT Framework Developers. Core System for the IVCT (Integration, Verification and Certification Tool) for HLA Federates
Apache License 2.0
16 stars 4 forks source link

Use environment variable JAVA_OPTS when starting JMSTestRunner #52

Closed rmauget closed 7 years ago

rmauget commented 7 years ago

Some ETC uses some values inJAVA_OPTS environment variable to be configured. For instance, ETC FRA uses the following values to be configured in English language: set JAVA_OPTS=-Duser.country=US -Duser.language=EN And the following values to be configured in French language: set JAVA_OPTS=-Duser.country=FR -Duser.language=FR

So, it requires JAVA_OPTS environment variable to be passed as an argument when starting JMSTestRunner. To do so, in class TcRunnable defined in class de.fraunhofer.iosb.ivct.CmdLineTool, replace:

System.out.println("\"" + javaExe + "\" -classpath \"" + classPath + "\" de.fraunhofer.iosb.testrunner.JMSTestRunner");
CmdLineTool.p = Runtime.getRuntime().exec("\"" + javaExe + "\" -classpath \"" + classPath + "\" de.fraunhofer.iosb.testrunner.JMSTestRunner", null, f);

with:

String javaOpts = System.getenv("JAVA_OPTS");
System.out.println("\"" + javaExe + "\" " + javaOpts +" -classpath \"" + classPath + "\" de.fraunhofer.iosb.testrunner.JMSTestRunner");
CmdLineTool.p = Runtime.getRuntime().exec("\"" + javaExe + "\" " + javaOpts + " -classpath \"" + classPath + "\" de.fraunhofer.iosb.testrunner.JMSTestRunner", null, f);
ducana commented 7 years ago

The suggested code has been implemented in the CmdLineTool.