Multiple Threads for Junit Classes

Discussion in 'Java' started by sakcee@gmail.com, Apr 28, 2007.

  1. Guest

    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
    , Apr 28, 2007
    #1
    1. Advertising

  2. wrote:
    > 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
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Apr 28, 2007
    #2
    1. Advertising

  3. Arne Vajhøj wrote:
    > wrote:
    >> 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.


    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
    Patricia Shanahan, Apr 28, 2007
    #3
  4. Patricia Shanahan wrote:
    > Arne Vajhøj wrote:
    >> 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 ..."?


    Yes.

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Apr 28, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roy Smith
    Replies:
    1
    Views:
    5,876
    John C. Bollinger
    Apr 30, 2004
  2. JHenstay
    Replies:
    3
    Views:
    535
    osmium
    Jan 11, 2004
  3. apka
    Replies:
    0
    Views:
    346
  4. Smegly
    Replies:
    1
    Views:
    1,078
    Mitchell
    May 19, 2004
  5. yoda
    Replies:
    2
    Views:
    409
    =?utf-8?Q?Bj=C3=B6rn_Lindstr=C3=B6m?=
    Aug 1, 2005
Loading...

Share This Page