Results 1 to 2 of 2
- 02-25-2014, 11:01 PM #1
Senior Member
- Join Date
- Mar 2013
- Posts
- 123
- Rep Power
- 0
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
- 02-26-2014, 12:14 AM #2
Senior Member
- Join Date
- Feb 2014
- Posts
- 219
- Rep Power
- 8
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.
Similar Threads
-
junit exception testing
By NoobieCode in forum New To JavaReplies: 3Last Post: 10-10-2013, 11:06 AM -
Junit Testing within local classes
By danboy4 in forum New To JavaReplies: 3Last Post: 10-08-2012, 02:44 PM -
Junit testing, testing list<e> interface
By mackavelirip in forum New To JavaReplies: 0Last Post: 10-05-2011, 07:08 AM -
JUnit testing
By hedonist in forum Advanced JavaReplies: 4Last Post: 10-04-2009, 01:06 PM -
Testing JUnit PDE with Ant
By keynan in forum EclipseReplies: 0Last Post: 02-15-2008, 12:35 AM
Bookmarks