is there a way to specify the JVM version in a junit test, when multiple java types are available on an OS ?
I’d like to do something like this:
@JVM=1.5
public void test1(){
run();
}
@JVM=1.7
public void test2(){
run();
}
etc..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you’ll have to run the JUnit tests multiple times with multiple VMs. You can then use Assume to only run the tests for the correct VM:
Please note that I haven’t compiled this, so there may be errors. Then, in your build tool, run these tests twice in two different VMs.