Author: Lubomir Cincura
Version: 5.0
Last update: 2005-09-16
Introduction: Debuggercore module provides basic framework for debugger implementations. Debuggerjpda is implementation of most common Java debugger - JPDA. Also try to invoke actions that reside on several places in the IDE (in menus, toolbars etc.) from all their locations. It is critical to perform these tests on all supported platform because the JPDA debugger uses native libraries. Test cases needs classes not delivered with IDE, they can be found here.
Comment:
Purpose: Verification of basic debugger funcionality: start, stop, stop on breakpoint, etc
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project.
#
Test case
Description
1
Start debugger
Invoke Debug Main Project action from menu or toolbar
Teardown:
Close debugged application
RESULT:
Debugger Console is opened in output. There is written 'Listening on some_port_number' followed by 'User program running' and application is started.
2
Stop debugged application
Invoke Debug Main Project action from menu or toolbarr, wait until debugger and application are started
Finish debugged application by pressing its Close button
RESULT:
'User program finished' message will be shown in the status bar and in Debugger Console.
3
Kill debugged application
Invoke Debug Main Project action from menu or toolbarr, wait until debugger and application are started
Invoke Finish Debugger Session action from menu or toolbar
RESULT:
'User program finished' message will be shown in the status bar and in Debugger Console. The debugged applcation will be closed.
4
Pause debugging session
Invoke Debug Main Project action from menu or toolbarr, wait until debugger and application are started
Invoke Pause action from menu or toolbar
RESULT:
'User program stopped' message will be shown in the status bar and in Debugger Console. The debugged application will stop responding.
5
Continue debugging session
Setup: Process steps from Pause debugging session testcase
Invoke Continue action from menu or toolbar
Teardown:
Finish debugging session
RESULT:
'User program running' message will be shown in the status bar and in Debugger Console and the debugged application will run
6
Breakpoint functionality
Open fle MemoryView.java in editor
Place your caret on line 101
Invoke Toggle Breakpoint breakpoint from editor's popup menu
Invoke Debug Main Project action from menu or toolbar
Teardown:
Remove the breakpoint
RESULT:
Debugger will be started and after a while it will stop on line 101
7
Run to cursor
Setup: Proceed steps from Breakpoint functionality tescase
Place your caret on line 96
Invoke Run to Cursor action from menu or toolbar
Teardown:
Finish debugging session and remove breakpoint
RESULT:
Debugger will run for a while and stop on line 96.
8
Run to cursor - start debugging
Open fle MemoryView.java in editor
Place your caret on line 101
Invoke Run to Cursor action from menu or toolbar
Teardown:
Finish debugging session
RESULT:
Debugger will start and run for a while and stop on line 101.
9
Step Into - start debugging
Invoke Step Into action from menu or toolbar
Teardown:
Finish debugging session
RESULT:
Debugger will be started and stop on the first line of main method.
10
Step Into
Open fle MemoryView.java in editor
Place your caret on line 58
Invoke Toggle Breakpoint breakpoint from editor's popup menu
Invoke Debug Main Project action from menu or toolbar
Wait till debugger stops on line 58
Invoke Step Into action
Teardown:
Finish debugging session
RESULT:
Debugger will stop on line 86.
11
Step Over
Invoke Debug Main Project action from menu or toolbar
Wait till debugger stops on line 58
Invoke Step Over action
Teardown:
Finish debugging session
RESULT:
Debugger will stop on line 60.
12
Step Out
Invoke Debug Main Project action from menu or toolbar
Wait till debugger stops on line 58
Invoke Step Into action
Wait till debugger stops on line 86
Invoke Step Out action
Teardown:
Finish debugging session
RESULT:
Debugger will stop on line 60.
13
Kill paused debugged application
Invoke Debug Main Project action from menu or toolbarr, wait until debugger and application are started
Invoke Pause action from menu or toolbar
Invoke Finish Debugger Session action from menu or toolbar
RESULT:
'User program finished' message will be shown in the status bar and in Debugger Console. The debugged applcation will be closed.
14
Run Into Method
Invoke Debug Main Project action from menu or toolbar
Wait till debugger stops on line 58
Place your caret on line 58 between 9th and 21st character (text updateStatus)
Invoke Run Into Method action from main menu
Teardown:
Finish debugging session and remove breakpoint
RESULT:
Debugger will stop on line 86.
15
Run Into Method - JDK method
Place your caret on line 193
Invoke Toggle Breakpoint breakpoint from editor's popup menu
Invoke Debug Main Project action from menu or toolbar
In MemoryView application press Apply button and wait till debugger stops on line 193
Invoke Window|Debugging|Sources
In Sources view check the java sources to be used for debugging
Place your caret on line 193 between 56th and 64st character (text intValue)
Invoke Run Into Method action from main menu
Teardown:
Finish debugging session and uncheck java sources for debugging
RESULT:
Debugger will stop on line 644 of file Integer.java.
16
Run Into Method without source
Invoke Debug Main Project action from menu or toolbar
In MemoryView application press Apply button and wait till debugger stops on line 193
Place your caret on line 193 between 56th and 64st character (text intValue)
Assure in sources view the java sources are not used for debugging
Invoke Run Into Method action from main menu
Teardown:
Finish debugging session and remove breakpoint
RESULT:
Debugger will stop on line 194 of file MemoryView.java.
Purpose: Verifies line breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Breakpoints view.
#
Test case
Description
1
Line number I
Open fle MemoryView.java in editor
Toggle breakpoint on line 96
Select corresponding breakpoint in the Breakpoints view
Invoke Customize from context menu and change Line Number property of this breakpoint to 101
Invoke Debug Main Project action from menu or toolbar
Teardown:
Finish debugging session and remove breakpoint
RESULT:
Line 101 should be highlighted and debugger should stop on line 101 of MemoryView
2
Line number II
Open fle MemoryView.java in editor
Toggle breakpoint on line 96
Select corresponding breakpoint in the Breakpoints view
Invoke Customize from context menu and change Line Number property of this breakpoint to 500
Invoke Debug Main Project action from menu or toolbar
Teardown:
Finish debugging session and remove breakpoint
RESULT:
Ensure that no exception is thrown (MemoryView has less then 500 lines) and debugger does not stop on the breakpoint
3
Print text
Open fle MemoryView.java in editor
Toggle breakpoint on line 96
Select corresponding breakpoint in the Breakpoints view
Ivoke Customize action and change Print text property of this node to "Breakpoint hit!"
Invoke Debug Main Project action from menu or toolbar
Teardown:
Finish debugging session and remove breakpoint
RESULT:
Debugger should stop on the breakpoint after a while and message "Breakpoint hit!" should be shown in Debugger Console
4
Breakpoint in method
Open file LineBreakpoints.java in editor
Toggle breakpoint on line 154
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop on the breakpoint on line 154.
5
Breakpoint in static method
Open file LineBreakpoints.java in editor
Toggle breakpoint on line 150
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 150
6
Breakpoint in initializer
Open file LineBreakpoints.java in editor
Toggle breakpoint on line 10
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 10
7
Breakpoint in static initializer
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 6
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 6
8
Breakpoint in constructor
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 158
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 158
9
Breakpoint in inner class
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 15
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 15
10
Breakpoint in anonymous inner class
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 37
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 37
11
Breakpoint in local class
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 93
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 93
12
Other breakpoints I
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 52
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 52
13
Other breakpoints II
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 74
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 74
14
Other breakpoints III
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 23
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 23
15
Other breakpoints IV
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 104
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 104
16
Other breakpoints V
Open file LineBreakpoints.java in editor
Toggle breakpoint on the line 122
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 122
17
Other breakpoints VI
Open file LineBreakpoints.java in editor
Toggle breakpoint on line 140
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on the breakpoint on line 140
18
Suspend debugging - all threads
Open file ThreadSuspending.java in editor
Toggle breakpoint on line 38
Select corresponding breakpoint in the Breakpoints view
Invoke Customize from context menu and change Suspend property of this breakpoint to All threads
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will start and will hit the breakpoint. In output window some output from Thread-1 and no output from Thread-2 will be displayed.
19
Suspend debugging - current thread
Open file ThreadSuspending.java in editor
Toggle breakpoint on line 38
Select corresponding breakpoint in the Breakpoints view
Invoke Customize from context menu and change Suspend property of this breakpoint to Breakpoint thread
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will start and will hit the breakpoint. In output window output from Thread-1 till counter hits 100 will be displayed and no output from Thread-2 will be displayed.
20
Suspend debugging - no threads
Open file ThreadSuspending.java in editor
Toggle breakpoint on line 38
Select corresponding breakpoint in the Breakpoints view
Invoke Customize from context menu and change Suspend property of this breakpoint to No thread (continue)
Invoke Debug File action from context menu of the file in Projects explorer
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will start and will not hit the breakpoint. In output window output from Thread-1 till counter hits 100 and output from Thread-2 till counter hits 100 will be displayed. There will be 100 messages about breakpoint hit in Debugger Console.
21
Go To Source
Open fle MemoryView.java in editor
Toggle breakpoint on line 96
Close source in editor
Select corresponding breakpoint in the Breakpoints view
Invoke Go to Source action from the context menu of this node
Teardown:
Remove breakpoint
RESULT:
Source Editor should be opened with file MemoryView.java with caret on line 96
22
Toggle breakpoint - main menu
Open fle MemoryView.java in editor
Place carret on line 45
Invoke Run|Toggle Breakpoint action
Teardown:
Remove the breakpoint
RESULT:
Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
23
Toggle breakpoint - context menu
Open fle MemoryView.java in editor
Place carret on line 45
Invoke Toggle Breakpoint action from context menu of editor
Teardown:
Remove the breakpoint
RESULT:
Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
24
Toggle breakpoint - gutter
Open fle MemoryView.java in editor
Click with mouse on editor gutter on line 45
Teardown:
Remove the breakpoint
RESULT:
Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
25
Toggle breakpoint - keyboard shortcut
Open fle MemoryView.java in editor
Place carret on line 45
Press Ctrl + F8
Teardown:
Remove the breakpoint
RESULT:
Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
26
Conditional breakpoint I
Toggle breakpoint on line 98
Toggle breakpoint on line 101
Select node Line MemoryView.java:98 and invoke Customize action from its context menu
Change its Condition property to false
Select node Line MemoryView.java:101 and invoke Customize action from its context menu
Change its Condition property to true
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete breakpoints
RESULT:
Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
27
Conditional breakpoint II
Toggle breakpoint on line 98
Toggle breakpoint on line 101
Select node Line MemoryView.java:98 and invoke Customize action from its context menu
Change its Condition property to 1 == 0
Select node Line MemoryView.java:101 and invoke Customize action from its context menu
Change its Condition property to 1 != 0
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete breakpoints
RESULT:
Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
28
Conditional breakpoint III
Toggle breakpoint on line 98
Toggle breakpoint on line 101
Select node Line MemoryView.java:98 and invoke Customize action from its context menu
Change its Condition property to (1 == 0) || false
Select node Line MemoryView.java:101 and invoke Customize action from its context menu
Change its Condition property to (1 != 0) && true
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete breakpoints
RESULT:
Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
29
Conditional breakpoint IV
Toggle breakpoint on line 98
Toggle breakpoint on line 101
Select node Line MemoryView.java:98 and invoke Customize action from its context menu
Change its Condition property to Boolean.FALSE.booleanValue()
Select node Line MemoryView.java:101 and invoke Customize action from its context menu
Change its Condition property to Boolean.TRUE.booleanValue()
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete breakpoints
RESULT:
Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
30
Conditional breakpoint V
Toggle breakpoint on line 98
Select node Line MemoryView.java:98 and invoke Customize action from its context menu
Change its Condition property to x!~10a#
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete breakpoint
RESULT:
Debugger will stop on breakpoint on line 98.
31
Conditional breakpoint VI
Open file LineBreakpoints.java in editor
Toggle breakpoint on line 190
Select node Line LineBreakpoints.java:190 and invoke Customize action from its context menu
Change its Condition property to i > 10
Invoke Debug Main Project action
Invoke Window | Debugging | Local Variables action from context menu
Teardown:
Finish debugging session and delete breakpoint
RESULT:
Debugger wills top on the breakpoint after a while. Variable i in Local Variables view will have value 11.
Purpose: Verifies method breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor. Open Breakpoints view.
#
Test case
Description
1
Pre-filled class name
Put caret anywhere inside class MemoryView
Invoke action Run | New Breakpoint from menu
In New Brakpoint dialog set Breakpoint Type to Method
Teardown:
Cancel the dialog
RESULT:
Check settings in New Breakpoint dialog: Package Name will be set to examples.advaced Class Name will be set to MemoryView
2
Pre-filled name of method
Put caret on line 80
Invoke action Run | New Breakpoint from menu
In New Brakpoint dialog set Breakpoint Type to Method
Teardown:
Cancel the dialog
RESULT:
Check settings in New Breakpoint dialog: Package Name will be set to examples.advaced Class Name will be set to MemoryView Method Name will be set to removeNotify
3
Pre-filled name of constructor
Put caret on line 50
Invoke action Run | New Breakpoint from menu
In New Brakpoint dialog set Breakpoint Type to Method
Teardown:
Cancel the dialog
RESULT:
Check settings in New Breakpoint dialog: Package Name will be set to examples.advaced Class Name will be set to MemoryView Method Name will be set to MemoryView
4
Pre-filled name of initializer
Put caret on line 38
Invoke action Run | New Breakpoint from menu
In New Brakpoint dialog set Breakpoint Type to Method
Teardown:
Cancel the dialog
RESULT:
Check settings in New Breakpoint dialog: Package Name will be set to examples.advaced Class Name will be set to MemoryView Method Name will be set to <init>
5
Method breakpoint on method
Put caret on line 95
Invoke action Run | New Breakpoint from menu
In New Breakpoint dialog set Breakpoint Type to Method and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
The method breakpoint Method MemoryView:updateStatus will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 86 in MemoryView.
6
Method breakpoint on constructor
Put caret on line 62
Invoke action Run | New Breakpoint from menu
In New Breakpoint dialog set Breakpoint Type to Method and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
The method breakpoint will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 44 in MemoryView.
7
Method breakpoint on initializer
Put caret on line 40
Invoke action Run | New Breakpoint from menu
In New Breakpoint dialog set Breakpoint Type to Method and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
The method breakpoint will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 44 in MemoryView.
8
Method breakpoint on static method
Put caret on line 241
Invoke action Run | New Breakpoint from menu
In New Breakpoint dialog set Breakpoint Type to Method and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
The debugger will start and will stop after a while on line 236 in MemoryView.
9
Method breakpoint on all methods
Put caret on line 91
Invoke action Run | New Breakpoint from menu
In New Breakpoint dialog set Breakpoint Type to Method
Check All Methods for Given Classes and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop at MemoryView at line 236. After invoking Continue action it should stop on line 44, 116, 86, 73, 26, 86, 26, 86...
10
Conditional method breakpoint
Put caret on line 95
Invoke action Run | New Breakpoint from menu
In New Breakpoint dialog set Breakpoint Type to Method
Set Condition proeprty to false and press OK
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will not stop at the breakpoint
11
Print text
Put caret on line 91
Invoke action Run | New Breakpoint from menu
In New Breakpoint dialog set Breakpoint Type to Method and press OK
Change Print Text to "Breakpoint Hit!".
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop on the breakpoint and "Breakpoint Hit!" will be printed to the Debugger Console.
Purpose: Verifies variable breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor. Open Breakpoints view.
#
Test case
Description
1
Pre-filled class name
Put caret anywhere inside class MemoryView
Invoke action Run | New Breakpoint from menu
In New Brakpoint dialog set Breakpoint Type to Variable
Teardown:
Cancel dialog
RESULT:
Check settings in New Breakpoint dialog: Package Name will be set to examples.advaced Class Name will be set to MemoryView
2
Pre-filled field name in decalration
Put caret on line 30, on column 34 to 43
Invoke action Run | New Breakpoint from menu
Teardown:
Cancel dialog
RESULT:
Check settings in New Breakpoint dialog: Breakpoint type will be set to Variable Package Name will be set to examples.advaced Class Name will be set to MemoryView Field name will be set to msgMemory
3
Pre-filled field name in code
Select variable bundle on line 39 (doubleclick on the variable name or select variable name in editor)
Invoke action Run | New Breakpoint from menu
Teardown:
Cancel dialog
RESULT:
Check settings in New Breakpoint dialog: Breakpoint type will be set to Variable Package Name will be set to examples.advaced Class Name will be set to MemoryView Field name will be set to bundle
4
Stop on variable access
Select variable timer on line 38 (doubleclick on the variable name or select variable name in editor)
Invoke action Run | New Breakpoint from menu
Ensure the Stop on is set to Variable Access and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
The variable breakpoint Variable MemoryView.timer access will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 65 in MemoryView.
5
Stop on variable modification
Select variable timer on line 38 (doubleclick on the variable name or select variable name in editor)
Invoke action Run | New Breakpoint from menu
Ensure the Stop on is set to Variable Modification and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
The variable breakpoint Variable MemoryView.timer modification will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 38 in MemoryView.
6
Print text
Select variable timer on line 38 (doubleclick on the variable name or select variable name in editor)
Invoke action Run | New Breakpoint from menu
Set Print text to Breakpoint Hit! and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger should stop on line 65 and "Breakpoint Hit!" should be written to the Debugger Console
7
Conditional variable breakpoint
Select variable timer on line 38 (doubleclick on the variable name or select variable name in editor)
Invoke action Run | New Breakpoint from menu
Ensure the Stop on is set to Variable Access
Change Condition property to false and press OK
Teardown:
Finish debugging session and delete the breakpoint
Purpose: Verifies class breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor. Open Breakpoints view.
#
Test case
Description
1
Pre-filled values
Put caret into body of the class MemoryView
Invoke action Run | New Breakpoint from menu
Select Class from Breakpoint type combobox
Teardown:
Cancel dialog
RESULT:
Check settings in New Breakpoint dialog: Package Name will be set to examples.advaced Class Name will be set to MemoryView
2
Class filter
Put caret into body of the class MemoryView
Invoke action Run | New Breakpoint from menu
Select Class from Breakpoint type combobox
Enter MemoryView* as a Class Name
Set Suspend Debugging combobox to No Thread (continue)
Press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
MemoryView application will be started. 7 messages of hit class breakpoint will be shown in the Debugger Console.
3
Exclusion filter on
Invoke action Run | New Breakpoint from menu
Select Class from Breakpoint type combobox
Enter java as a Package Name
Enter * as a Class Name
Set Suspend Debugging combobox to No Thread (continue)
Ensure Exclusion Filter checkbox is unchecked
Press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Breakpoint will be hit many times by loaded classes that belong to java package. Application will be started.
4
Exclusion filter off
Invoke action Run | New Breakpoint from menu
Select Class from Breakpoint type combobox
Enter java as a Package Name
Enter * as a Class Name
Set Suspend Debugging combobox to No Thread (continue)
Ensure Exclusion Filter checkbox is checked
Press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Breakpoint will be hit many times by loaded classes that don't belong to java package. Application will be started.
5
Print text
Put caret into body of the class MemoryView
Invoke action Run | New Breakpoint from menu
Select Class from Breakpoint type combobox
Enter MemoryView* as a Class Name
Change Print Text to Breakpoint Hit!
Press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop on the breakpoint and "Breakpoint Hit!" will be written to the Debugger Console.
6
Stop on main class
Put caret into body of the class MemoryView
Invoke action Run | New Breakpoint from menu
Select Class from Breakpoint type combobox and press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop on breakpoint - no current program counter will be displayed and message will be in Debugger Console Class breakpoint hit for class examples.advanced.MemoryView.
Purpose: Verifies exception breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Breakpoints view.
#
Test case
Description
1
Exception breakpoint
Invoke action Run | New Breakpoint from menu
Select Exception from Breakpoint type combobox
Enter java.lang as a Package Name
Enter ClassNotFoundException as a Exception Class Name
Select Caught or Uncaught from the Stop On combobox
Press OK
Invoke Debug Main Project action
Debugger should stop on the breakpoint.
Select the breakpoint in breakpoints view and invoke Customize action
Change Package Name to java.io
Change Exception Class Name to FileNotFoundException
Invoke Continue action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Breakpoint will be hit by caught FileNotFoundException.
2
Stop on event
Invoke action Run | New Breakpoint from menu
Select Exception from Breakpoint type combobox
Enter java.lang as a Package Name
Enter ClassNotFoundException as a Exception Class Name
Select Caught from the Stop On combobox
Press OK
Invoke Debug Main Project action
Debugger should stop on the breakpoint
Select the breakpoint in breakpoints view and invoke Customize action
Select Uncaught from the Stop On combobox
Invoke Continue action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will not stop on the breakpoint any more and application will be started
3
Print text
Invoke action Run | New Breakpoint from menu
Select Exception from Breakpoint type combobox
Enter java.lang as a Package Name
Enter ClassNotFoundException as a Exception Class Name
Select Caught or Uncaught from the Stop On combobox
Change Print Text to Breakpoint Hit!
Press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop on the breakpoint and the "Breakpoint Hit!" message will be printed to the Debugger Console
Purpose: Verifies thread breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Breakpoints view.
#
Test case
Description
1
Thread breakpoint
Invoke action Run | New Breakpoint from menu
Select Thread from Breakpoint type combobox
Select Thread Start from Set Breakpoint On combobox.
Select No thread (continue) from Suspend debugging combobox
Press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session
RESULT:
Breakpoint will be hit by every started thread (see messsages in Debugger Console)
2
Set on event
Setup: Proceed steps from Thread breakpoint testcase
Select thread breakpoint in Breakpoints view and invoke Customize
Select Thread Death from Set Breakpoint On combobox.
Press OK
Invoke Debug Main Project action
Close MemoryView application by clicking on its Close button
Teardown:
Delete breakpoint
RESULT:
Breakpoint will be hit by finishing threads
3
Print text
Invoke action Run | New Breakpoint from menu
Select Thread from Breakpoint type combobox
Select Thread Start from Set Breakpoint On combobox
Change Print Text to Thread {threadName} started.
Select No thread (continue) from Suspend debugging combobox
Press OK
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Breakpoint will be hit by every started thread. For each one "Thread thread_name started." will be printed to the Debugger Console.
Purpose: Verifies annotations - debugger and source editor interaction
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor. Open Breakpoints view.
#
Test case
Description
1
Breakpoint
Toggle breakpoint on some line
Teardown:
Delete breakpoint
RESULT:
The line will be highlighted and red square will be shown on the left side of the line.
2
Multiple breakpoints
Toggle breakpoints on line 52 and 53
Select the breakpoint on line 53 and invoke Customize
Change Line Number to 52 and press OK
Teardown:
Delete breakpoints
RESULT:
The line 52 will be highlighted red and two red squares will be shown on the left side of the line.
3
Conditional breakpoint
Toggle Breakpoint on some line
Select the breakpoint and invoke Customize
Change Condition to "i<5" and press OK
Teardown:
Delete breakpoint
RESULT:
The line will be highlighted red and part of red square will be shown on the left side of the line.
4
Disabled breakpoint
Toggle Breakpoint on some line
Set Enabled property of this breakpoint to false
Teardown:
Delete breakpoint
RESULT:
The line will be highlighted gray and gray square will be shown on the left side of the line.
5
Disabled conditional breakpoint
Setup: Proceed steps from Conditional breakpoint testcase
Set Enabled property of this breakpoint to false
Teardown:
Delete the breakpoint
RESULT:
The line will be highlighted gray and part of gray square will be shown on the left side of the line.
6
Current program counter
Invoke Step Into action
Teardown:
Finnish debugging session
RESULT:
Line 236 will be highlighted green and green arrow will be shown on the left side of the line.
7
Program counter and breakpoint
Toggle breakpoint on line 91
Invoke Debug Main Project action
Teardown:
Finnish debugging session and delete the breakpoint
RESULT:
Debugger will stop on line 91. Line 91 will be highlighted green and red square with green arrow will be shown on the left side of the line.
8
Program counter and multiple breakpoints
Setup: Proceed steps from Multiple breakpoints testcase
Invoke Debug Main Project action
Teardown:
Finnish debugging session and delete the breakpoints
RESULT:
Debugger will stop on line 52. Line 52 will be highlighted green and two red squares with green arrow will be shown on the left side of the line.
9
Call site
Toggle breakpoint on line 101
Invoke Debug Main Project action
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop on line 101. Line 58 and 236 will be highlighted lilac and lilac triangle will be shown on the left side of the line.
Purpose: Verifies Sessions view functionality
Setup: Start NetBeans IDE with clear userdir. Open Sessions view.
#
Test case
Description
1
Running local session
Open project MemoryView and set it as main project
Invoke Debug Main Project action
Teardown:
Finish debugging session
RESULT:
Application will be started. There will be node with name examples.advanced.MemoryView representing this session in the Sessions view. State of the session will be Running and Language will be Java.
2
Remote session - listening
Invoke "Attach Debugger..." action
Select SocketListenfrom Connector combo box
Type localhost in Local address edit box
Type 1234 in Port edit box and press OK
Execute MemoryView from console (use switches -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:1234)
Teardown:
Finish debugging session
RESULT:
There will be node with name listenning:1234 representing this session in the Sessions view. State of session will be Running and Language will be Java.
3
Remote session - attaching
Execute MemoryView from console (use switches -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:1234,server=y)
Invoke "Attach Debugger..." action
Select SocketAttachfrom Connector combo box
Type localhost in Host edit box
Type 1234 in Port edit box and press OK
Teardown:
Finish debugging session and application
RESULT:
There will be node with name localhost:1234 representing this session in the Sessions view. State of session will be Running and Language will be Java.
4
Switch to session
Setup: Proceed steps from Multiple sessions testcase
Close source files MemroyView.java and LineBreakpoints.java in editor
Select session examples.advanced.MemoryView and invoke Make Current action from its context menu
Teardown:
Finish debugging sessions, delete breakpoints and delete watches
RESULT:
File MemoryView.java will be opened in editor and current program counter annotation will be displayed on line 91. Watches view will display value of expression free and will not display value of expression n (message "n" is not a known variable in current context will be displayed instead).
5
Session state
Open project MemoryView and set it as main project
Invoke Debug Main Project action
State of the session examples.advanced.MemoryView will be Running
Toggle breakpoint on line 101 in MemoryView.java
Teardown:
Finish debugging session and delete the breakpoint
RESULT:
Debugger will stop on the breakpoint and session state will be changed to Stopped
6
Finish session
Setup: Proceed steps from Multiple sessions testcase
Close source files MemroyView.java and LineBreakpoints.java in editor
Select session tests.LineBreakpoints and invoke Finish action from its context menu
Teardown:
Finish debugging session, delete breakpoints and delete watches
RESULT:
File MemoryView.java will be opened in editor and current program counter annotation will be displayed on line 91. Watches view will display value of expression free and will not display value of expression n (message "n" is not a known variable in current context will be displayed instead).
7
Stopped local session
Open project MemoryView and set it as main project
Toggle breakpoint on line 96
Invoke Debug Main Project action
Teardown:
Finish debugging session
RESULT:
Debugger will stop on breakpoint. There will be node with name examples.advanced.MemoryView representing this session in the Sessions view. State of the session will be Stopped and Language will be Java.
8
Multiple sessions
Open project MemoryView and set it as main project
Toggle breakpoint on line 91 of file MemoryView.java
Invoke Run | New Watch and create watch expression free
Invoke Debug Main Project action
Toggle breakpoint on line 200 of file LineBreakpoints.java
Invoke Run | New Watch and create watch expression n
Invoke Run | Run File | Debug "LineBreakpoints.java"
Teardown:
Finish debugging sessions, delete breakpoints and delete watches
RESULT:
Sessions view will display two sessions - examples.advanced.MemoryView, tests.LineBreakpoints - both in running state. The session tests.LineBreakpoints will be displayed in bold. Watches view will display value of expression n and will not display value of expression free (message "free" is not a known variable in current context will be displayed instead).
9
Finish all sessions
Setup: Proceed steps from Multiple sessions testcase
Select session tests.LineBreakpoints and invoke Finish All action from its context menu
Teardown:
Delete breakpoints and delete watches
RESULT:
Both debugging sessions will be closed.
10
View columns
Click small button right below view close button
In SessionsView - Change Visible Columns dialog check Host Name checkbox
Press OK
RESULT:
Sessions view will display four columns: Name, State, Language, Host Name.
Purpose: Verifies Thread View functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Threads view.
#
Test case
Description
1
Name
Invoke Debug Main Project action
Wait until GUI of the MemoryView is shown
Open Threads view and expand nodes system and main