Multiple Threads for Junit Classes

S

sakcee

I was wondering if any one has experience in which multiple Junit
classeshas to be run concurrently and not in a sequential way(or
whichever way Junit runs). As I understand Junit just scans/gatters
all the files for testcases and run then one by one , it also
introduces its @Before, @After etc tags which do not work as normal
class or object hierarchies e.g. I am not sure but it seems like
events that are triggered instead of object creations.

Now I want to run different threads of junit classes in same JVM. is
there a way? Right now I am using a JUnitCore object and running each
class with it. and making one thread run one JunitCore. is this
correct?

any help is greatly appreciated , as I have read some junit books and
this information is available nowhere. also the structure of JUnit is
also not clear.

thanks
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

I was wondering if any one has experience in which multiple Junit
classeshas to be run concurrently and not in a sequential way(or
whichever way Junit runs). As I understand Junit just scans/gatters
all the files for testcases and run then one by one , it also
introduces its @Before, @After etc tags which do not work as normal
class or object hierarchies e.g. I am not sure but it seems like
events that are triggered instead of object creations.

Now I want to run different threads of junit classes in same JVM. is
there a way? Right now I am using a JUnitCore object and running each
class with it. and making one thread run one JunitCore. is this
correct?

any help is greatly appreciated , as I have read some junit books and
this information is available nowhere. also the structure of JUnit is
also not clear.

I think running multiple unit tests in parallel to find
bugs is the proper way of doing it.

I think it would be better to have one unit tests that
tested the thread safeness of the code using multiple
threads.

Arne
 
P

Patricia Shanahan

Arne said:
I think running multiple unit tests in parallel to find
bugs is the proper way of doing it.

Did you mean "I don't think running multiple ..."? If so, I would agree.
I think it would be better to have one unit tests that
tested the thread safeness of the code using multiple
threads.

Or, of course, several consecutive tests each of which tests its own
combination of number of threads, initial settings of any random number
generators etc.

Patricia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top