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 148377 - [65cat] 'Step Into' + 'Run to Cursor' fail on JUnit test class
Summary: [65cat] 'Step Into' + 'Run to Cursor' fail on JUnit test class
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-25 15:23 UTC by ulfzibis
Modified: 2012-10-10 09:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
hidden breakpoint from previous 'Run to Cursor' (59.06 KB, image/jpeg)
2008-09-25 15:42 UTC, ulfzibis
Details
no Local Variables displayed (88.57 KB, image/jpeg)
2008-09-25 15:57 UTC, ulfzibis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2008-09-25 15:23:04 UTC
[ BUILD # : 200809220201 ]
[ JDK VERSION : 1.6.0_07 ]

'Step Into' + 'Run to Cursor' should also work on JUnit test class
[1].
Error Message: Project xxx does not have a main class set.
'Debug File' works without problems.
Also, if JUnit test class additionally has a main method [2], 'Run to
Cursor' works without problems, even if main class is not set.

[1]
https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-
charset-enhanced/trunk/test/sun/nio/cs/CharsetsTest.java?rev=410&view=
markup
[2]
https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-
charset-enhanced/trunk/test/SpeedTest.java?rev=385&view=markup
Comment 1 ulfzibis 2008-09-25 15:40:19 UTC
After trial with 'Run to Cursor' I started by 'Debug File', having Breakpoint set at line 224.
Surprise: debugger stopped at line 159, which was exactly the location, to where I previously tried 'Run to Cursor'.
--> hidden breakpoint from previous 'Run to Cursor' was not properly deleted.
Please refer to the attachment.
Comment 2 ulfzibis 2008-09-25 15:42:27 UTC
Created attachment 70590 [details]
hidden breakpoint from previous 'Run to Cursor'
Comment 3 ulfzibis 2008-09-25 15:56:58 UTC
After Continue debugger properly stopped at line 224
... but click on Local Variables did not work (view remained at Breakpoints).
So I clicked several times on the 3 tabs in debuggers output window in turn.
After >30 seconds I had success on Local Variables, but no variable was displayed. See attachment...
Comment 4 ulfzibis 2008-09-25 15:57:59 UTC
Created attachment 70593 [details]
no Local Variables displayed
Comment 5 ulfzibis 2008-09-25 16:29:06 UTC
After this I tried to report the problem, but ran into http://statistics.netbeans.org/analytics/detail.do?id=118454
Comment 6 Martin Entlicher 2008-10-01 15:32:25 UTC
'Run to Cursor' should work in a similar way to "Debug File" in this case. We just check for main() method, but do not
check for JUnit test files, etc.

'Step Into' is project-base, it does not have mechanism for debugging single file, therefore it asks for the main class.
This should be improved.

The hidden breakpoint is deleted after it's hit, it should be also deleted when the action is canceled.
Comment 7 Martin Entlicher 2012-05-22 09:59:49 UTC
There is a proposal to ask the user what to debug in this case in bug #51903 (http://netbeans.org/bugzilla/show_bug.cgi?id=51903#c6)
This would require to add a mechanism for debugging single file into Step Into.