So, I too am a newbie to
JUnit.
I believe my problem may be due in part to some hierarchy in my application. I have com.myapp.utils, com.myapp.archive, etc. plus other com.somethingelse.authentication, etc. I'm trying to retrofit all of this with JUnit tests following the package path hierarchy.
I've created some <class>Test.java files matching my classes in com.myapp.utils, which run fine, and also a UtilsTestSuite.java. Launching UtilsTestSuite as a JUnit
Test is successful too; it runs the various <class>Test.java tests it gathers together. So far, so good.
In com.myapp (so, one level up), I've created a ServerClassesTestSuite (see code below in case it's any help) and called addTestSuite( UtilsTestSuite.class ) and I intend to add others (ArchiveTestSuite.class, etc.), but running it I get an error:
junit.framework.AssertionFailedError: No tests found in com.myapp.utils.UtilsTestSuite
My intention is to create AllTests.java (maybe I'm naive here) to unite ServerClassesTestSuite and others I have yet to write at the same level.
What's more... The subject of this plea for help reveals that I don't completely grok the distinction between addTestSuite() and addTest(). Believe me, I've read pretty much every JUnit tutorial I've found on Google, most barely acknowledge the existence of TestSuite. The one that does gives an example, which I've followed here in ServerClassesTestSuite, but comment out the call to addTest() and don't even give sample code for what's passed to it as an argument. Yet, I figure, this addTestSuite()/addTest() is likely not even my problem.
Thanks for the help anyone can give,
Russ Bateman
Here's some of my code--dumbed way down to fit in here.