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 - auto generate test code Test code showing warnings
Summary: auto generate test code Test code showing warnings
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.1.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
: 213886 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-02 07:38 UTC by vidhyadharantechdays
Modified: 2016-07-07 07:18 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
auto generated junit code shows warnings messages (46.81 KB, image/png)
2012-05-02 07:38 UTC, vidhyadharantechdays
Details

Note You need to log in before you can comment on or make changes to this bug.
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