Question

I search many places still not able to find what I am looking for. not sure if this is possible or not. While ant script is running the java code, the result should stay alive in jvm so how can I print it out at ant script side and not from java?? because I want to use the result again at my other part of ant script.

say, I after java method and I have

String result= "appleResultString";
return result;

Is there a way in ant script can pick up the the result while in the same jvm

<target name="test">
    <java classname="mytest" fork="true" >
    <classpath refid="classpath"/>
    <property="eat" value=${result}>
    </java>

<jmeter jmeterhome="homepath"
        testplan="name.jmx"
        resultlog="name.html">
  <jvmarg value="-Djavax.net.ssl.keyStore=pathToKey/>
  <jvmarg value="-Djavax.net.ssl.keyStorePassword= ${eat}/>
</jmeter>

    </target>

Thanks!

Was it helpful?

Solution

You can set a system property in your Java program, and Ant will capture it, but you must make sure you don't fork your <java> task.

Another possibility is to output the value, and capture that value in the outputproperty parameter of the <java> task. You already stated you can't use the return value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top