Where to put JUnit test cases?

Discussion in 'Java' started by Ken, Jul 15, 2004.

  1. Ken

    Ken Guest

    Hi. I have two JUnit questions.

    1- Is this the right newsgroup for JUnit questions?

    2- Any suggestions on how to organize test cases? Should they be
    included in production code packages or separated out into their own
    JUnitTest package?

    Thanks!

    Ken
    Ken, Jul 15, 2004
    #1
    1. Advertising

  2. Ken wrote:

    >Hi. I have two JUnit questions.
    >
    >1- Is this the right newsgroup for JUnit questions?
    >

    May be. But also take at look at http://junit.sourceforge.net/

    >2- Any suggestions on how to organize test cases? Should they be
    >included in production code packages or separated out into their own
    >JUnitTest package?
    >

    Both approaches have their pro's and con's.
    See also at http://junit.sourceforge.net/doc/faq/faq.htm#organize_1

    >Thanks!
    >
    >Ken
    >
    >



    --
    Thomas<dot>Fritsch<squiggle>ops<dot>de
    Thomas Fritsch, Jul 15, 2004
    #2
    1. Advertising

  3. Ken

    news.rcn.com Guest

    I go for the 2nd option described in the 2nd link from Thomas which is test
    classes go in a parallel tree
    project
    src
    package...
    SomeClass.java
    test
    package....
    SomeClassTest.java
    classes
    package...
    SomeClass.class
    SomeClassTest.class

    Some advantages are:
    Easy to parameterize make files so the commands for the 'src' tree also
    work for the 'test' tree
    All class files go in same class tree minimizing classpath problems.
    You can do things like grep all the files in the source tree for
    references to some variable or method and
    and not get a lot of 'false positives' from occurences in test code.

    jim cant
    "Thomas Fritsch" <> wrote in message
    news:...
    > Ken wrote:
    >
    > >Hi. I have two JUnit questions.
    > >
    > >1- Is this the right newsgroup for JUnit questions?
    > >

    > May be. But also take at look at http://junit.sourceforge.net/
    >
    > >2- Any suggestions on how to organize test cases? Should they be
    > >included in production code packages or separated out into their own
    > >JUnitTest package?
    > >

    > Both approaches have their pro's and con's.
    > See also at http://junit.sourceforge.net/doc/faq/faq.htm#organize_1
    >
    > >Thanks!
    > >
    > >Ken
    > >
    > >

    >
    >
    > --
    > Thomas<dot>Fritsch<squiggle>ops<dot>de
    >
    news.rcn.com, Jul 16, 2004
    #3
    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. Charlie
    Replies:
    1
    Views:
    356
    Lauwie
    Aug 22, 2003
  2. John J. Lee

    JavaScript web scraping test cases?

    John J. Lee, Aug 20, 2003, in forum: Python
    Replies:
    6
    Views:
    441
    Cousin Stanley
    Aug 25, 2003
  3. Chris Smith
    Replies:
    5
    Views:
    293
    Sumit
    Nov 15, 2005
  4. webzhao
    Replies:
    3
    Views:
    1,114
    proudbug
    Dec 14, 2007
  5. David Mitchell
    Replies:
    10
    Views:
    244
Loading...

Share This Page