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.
while in Test file Test Case[1] the generated test is uncompilable. Lacks two required imports: in test @Test public void testGetServletInfo() { System.out.println("getServletInfo"); MavenPrjServlet instance = new MavenPrjServlet(); String expResult = ""; String result = instance.getServletInfo(); assertEquals(expResult, result);//<- error here // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype.");//<- error here } lines with assertEquals() and fail() show compilation errors due to missing imports. The missing imports are: import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; That or update the test case to instruct the tester to fix imports. [1]http://services.netbeans.org/synergy/client/app/#/assignment/1560/v/1
Product Version: NetBeans IDE Dev (Build 201509030002) Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23 Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27 System: Linux version 4.1.6+ running on amd64; UTF-8; en_US (nb) User directory: /home/alied/.netbeans/dev Cache directory: /home/alied/.cache/netbeans/dev
I am getting the same problem using NetBeans IDE 8.1 RC with Java 1.8.0_66 under Windows 7: Product Version: NetBeans IDE 8.1 RC (Build 201510012201) Java: 1.8.0_66-ea; Java HotSpot(TM) 64-Bit Server VM 25.66-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_66-ea-b02 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) User directory: C:\Users\JohnDoe\AppData\Roaming\NetBeans\8.1rc Cache directory: C:\Users\JohnDoe\AppData\Local\NetBeans\Cache\8.1rc
This works for me in Build 201608050002 import static org.junit.Assert.*; seems to have found it's way into the generated test file
verified in: Product Version: NetBeans IDE Dev (Build 201608290002) Java: 1.8.0_102; Java HotSpot(TM) 64-Bit Server VM 25.102-b14 Runtime: Java(TM) SE Runtime Environment 1.8.0_102-b14 System: Linux version 4.7.2 running on amd64; UTF-8; en_US (nb) User directory: /home/alied/.netbeans/dev Cache directory: /home/alied/.cache/netbeans/dev