As I'm currently adding more unit test to our code, I'm stuck because of a simple problem.
I need to write some boilerplate code to make it easy to write test classes. For example, to connect to the database without the configuration of the Resin server, using JNDI injection.
My problem is: where can I put boilerplate code that is only related to tests? Of course, it needs to be in my test directory, but is it good practice to create a package, call it "tool", in my package tree, as this package will have no equivalent in the package tree of the project source? Why or why not?
Edit:
Let's take an example: I need to create a class to inject a database connection into my test classes. Let's call it JNDIDatabaseInjector. This class will obviously only be used for test purposes, as the database connection used in production is defined in the application server configuration. In which package should I best put my JNDIDatabaseInjector class?