java - JUnit: Run simultaneous tests -
i still new java programming , junit testing. use netbeans 6.9.1 comes junit-4.5 (but have added junit-4.8.2 library).
i have number of test classes , in each class there number of @test methods.
when run particular test class runs through each @test method 1 @ time. have created test suite
@runwith(suite.class) @suite.suiteclasses(value = { testclassa.class, testclassb.class, testclassc.class}) public class newtestsuite { }
which run through each of test classes , within each run each @test method.
my question is: possible me run test classes simultaneously? or, within each test class possible run @test methods simultaneously?
doing allow me run through of tests faster having classes , methods run one-at-a-time.
thanks!
use org.junit.experimental.parallelcomputer: sample:
public class newtestsuite { public static void main(string[] s){ class[] cls={testclassa.class,testclassb.class,testclassb.class }; //simultaneously methods in classes result result = junitcore.runclasses(new parallelcomputer(true, true), cls); system.out.print(result.wassuccessful()); //simultaneously among classes //result result = junitcore.runclasses(parallelcomputer.classes(), cls); //simultaneously among methods in class //result result = junitcore.runclasses(parallelcomputer.methods(), cls); } }
Comments
Post a Comment