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 84326 - need JUnit to check for availability of the test generator
Summary: need JUnit to check for availability of the test generator
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Marian Petras
URL:
Keywords: API
: 58123 90830 (view as bug list)
Depends on:
Blocks: 77647 83748 114781
  Show dependency tree
 
Reported: 2006-09-06 16:33 UTC by Jiri Prazak
Modified: 2008-11-25 20:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prazak 2006-09-06 16:33:26 UTC
We need to add one method to the JUnitPlugin interface called boolean
isAvailable().  Based on the result you get from the method you should enable or
disable the JUnit action in both contextual and main menus.
Comment 1 Marian Petras 2006-12-08 15:47:18 UTC
Accepted.
Comment 2 luky 2007-08-29 16:39:50 UTC
What is the status of this feature
Comment 3 luky 2007-09-26 15:32:41 UTC
Blocking many other issues - should be P1 
Comment 4 Marian Mirilovic 2007-09-30 09:25:07 UTC
Blocking 2 P3s doesn't mean it's P1, but I agree that this action should be disabled for interfaces ...
Comment 5 Marian Petras 2007-10-03 13:03:29 UTC
Done - committed to the trunk. I added method

    protected boolean canCreateTests(FileObject... fileObjects)

to abstract class JUnitPlugin. The default implementation returns 'true'.

Modified files:
    junit/src/org/netbeans/modules/junit/:
                                      plugin/JUnitPlugin.java   (1.7)
                                      TestAction.java   (1.8)
                                      JUnitPluginTrampoline.java   (1.4)
                                      CreateTestAction.java   (1.59)

Diff:
http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/plugin/JUnitPlugin.java?r1=1.6&r2=1.7
http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/TestAction.java?r1=1.7&r2=1.8
http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/JUnitPluginTrampoline.java?r1=1.3&r2=1.4
http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/CreateTestAction.java?r1=1.58&r2=1.59
Comment 6 Marian Petras 2007-10-09 13:05:49 UTC
*** Issue 58123 has been marked as a duplicate of this issue. ***
Comment 7 Marian Petras 2007-10-09 14:05:02 UTC
Note: There was a bug introduced to class CreateTestAction by the commit - see bug #118024 ("NullPointerException at
org.netbeans.modules.junit.TestUtil.getPluginForProject"). When porting this bug, remember to port also the
corresponding bugfix:

http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/CreateTestAction.java?r1=1.60&r2=1.61
Comment 8 Marian Petras 2008-11-25 20:52:53 UTC
*** Issue 90830 has been marked as a duplicate of this issue. ***