File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes Concurrency Testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Concurrency Testing" Watch "Concurrency Testing" New topic
Author

Concurrency Testing

Paul Croarkin
Ranch Hand

Joined: Sep 30, 2004
Posts: 106
What is the best way to do concurrency testing? We have testers do some load testing as part of acceptance testing. We also use JUnitPerf in a limited capacity as part of our regular build.

How do you determine what parts of the app need concurrency testing? I'm guessing it would be best to do some sort of concurrency testing at the functional level based on use-cases / user stories.


Thanks,<br /> <br />Paul Croarkin<br />SCEA 5, SCWCD, SCJP
Cedric Beust
author
Ranch Hand

Joined: Oct 12, 2004
Posts: 46
Hi Paul,

Originally posted by Paul Croarkin:
What is the best way to do concurrency testing? We have testers do some load testing as part of acceptance testing. We also use JUnitPerf in a limited capacity as part of our regular build.

How do you determine what parts of the app need concurrency testing? I'm guessing it would be best to do some sort of concurrency testing at the functional level based on use-cases / user stories.

TestNG has several features that can help with that.

For example:

@Test(invocationCount = 1000, threadPoolSize = 10, timeOut = 5000)
public void invokeServlet() {
// ...
}

This will tell TestNG to invoke this method 1000 times from 10 different threads. If any of these threads fail to return without 5 seconds, TestNG will mark that invocation as a failure.

Once this is done, you can have another test method that depends on this one that will check that, for example, the database is in a healthy state, thereby showing that the code under test is most likely multithread safe.

TestNG also lets you run your tests in parallel in all sorts of ways, please take a look at the Web site (http://testng.org) for more details, or ask here.

--
Cedric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Concurrency Testing