Jeanne Boyarsky wrote:Try:
The current directory isn't in the classpath in your example.
Also, note that the swingui runner has been removed in JUnit 4.X. At that point, you'll have to use the IDE runner if you want a green bar.
Now, I have a different error:
Exception in
thread "main" java.lang.NoClassDefFoundError: MoneyTestCase (wrong name: moneyx/MoneyTestCase)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.lang.ClassLoader.defineClass(ClassLoader.java:466)
at junit.runner.TestCaseClassLoader.loadClass(TestCaseClassLoader.java:112)
at junit.runner.ReloadingTestSuiteLoader.load(ReloadingTestSuiteLoader.java:9)
at junit.runner.BaseTestRunner.loadSuiteClass(BaseTestRunner.java:208)
at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:101)
at junit.swingui.TestRunner.runSuite(TestRunner.java:666)
at junit.swingui.TestRunner.start(TestRunner.java:783)
at junit.swingui.TestRunner.main(TestRunner.java:104)
Again, I'm not sure why this happens. The class is right there and the classpath is specified in the java command.