Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is stress test with junit possible?

I'm new to java and Junit, I need to stress test a set of web services, now for each web service I have a test like this:

@Test
public void webServiceTest() {
Integer firstParameter=0;
Integer secondParameter=9;
List<GeoArea> sampleList = kitDAO.myWebServiceToTest(firstParameter, secondParameter);
Assert.assertNotNull(sampleList);
Assert.assertTrue(sampleList.size() > 0);
}

Is there a way to call this test 100 time simultaneously with different parameters? I would create 100 thread, pass to them 100 different set of parameters and start the thread simultaneously. Do you think this is possible? How would you do it?

Thank you

like image 639
Lince81 Avatar asked Dec 22 '25 07:12

Lince81


1 Answers

JUnitPerf provides a LoadTest wrapper to run the same test multiple times. I don't think you can pass it different parameters, but you could add that part yourself. Have a static list of your 100 parameters and then have each instance of the test remove one value from that static list.

like image 198
Jeanne Boyarsky Avatar answered Dec 24 '25 10:12

Jeanne Boyarsky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!