I have multiple unit tests and component tests which I would like to test against several versions of Java (1.6, 1.7, 1.8, etc).
I wonder what’s the best methodology to it?
Should I run tests several times using Jenkins and each time I change the path of the JAVA_HOME
variable to a different JRE?
Can I do using Maven plugin? Maybe different profiles?
In addition, is there a way using TestNG to exclude tests based on the JRE version? I can handle it using an if statement on a the java.version
system property, however I wonder if there’s a more elegant way.
In case this will affect the answer, I would like to mention that looking forward I would like to test it against several OS types and multiple versions of the product (same tests against v1.0, v2.0, etc).