Where to put JUnit test cases?

K

Ken

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
 
T

Thomas Fritsch

N

news.rcn.com

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
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top