Java Testing (Junit - general question)
Hello. If I have a project and it contains one package and inside that one package contains 2 packages, say, one package is named foobar (for Junit tests) and the other is named fooby (for some class). I want to test my methods in the foobar package. What exactly do I need to import into my foobar package in order to be able to use methods in the classes of my fooby package?
Thanks for your help
Re: Java Testing (Junit - general question)
Hi. By "package", are you referring to Java package? If so, the same Java access and visibility rules apply to your unit test classes under the foobar package, i.e., you'll need to import the fooby package in your unit test classes.
That said, you'd want to take a look at java - Eclipse junit testing in the same project - Stack Overflow and java - Organization of JUnit tests in projects - Stack Overflow for a discussion on the way to organise your "normal" and JUnit test code. I belong to the camp that advocates having a separate "test" source folder that contains a package structure that is exactly the same as the "normal" source code package structure.