C
Chris
We currently create JUnit test classes and put them in a separate
"testbench" package. This makes it easy to keep test code separate from
production code. The trouble, though, is that it makes it impossible for the
unit tests to call protected methods in the class being tested.
So we would have to put test and production classes in the same package to
make this work. To take it one step further, though, it would be nice to be
able to call private methods. To do this, the test code would have to go
into the production classes themselves.
What do most people do? Put unit tests in a different package, same package
but different class, or in the class being tested itself?
"testbench" package. This makes it easy to keep test code separate from
production code. The trouble, though, is that it makes it impossible for the
unit tests to call protected methods in the class being tested.
So we would have to put test and production classes in the same package to
make this work. To take it one step further, though, it would be nice to be
able to call private methods. To do this, the test code would have to go
into the production classes themselves.
What do most people do? Put unit tests in a different package, same package
but different class, or in the class being tested itself?