I'm having some problems defining inner classes in the Test class inherited from TestCase for JUnit 3. The script looks like this:
Foo.java
public class Foo { public void method() { ... } }
FooTest.java
public class FooTest extends TestCase { public class Bar extends Foo { public void method() { ... } } public void testMethod() { ... } }
Now, if I run this from Eclipse, the tests run fine, but if I try to execute the Ant task, this will not work:
[junit] junit.framework.AssertionFailedError: the Foo $ Bar class does not have a public constructor called TestCase (string name) or TestCase ()
Bar is not a Test class, it is just a subclass of Foo that overrides some method that I do not need to do with real things when testing.
At the moment, Iโm completely lost, and I donโt know how to approach this problem. The only way to subclass as standalone?
java reflection junit inner-classes junit3
Gothmog Nov 11 '10 at 0:40 2010-11-11 00:40
source share