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.
Summary: | Inconvenient debugging JUnit test since the fix of issue 158068 and 119922 | ||
---|---|---|---|
Product: | javaee | Reporter: | Petr Dvorak <joshis> |
Component: | Web Project | Assignee: | David Konecny <dkonecny> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | mmirilovic, msauer, pjiricka, rmichalsky, sustaining |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Petr Dvorak
2009-02-19 12:58:19 UTC
Imho, whole this UI change is completely wrong, we should have said that main-class driven test are not supported or make some new action for it. But since it seems that majority likes it I'll fix this one for 7.0. msauer: My sentiments exactly... Users who are used to the current workflow will be pretty angry with this change...
> or make some new action for it
Yes, this would be much better solution, to add items to run/debug file as a java main class (only when the file has a
main class)...
I agree with joshis that this change is significant regression in usability. At least Run/Debug file should fallback to previous behavior if there is no main method. > Run/Debug file should fallback to previous behavior if there is no main method
+1 on that. Not an ideal solution but definitely should be done in 6.7. Of course needs change in all Java project types
simultaneously.
*** Issue 158455 has been marked as a duplicate of this issue. *** I've introduced the requested fallback for j2seproject. Reassigning to web -- please adjust your code in a similar way so that this issue may be closed. --- http://hg.netbeans.org/jet-main/rev/3e7cb430c1a0 Integrated into 'main-golden', will be available in build *200904290201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/3e7cb430c1a0 User: Max Sauer <msauer@netbeans.org> Log: #158812: Inconvenient debugging JUnit test since the fix of issue 158068 and 119922 -- fallback for j2seproject Product Version: NetBeans IDE 6.7 RC1 (Build 200905280001) Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02 System: Linux version 2.6.28-11-generic running on i386; UTF-8; en_US (nb) Not fixed for J2SE project. I have created a J2SE project (Java Application) with a simple JUnit test: package maintain; import junit.framework.TestCase; public class DeleteProjects extends TestCase { @Override public void setUp() throws Exception { } public void testNew() throws Exception { } } I invoked Run/Debug above the rest file (in editor): > run: > Exception in thread "main" java.lang.NoSuchMethodError: main > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > debug: > Exception in thread "main" java.lang.NoSuchMethodError: main > Java Result: 1 > BUILD SUCCESSFUL (total time: 2 seconds) Is this issue really going to be in 6.7? I am tempted to push the priority because it is annoying. > I've introduced the requested fallback for j2seproject.
The same fallback is in apisupport projects as well, see issue #158904.
*** Issue 152741 has been marked as a duplicate of this issue. *** @joshis : There is some additional problem with Compile-on-save -- if you turn it off, it will start to work. In case you think this has to be fixed, please discuss with Marian and open a new issue. Otherwise, I'll have a look for 6.8. @joshis: I've fixed it for j2seproject with CoS also. Could you please verify? Thanks. --- http://hg.netbeans.org/jet-main/rev/c3c22c4ddcde I will as soon as it is in dailies. Thank you, msauer! Integrated into 'main-golden', will be available in build *200905290201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c3c22c4ddcde User: Max Sauer <msauer@netbeans.org> Log: #158812: Fixing j2se with compile-on-save on Is it possible to fix this in the 6.7 patch 1 (I mean the fix for J2SE)? Some users are complaining about this in nbusers. Thank you... It does not look like the patch is directly applicable to web project and other EE project types, the code looks quite different. What do you think David? Shouldn't the code that handles this be somehow shared among all the project types in java.api.common? It sounds like there is nothing web-specific in this. At least some utility methods, or a common superclass for the ActionProviders... b00ed455a8f7 I implemented similar fallback to web project - if Run/Debug File is executed on a unit test which does not have main method then instead of showing "no main class" dialog an attempt is made to execute file as unit test. Integrated into 'main-golden', will be available in build *200907070200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b00ed455a8f7 User: David Konecny <dkonecny@netbeans.org> Log: #158812 - fallback runSingle/debugSingle to run/debug single junit test if main() is not present Verified in 200907070200 The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/09c1ae22b500 I've tried to verify in 6.7.1 RC build, but I'm facing a regression against 6.7. I've filled new issue #168807 since I'm not sure this fix has caused the problem. Issue #168807 is reproducible in trunk and 6.7.1 not in 6.7 fcs. Would be good to fix issue #168807 in 6.7.1 before publishing it to avoid the regression. verified. NetBeans IDE 6.7.1 (Build 200907202301) |