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 144254

Summary: [65cat] "fix imports" doesn't work for org.junit.Assert.* imports
Product: editor Reporter: kawazu428 <kawazu428>
Component: -- Other --Assignee: issues@editor <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description kawazu428 2008-08-18 12:55:37 UTC
[ BUILD # : 200808170243 ]
[ JDK VERSION : 1.6.0_07 ]

Using JUnit 4.x tests and assert*() / fail() statements, using "Fix
Imports" fails to correctly add the

"...
import static org.junit.Assert.*;
..."

statement to the class source code. Though this import generally is
there while creating a new JUnit 4.x test using the IDE wizard, using
"fix imports" set to remove unused imports subsequently removes this
dependency if not used, but there is no way to automatically
re-introduce it. At least this is rather inconvenient.
Comment 1 Jiri Prox 2008-08-19 10:08:41 UTC
The fix imports/ add import hint does not support static imports yet.
You have to write at least Assert.assert*() then the fix import will work

*** This issue has been marked as a duplicate of 71249 ***