newbie: JUnit tests, best practice for the location of input test files?

J

jsoftwaredev

If I am creating JUnit tests that have test input files, are there any
best practices for where input test files should go?

Right now I am placing them in the same Java package that the test
class resides in.
 
M

Manish Pandit

If I am creating JUnit tests that have test input files, are there any
best practices for where input test files should go?

Right now I am placing them in the same Java package that the test
class resides in.

You could name the package to indicate that it contains test sources.
If the main comtree is com.xyz.services, the corresponding test
package could be something like com.xyz.services.test. I personally
prefer Maven, as it provides a placeholder for junits, as well as
ensures that the build process includes running junits (you can always
override this though!), and does not include test classes in the
release/target jars.

-cheers,
Manish
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top