Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to structure your junit test folder ?

807589Jul 4 2008 — edited Jul 5 2008
Hi,

I just would like to ask the forum community about the pro and cons of test folder structure. Some developers would argue that it is okay to put your test source code inside your application code source code. Example:

src
|--com
.....|----xyz
............|----SomeClass.java
............|----SomeClassTest.java

But some developers prefer to put their test code outside the source folder:

src
|----com
.......|------xyz
.................|---SomeClass.java

test
|-----com
.......|----xyz
..............|-----SomeClassTest.java

I usually roll with the second approach, because I do not want to clutter my source code with the test code. This will also make deployment easier. But I would like to know what other people think about it. What are the pro and cons of these 2 different approach.

Thank you. Your feed back is grea

Edited by: inoel131081 on Jul 4, 2008 5:14 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2008
Added on Jul 4 2008
3 comments
1,438 views