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.
[ BUILD # : 200409100847 ] [ JDK VERSION : J2SE 1.5.0 ] The summary says it all really. In the JUnit 'Empty Test ...' wizard there is a checkbox 'Source Code Hints'. I get the same test whether or not it is checked.
Changing bad TargetMilestone value from 3.3 to TBD (more details in issue 48133 )
fixed. With the checkbox checked it now generates e.g. public void testCount() { System.out.println("testCount"); // TODO add your test code below by replacing the default call to fail. fail("The test case is empty."); } while without it, it generates public void testCount() { System.out.println("testCount"); fail("The test case is empty."); }
Ah, but it still does nothing when generating an empty test case! This is actually what I raised the issue against. Either the checkbox should do something in the empty test case scenario or it should be removed. What I personally would like to see is that when it is unclicked the example commented-out test method that I always delete would not be there. I know how JUnit works and it would be nice if there was one less thing to do each time.
Although it was not the original intent of this checkbox, your requirement seems reasonable enough. I fixed it according to it. Checked in: http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/resources/templates/SimpleJUnitTest.java.template.diff?r1=1.6&r2=1.7 http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/TestCreator.java.diff?r1=1.38&r2=1.39 http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/Bundle.properties.diff?r1=1.56&r2=1.57 http://junit.netbeans.org/source/browse/junit/nbproject/project.properties.diff?r1=1.1&r2=1.2
verified in nbdev 200512181900.