This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Okay, this is kindof weird.. I have an abstract class, and one of the abstract methods has a return type of void. When I generate a SimpleJUnitTest that includes testing of abstract classes, it's all good EXCEPT methods that have a void return type. All that seems to happen is that the closing brace for each method with a void return type is deleted, hence leaving the generated class broken. A new level of indentation is set below the unclosed method. Because of this, a dialog asking to add the missing method comes up, but it doesn't fix the mis-matched braces issue. I hope this formats nicely. -------------- example base public abstract class Test { public void test() { } protected abstract int testInt(); protected abstract void testVoid( ); protected abstract String testString(); } -------------- end example base -------------- example test import junit.framework.*; public class TestTest extends TestCase { public TestTest(java.lang.String testName) { super(testName); } public static Test suite() { TestSuite suite = new TestSuite(TestTest.class); return suite; } /** Test of test method, of class Test. */ public void testTest() { System.out.println("testTest"); // Add your test code below by replacing the default call to fail. fail("The test case is empty."); } /** Generated implementation of abstract class Test. Please fill dummy bodies of generated methods. */ private class TestImpl extends Test { protected int testInt() {// fill the body in order to provide useful implementation return 0; } protected void testVoid() {// fill the body in order to provide useful implementation} protected String testString() {// fill the body in order to provide useful implementation return null; } } // Add test methods here, they have to start with 'test' name. // for example: // public void testHello() {} } -------------- end example test
I mean to be pointing out TestTest.TestImpl.testVoid() as missing its closing brace.
And my jUnit module is: impl: 200305260100 spec: 2.10.1 Sorry 'bout the multiple posts.
Confirmed. I have reproduced the error under the following conditions: - action Create Test was invoked on a folder node - the folder node contained: - one runnable non-abstract class - one abstract class, which contained: - non-abstract method 'int compute()' - abstract method 'void hello()' Method 'testCompute()' was broken as described above.
It will be fixed in NetBeans 3.6.
fixed in the trunk
Verified in build 200401291900.