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.

Bug 211931

Summary: auto generate test code Test code showing warnings
Product: java Reporter: vidhyadharantechdays <vidhyadharantechdays>
Component: JUnitAssignee: Theofanis Oikonomou <theofanis>
Status: RESOLVED WONTFIX    
Severity: normal CC: everflux, jlahoda, vetrivendhan, vidhyadharantechdays
Priority: P3    
Version: 7.1.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: auto generated junit code shows warnings messages

Description vidhyadharantechdays 2012-05-02 07:38:23 UTC
Created attachment 118946 [details]
auto generated junit code shows warnings messages

The Auto Generated JUnit test code should not show any warning messages.
Comment 1 Theofanis Oikonomou 2012-06-13 15:03:17 UTC
*** Bug 213886 has been marked as a duplicate of this bug. ***
Comment 2 Theofanis Oikonomou 2013-12-02 11:44:36 UTC
The problem comes from the static Assert import. 

The import is introduced in o.n.m.junit.resources.templates.JUnit4TestClass.java.template file to prevent errors in the created test classes. 

For example look in o.n.m.junit.AbstractTestGenerator.generateDefMethodBody() for when creating test methods with default content, where currently maker.Identifier("fail") is used.

Changing to maker.QualIdent("Assert.fail") while removing the import from the template adds no import to the created test class leading to error hints. 
Honzo, is there a way to handle this situation or should I file a RFE? Thank you
Comment 3 Martin Balin 2016-07-07 07:18:47 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss