TS 67 JPDAdbg DebuggingAndBreakpoints

Debugger Test Specification for NetBeans 6.7 Part IV - Debugging & Use of Breakpoints

Author: Emanuel Hucka, NB6.5 revision by Petr Cyhelsky, NB6.5 RC2 revision by Filip Zamboj, NB6.7 RC1 revision by Vojtech Sigler
Version: 1.5
Lastupdate: 2009/05/28
Introduction: This document describes test specification for testing of debuggerjpda module in NetBeans ide. Debuggerjpda is implementation of most common Java debugger - JPDA. The tests also cover debuggercore module providing basic framework for implementations of all debuggers in IDE.
Comments: There are used test projects MemoryView and freeform in test cases.

Contents


Important!! Setup Before You Start Testing

Purpose: Set up your Netbeans before you start testing. Please set up your netbeans in this way before each test!

  1. Setup Debugger Sources (Since version 7.0 M2 there should JDK sources enabled by default. Uncheck them)
    1. Invoke from main panel Window -> Debugger -> Sources
    2. uncheck <JAVA_HOME>/src.zip


Test suite: Line breakpoints

Purpose: Verifies line breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Breakpoints view.

  1. Line number customize I
    1. Open file MemoryView.java in editor
    2. Toggle line breakpoint on line 88
    3. Invoke Debug Project action from menu or toolbar
    4. Wait till debugger stops on the line 88
    5. Select corresponding breakpoint in the Breakpoints view
    6. Invoke Properties from context menu and change Line Number property of this breakpoint to 101
    7. Confirm the dialog and invoke Continue action
    • EXPECTED RESULT: There must be breakpoint annotation on the line 101. Debugger must stop on line 101 of MemoryView.java
    • Teardown: Finish debugging session and remove breakpoint
  2. Line number customize II
    1. Open file MemoryView.java in editor
    2. Toggle line breakpoint on line 96
    3. Select corresponding breakpoint in the Breakpoints view
    4. Invoke Properties from context menu and change Line Number property of this breakpoint to 500
    5. Confirm the dialog
    • EXPECTED RESULT: Ensure that no exception is thrown (MemoryView has less then 500 lines) and an information dialog appears with a message The line number 500 is too big.
    • Teardown: Finish debugging session and remove breakpoint
  3. Line number customize III
    1. Open file MemoryView.java in editor
    2. Toggle line breakpoint on line 96
    3. Invoke Properties from context menu above breakpoint icon in gutter in editor area and change Line Number property of this breakpoint to 500
    4. Confirm the dialog
    • EXPECTED RESULT: Ensure that no exception is thrown (MemoryView has less then 500 lines) and an information dialog appears with a message The line number 500 is too big.
    • Teardown: Finish debugging session and remove breakpoint
  4. Print text
    1. Open file MemoryView.java in editor
    2. Toggle line breakpoint on line 96
    3. Select corresponding breakpoint in the Breakpoints view
    4. Ivoke Properties action and change Print text property of this node to "Breakpoint hit!"
    5. Invoke Debug Project action from menu or toolbar
    • EXPECTED RESULT: Debugger should stop on the breakpoint after a while and message "Breakpoint hit!" should be shown in Debugger Console
    • Teardown: Finish debugging session and remove breakpoint
  5. Breakpoint in method
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoint on line 154
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger will stop on the breakpoint on line 154.
    • Teardown: Finish debugging session and delete the breakpoint
  6. Breakpoint in static method
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoint on line 150
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 150
    • Teardown: Finish debugging session and delete the breakpoint
  7. Breakpoint in initializer
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoint on line 10
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 10
    • Teardown: Finish debugging session and delete the breakpoint
  8. Breakpoint in static initializer
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 6
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 6
    • Teardown: Finish debugging session and delete the breakpoint
  9. Breakpoint in constructor
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 158
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 158
    • Teardown: Finish debugging session and delete the breakpoint
  10. Breakpoint in inner class
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 15
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 15
    • Teardown: Finish debugging session and delete the breakpoint
  11. Breakpoint in anonymous inner class
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 37
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 37
    • Teardown: Finish debugging session and delete the breakpoint
  12. Breakpoint in local class
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 93
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 93
    • Teardown: Finish debugging session and delete the breakpoint
  13. Other breakpoints I
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 52
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 52
    • Teardown: Finish debugging session and delete the breakpoint
  14. Other breakpoints II
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 74
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 74
    • Teardown: Finish debugging session and delete the breakpoint
  15. Other breakpoints III
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 23
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 23
    • Teardown: Finish debugging session and delete the breakpoint
  16. Other breakpoints IV
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 104
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 104
    • Teardown: Finish debugging session and delete the breakpoint
  17. Other breakpoints V
    1. Open file LineBreakpoints.java in editor
    2. Toggle breakpoint on the line 122
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 122
    • Teardown: Finish debugging session and delete the breakpoint
  18. Other breakpoints VI
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoint on line 140
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger should stop on the breakpoint on line 140
    • Teardown: Finish debugging session and delete the breakpoint
  19. Breakpoint placement - fast test
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoints on lines 6, 10, 15, 23, 37, 52, 74, 93, 104, 122, 140, 150, 154, 158, 200.
    3. Invoke Debug File action from context menu of the file in Projects explorer
    4. Disable each hit breakpoint and press continue.
    • EXPECTED RESULT: After the application is finished all breakpoints in Breakpoints view must be disabled.
  20. Suspend debugging - all threads
    1. Open file ThreadSuspending.java in editor
    2. Toggle line breakpoint on line 39
    3. Select corresponding breakpoint in the Breakpoints view
    4. Invoke Properties from context menu and change Suspend property of this breakpoint to All threads
    5. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger will start and will hit the breakpoint. In output window some output from Thread-1 (less than 100) and no output from Thread-2 will be displayed.
    • Teardown: Finish debugging session
  21. Suspend debugging - current thread
    1. Select the breakpoint in the Breakpoints view
    2. Invoke Properties from context menu and change Suspend property of this breakpoint to Breakpoint thread
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger will start and will hit the breakpoint. There will be only output from Thread-1 (no output from Thread-2 at all). The first lines of the output will read Thread-1: 1 and (after the breakpoint is hit) Thread-1: 2. Thread-1 keeps outputting this message (running).
    • Teardown: Finish debugging session
  22. Suspend debugging - no threads
    1. Select the breakpoint in the Breakpoints view
    2. Invoke Properties from context menu and change Suspend property of this breakpoint to No thread (continue)
    3. Invoke Debug File action from context menu of the file in Projects explorer
    • EXPECTED RESULT: Debugger will start and will not hit the breakpoint. Both Thread-1 and Thread-2 will output messages with increasing counter. There will be messages about breakpoint hit in Debugger Console.
    • Teardown: Delete the breakpoint
  23. Go To Source
    1. Open file MemoryView.java in editor
    2. Toggle line breakpoint on line 96
    3. Close source in editor
    4. Select corresponding breakpoint in the Breakpoints view
    5. Invoke Go to Source action from the context menu of this node
    • EXPECTED RESULT: Source Editor should be opened with file MemoryView.java with caret on line 96
    • Teardown: Remove breakpoint
  24. Toggle Line Breakpoint - main menu
    1. Open file MemoryView.java in editor
    2. Place carret on line 45
    3. Invoke Debug | Toggle Line Breakpoint action
    • EXPECTED RESULT: Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
    • Teardown: Remove the breakpoint
  25. Toggle Line Breakpoint - context menu
    1. Open file MemoryView.java in editor
    2. Place carret on line 45
    3. Invoke Toggle Line Breakpoint action from context menu of editor
    • EXPECTED RESULT: Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
    • Teardown: Remove the breakpoint
  26. Toggle Line Breakpoint - gutter
    1. Open file MemoryView.java in editor
    2. Click with mouse (left button) on editor gutter on line 45
    • EXPECTED RESULT: Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
    • Teardown: Remove the breakpoint
  27. Toggle Line Breakpoint - keyboard shortcut
    1. Open file MemoryView.java in editor
    2. Place carret on line 45
    3. Press Ctrl + F8
    • EXPECTED RESULT: Breakpoint will be created on line 45. The line will be highlighted in red and the breakpoint will be shown in Breakpoints view.
    • Teardown: Remove the breakpoint
  28. Conditioned breakpoint I
    1. Toggle line breakpoint on line 98 and 101 of Memory.java
    2. Select node Line MemoryView.java:98 in Breakpoints view and invoke Properties action from its context menu
    3. Check its Condition checkbox and set condition value to false
    4. Select node Line MemoryView.java:101 and invoke Properties action from its context menu
    5. Check Condition checkbox and set condition value to true
    6. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
  29. Conditioned breakpoint II
    1. Select node Line MemoryView.java:98 in Breakpoints view and invoke Properties action from its context menu
    2. Check Condition checkbox and set condition value to 1 == 0
    3. Select node Line MemoryView.java:101 and invoke Properties action from its context menu
    4. Check Condition checkbox and set condition value to 1 != 0
    5. Invoke Continue action
    • EXPECTED RESULT: Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
  30. Conditioned breakpoint III
    1. Select node Line MemoryView.java:98 in Breakpoints view and invoke Properties action from its context menu
    2. Check Condition checkbox and set condition value to (1 == 0) || false
    3. Select node Line MemoryView.java:101 and invoke Properties action from its context menu
    4. Check Condition checkbox and set condition value to (1 != 0) && true
    5. Invoke Continue action
    • EXPECTED RESULT: Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
  31. Conditioned breakpoint IV
    1. Select node Line MemoryView.java:98 in Breakpoints view and invoke Properties action from its context menu
    2. Check Condition checkbox and set condition value to Boolean.FALSE.booleanValue()
    3. Select node Line MemoryView.java:101 and invoke Properties action from its context menu
    4. Check Condition checkbox and set condition value to Boolean.TRUE.booleanValue()
    5. Invoke Continue action
    • EXPECTED RESULT: Debugger will not stop on breakpoint on line 98. Debugger will stop on the breakpoint on line 101.
  32. Conditioned breakpoint V
    1. Select node Line MemoryView.java:98 in Breakpoints view and invoke Properties action from its context menu
    2. Check Condition checkbox and set condition value to x!10a#
    3. Invoke Continue action
    • EXPECTED RESULT: Debugger will stop on breakpoint on line 98. Debugger console will contain message:
      Expecting boolean value instead of int
    • Teardown: Finish debugging session and delete breakpoint
  33. Conditioned breakpoint VI
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoint on line 190
    3. Select node Line LineBreakpoints.java:190 and invoke Properties action from its context menu
    4. Check Condition checkbox and set condition value to i > 10
    5. Invoke Debug File action from context menu of the file in Projects explorer
    6. Invoke Window | Debugging | Local Variables action from context menu
    • EXPECTED RESULT: Debugger will stop on the breakpoint after a while. Variable i in Local Variables view will have value 11.
    • Teardown: Finish debugging session and delete breakpoint
  34. Breakpoints Validation I
    1. Open file MemoryView.java in editor
    2. Toggle line breakpoint on lines 24, 31, 37, 43, 46, 57, 64, 90, 248.
    3. Invoke Debug Project action
    • EXPECTED RESULT: Debugger console will contain messages for all breakpoints:
    • Not able to submit breakpoint LineBreakpoint MemoryView.java :
    • reason: No executable location available at line .
    • Invalid LineBreakpoint MemoryView.java.
    • Debugger will not stop on any of the breakpoints. Icons of the breakpoints are changed to invalid version.
  1. Breakpoints Validation II
    1. Select examples.advanced package of main project
    2. Invoke New | File action from its popup menu
    3. Select Java Classes | Java Main Class, invoke next and finish the wizard.
    4. In the new opened class go to main method and write System.out.println("1"); on line 18, press enter six times and write System.out.println("2"); on line 24
    5. Toggle a breakpoint on line 24 (System.out.println("2");)
    6. Close the file in ide and edit it outside ide - remove the 5 empty lines between two System.out.println methods.
    7. Back in ide invoke Debug File on the NewMain file in Projects view
    • EXPECTED RESULT: Debugger console will contain messages:
    • Not able to submit breakpoint LineBreakpoint NewMain1.java : 24,
    • reason: The breakpoint is set outside of any class.
    • Invalid LineBreakpoint NewMain1.java : 24
  1. Breakpoint Hit Count - equals
    1. Open file LongArrays.java in editor
    2. Toggle line breakpoint on line 35
    3. Go to Breakpoints view and customize the breakpoint
    4. Check Break when hit count checkbox, select equals to in appropriate combobox and put 10 into the textfield.
    5. Confirm Breakpoint Properties dialog and invoke Debug File action.
    6. After debugger hit the breakpoint open Local Variables view and find variable 'j'.
    • EXPECTED RESULT: Value of the variable 'j' is 9.
    • Teardown: Finish debugging session and delete breakpoint
  2. Breakpoint Hit Count - is greater than
    1. Open file LongArrays.java in editor
    2. Toggle line breakpoint on line 35
    3. Go to Breakpoints view and customize the breakpoint
    4. Check Break when hit count checkbox, select is greater than in appropriate combobox and put 998 into the textfield.
    5. Confirm Breakpoint Properties dialog and invoke Debug File action.
    6. After debugger hit the breakpoint open Local Variables view and find variable 'j'.
    • EXPECTED RESULT: Value of the variable 'j' is 997.
    • Teardown: Finish debugging session and delete breakpoint
  3. Breakpoint Hit Count - is multiple of
    1. Open file LongArrays.java in editor
    2. Toggle line breakpoint on line 35
    3. Go to Breakpoints view and customize the breakpoint
    4. Check Break when hit count checkbox, select is multiple of in appropriate combobox and put 100 into the textfield.
    5. Confirm Breakpoint Properties dialog and invoke Debug File action.
    6. After debugger hit the breakpoint open Local Variables view and find variable 'j'.
    7. Invoke Continue a few times
    • EXPECTED RESULT: Value of the variable 'j' is 99 than 199, 299 etc.
    • Teardown: Finish debugging session and delete breakpoint


Test suite: Method breakpoints

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.

  1. Method breakpoint on method
    1. Put caret on line 95
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    4. Invoke Debug Project action
    • EXPECTED 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.java.
    • Teardown: Finish debugging session and delete the breakpoint
  2. Method breakpoint on constructor
    1. Put caret on line 46
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: The method breakpoint Method MemoryView.MemoryView will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 44 in MemoryView.java.
    • Teardown: Finish debugging session and delete the breakpoint
  3. Method breakpoint on inner method
    1. Put caret on line 62
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: The method breakpoint will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 62 in MemoryView.
    • Teardown: Finish debugging session and delete the breakpoint
  4. Method breakpoint on static method
    1. Put caret on line 241
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: The debugger will start and will stop after a while on line 236 in MemoryView.
    • Teardown: Finish debugging session and delete the breakpoint
  5. Method breakpoint on all methods
    1. Put caret on line 31
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: In the new Breakpoint dialog All Methods for Given Classes should be checked. Debugger will stop at MemoryView.java at line 236. After invoking Continue action it should stop on lines 44, 116, 86, 73, 26, 86, 26, 86...
    • Teardown: Finish debugging session and delete all breakpoints
  6. Method Breakpoints from gutter
    1. Click on gutter of lines 44, 85 and 235 of MemoryView.java
    2. Check appropriate method breakpoints are created in Breakpoints view. (MemoryView.MemoryView, MemoryView.updateStatus, MemoryView.main) New breakpoints should have set property Stop On : Method Entry.
    3. Click on gutter of lines 44, 85 and 235 of MemoryView.java again
    • EXPECTED RESULT: All created breakpoints should be deleted
  7. Conditional method breakpoint
    1. Put caret on line 95
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method
    4. Check Condition checkbox, set value of condition to false and press OK
    5. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will not stop at the breakpoint
    • Teardown: Finish debugging session and delete the breakpoint
  8. Stop On Method Entry and Exit
    1. Put caret on line 95
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method
    4. Select Stop On: Method Entry or Exit checkbox and press OK
    5. Invoke Debug Project action
    6. Wait the debugger hits the breakpoint and invoke Continue action
    • EXPECTED RESULT: Debugger will stop in MemoryView.java at line 86 and after continue at line 108.
  9. Method breakpoint customize
    1. Open file MemoryView.java in editor
    2. Put caret on line 120
    3. Invoke action Debug | New Breakpoint from menu
    4. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    5. Invoke Debug Project action from menu or toolbar
    6. Wait till debugger stops on the line 116
    7. Select corresponding breakpoint in the Breakpoints view
    8. Invoke Properties from context menu and change Method Name property of this breakpoint to updateStatus, select Stop On Method Exit
    9. Confirm the dialog and invoke Continue action
    • EXPECTED RESULT: Debugger will stop on line 108
    • Teardown: Finish debugger session and delete all breakpoints
  10. Method breakpoint - hit count
    1. Click gutter on line 85 of MemoryView.java
    2. Customize created breakpoint, check Break when hit count checkbox, select equals to type and set value of condition to 2.
    3. Invoke Debug Project action and wait the debugger is stopped
    4. Invoke Step out action
    • EXPECTED RESULT: Debugger is stopped on line 86.
    • Teardown: Finish debugger session and delete all breakpoints
  11. Print text
    1. Put caret on line 91
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    4. Change Print Text to "Breakpoint Hit!".
    5. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will stop on the breakpoint and "Breakpoint Hit!" will be printed to the Debugger Console.
    • Teardown: Finish debugging session and delete the breakpoint


Test suite: Field breakpoints

Purpose: Verifies field breakpoints 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.

  1. Create field breakpoint from class
    1. Put caret on line 35 of MemoryView.java
    2. Invoke action Debug | New Breakpoint from menu
    3. In New Breakpoint dialog set Breakpoint Type to Field, set Field name to 'timer' and confirm the dialog
    • EXPECTED RESULT: A new breakpoint is created. Check Breakpoints view for 'Field MemoryView.timer access' line
  2. Create field breakpoint on field
    1. Put caret on line 30, on column 34 to 43
    2. Invoke action Debug | New Breakpoint from menu and confirm the dialog
    • EXPECTED RESULT: A new breakpoint is created. Check Breakpoints view for Field MemoryView.msgMemory access line
  3. Create field breakpoint selected text
    1. Select field bundle on line 39 (doubleclick on the field name or select field name in editor)
    2. Invoke action Debug | New Breakpoint from menu and confirm the dialog
    • EXPECTED RESULT: A new breakpoint is created. Check Breakpoints view for Field MemoryView.bundle access line
    • Teardown: Remove all breakpoints.
  4. Field breakpoint from gutter
    1. Click on editor gutter for line 30 of MemoryView.java
    2. Check a new field breakpoint of MemoryView.msgMemory is created in Breakpoints View.
    3. Click on editor gutter for line 30 of MemoryView.java again
    • EXPECTED RESULT: The created breakpoint should be deleted.
  5. Stop on field access
    1. Select field timer on line 35 (doubleclick on the field name or select field name in editor)
    2. Invoke action Debug | New Breakpoint from menu
    3. Ensure the Stop on is set to Field Access and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: The field breakpoint Field 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.
    • Teardown: Finish debugging session and delete the breakpoint
  6. Stop on field modification
    1. Select field timer on line 35 (doubleclick on the field name or select field name in editor)
    2. Invoke action Debug | New Breakpoint from menu
    3. Select the Stop on to Field Modification and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: The field breakpoint Field 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.
    • Teardown: Finish debugging session and delete the breakpoint
  7. Stop on field access and modification
    1. Select field timer on line 35 (doubleclick on the field name or select field name in editor)
    2. Invoke action Debug | New Breakpoint from menu
    3. Select the Stop on to Field Access or Modification and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: The field breakpoint Field MemoryView.timer access or modification will be created and shown in Breakpoints view. The debugger will start and will stop after a while on line 38 in MemoryView.
    • Teardown: Finish debugging session and delete the breakpoint
  8. Conditional field breakpoint
    1. Select field timer on line 35 (doubleclick on the field name or select field name in editor)
    2. Invoke action Debug | New Breakpoint from menu
    3. Ensure the Stop on is set to Field Access
    4. Check Condition checkbox, set condition property to false and press OK
    • EXPECTED RESULT: Debugger will not stop on the breakpoint.
    • Teardown: Finish debugging session and delete the breakpoint
  9. Field breakpoint customize
    1. Open file MemoryView.java in editor
    2. Put caret on line 39 and select field bundle
    3. Invoke action Debug | New Breakpoint from menu and confirm the opened dialog
    4. Invoke Debug Project action from menu or toolbar
    5. Wait till debugger stops on the line 39
    6. Select corresponding breakpoint in the Breakpoints view
    7. Invoke Properties from context menu and change Field Name property of this breakpoint to timer and select Stop On Field Modification
    8. Confirm the dialog and invoke Continue action
    • EXPECTED RESULT: Debugger will stop on line 60
    • Teardown: Finish debugger session and delete all breakpoints
  10. Field breakpoint hit count
    1. Go to line 194 of MemoryView.java
    2. Select timer field (double click on it) and invoke action Debug | New Breakpoint from menu
    3. Check Break when hit count checkbox, select is greater than type and set value of condition to 3.
    4. Confirm the dialog and start debugging (invoke Debug Project action from menu)
    5. After the application is started press Apply button in its window.
    • EXPECTED RESULT: Debugger will hit the breakpoint and stop on line 194
  11. Print text
    1. Select field timer on line 35 (doubleclick on the field name or select field name in editor)
    2. Invoke action Debug | New Breakpoint from menu
    3. Set Print text to Breakpoint Hit! and press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: Debugger should stop on line 65 and "Breakpoint Hit!" should be written to the Debugger Console
    • Teardown: Finish debugging session and delete the breakpoint


Test suite: Class breakpoints

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.

  1. Pre-filled values
    1. Put caret into body of the class MemoryView
    2. Invoke action Debug | New Breakpoint from menu
    3. Select Class from Breakpoint type combobox and confirm the dialog
    • EXPECTED RESULT: Check settings in New Breakpoint dialog: Class Name will be set to examples.advaced.MemoryView
    • Teardown: Cancel dialog
  2. Classes pattern
    1. Put caret into body of the class MemoryView
    2. Invoke action Debug | New Breakpoint from menu
    3. Select Class from Breakpoint type combobox
    4. Enter examples.advanced.* as a Class Name
    5. Set Suspend combobox to No Thread (continue) and press OK
    6. Invoke Debug Project action
    • EXPECTED RESULT: MemoryView application will be started. 7 messages of hit class breakpoint will be shown in the Debugger Console (MemoryView, MemoryView$1, ...).
    • Teardown: Finish debugging session and delete the breakpoint
  3. Exclude classes
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Class from Breakpoint type combobox
    3. Enter examples.advanced.* as a Class Name
    4. Set Suspend combobox to No Thread (continue)
    5. Check Exclude classes checkbox and put examples.advanced.MemoryView$* to its textfield
    6. Press OK
    7. Invoke Debug Project action
    • EXPECTED RESULT: Breakpoint will be hit only one time - for examples.advanced.MemoryView
    • Teardown: Finish debugging session and delete the breakpoint
  4. Classes breakpoint hit count
    1. Put caret into body of the class MemoryView
    2. Invoke action Debug | New Breakpoint from menu
    3. Select Class from Breakpoint type combobox, edit class name to examples.advanced.*, check Break when hit count checkbox, select equals to and put '2' to the condition's textfield. Press OK
    4. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will stop on breakpoint - Class breakpoint hit for class examples.advanced.MemoryView$2.
    • Teardown: Finish debugging session and delete the breakpoint
  5. Class breakpoint customize
    1. Open file MemoryView.java in editor
    2. Put caret on line 39
    3. Invoke action Debug | New Breakpoint from menu, select Class Breakpoint Type and confirm the dialog
    4. Invoke Debug Project action from menu or toolbar
    5. Wait till debugger stops on the class breakpoint
    6. Select the breakpoint in the Breakpoints view
    7. Invoke Properties from context menu and change Class Name property of this breakpoint to examples.advanced.MemoryView$1
    8. Confirm the dialog and invoke Continue action
    • EXPECTED RESULT: Debugger will stop on line 60
    • Teardown: Finish debugger session and delete all breakpoints
  6. Print text
    1. Put caret into body of the class MemoryView
    2. Invoke action Debug | New Breakpoint from menu
    3. Select Class from Breakpoint type combobox
    4. Enter examples.advanced.MemoryView* as a Class Name
    5. Change Print Text to Breakpoint Hit!
    6. Press OK
    7. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will stop on the breakpoint and "Breakpoint Hit!" will be written to the Debugger Console.
    • Teardown: Finish debugging session and delete the breakpoint


Test suite: Exception breakpoints

Purpose: Verifies exception breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Breakpoints view.

  1. Exception breakpoint
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Exception from Breakpoint type combobox
    3. Enter java.lang.ClassNotFoundException as a Exception Class Name
    4. Select Caught or Uncaught from the Stop On combobox
    5. Press OK
    6. Invoke Debug Project action
    • EXPECTED RESULT: Breakpoint will be hit by caught ClassNotFoundException. You should see following text in Output Console window: Exception java.lang.ClassNotFoundException(<No current context>) breakpoint hit in java.lang.ClassLoader at line ? by thread main. Thread main stopped at ClassLoader.java.findBootstrapClass.
    • Teardown: Finish debugging session and delete the breakpoint
  2. Exception breakpoint filter throwing classes
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Exception from Breakpoint type combobox
    3. Enter java.lang.ClassNotFoundException as a Exception Class Name
    4. Check Filter on Classes Throwing the Exception and write java.lang.ClassLoader to Match Classes.
    5. Select Suspend action No thread (Continue) and confirm the dialog.
    6. Invoke Debug Project action
    7. Finish debugger session and customize the breakpoint
    8. Write java.net.URLClassLoader* to Exclude Classes. Clear Match Classes.
    9. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will hit the breakpoint only in java.lang.ClassLoader class for the first filter. For the second filter it never hit the breakpoint from any class in java.net.URLClassLoader
    • Teardown: Finish debugging session and delete the breakpoint
  3. Exception breakpoint condition
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Exception from Breakpoint type combobox
    3. Enter java.lang.ClassNotFoundException as a Exception Class Name
    4. Check Condition checkbox and write false to the textfield. Confirm the dialog.
    5. Invoke Debug Project action
    • EXPECTED RESULT: Breakpoint will not be hit.
    • Teardown: Finish debugging session and delete the breakpoint
  4. Exception breakpoint hit count
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Exception from Breakpoint type combobox
    3. Enter java.lang.ClassNotFoundException as a Exception Class Name
    4. Check Break when hit count checkbox, select equals to and write 2 to the textfield. Confirm the dialog.
    5. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will stop only once (invoke Continue to check it) with log 'Exception breakpoint hit in java.net.URLClassLoader$1'.
    • Teardown: Finish debugging session and delete the breakpoint
  5. Exception breakpoint customize
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Exception from Breakpoint type combobox
    3. Enter java.lang.ClassNotFoundException as a Exception Class Name
    4. Select Caught or Uncaught from the Stop On combobox
    5. Press OK
    6. Invoke Debug Project action
    7. Debugger should stop on the breakpoint.
    8. Select the breakpoint in breakpoints view and invoke Properties action
    9. Change Exception Class Name to java.io.FileNotFoundException
    10. Invoke Continue action
    • EXPECTED RESULT: Breakpoint will be hit by caught FileNotFoundException.
    • Teardown: Finish debugging session and delete the breakpoint
  6. Print text
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Exception from Breakpoint type combobox
    3. Enter java.lang.ClassNotFoundException as a Exception Class Name
    4. Select Caught or Uncaught from the Stop On combobox
    5. Change Print Text to Breakpoint Hit!
    6. Press OK
    7. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will stop on the breakpoint and the "Breakpoint Hit!" message will be printed to the Debugger Console
    • Teardown: Finish debugging session and delete the breakpoint


Test suite: Thread breakpoints

Purpose: Verifies thread breakpoint functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Breakpoints view.

  1. Thread breakpoint
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Thread from Breakpoint type combobox
    3. Select Thread Start from Stop On combobox.
    4. Select No thread (continue) from Suspend debugging combobox
    5. Press OK
    6. Invoke Debug Project action
    • EXPECTED RESULT: Breakpoint will be hit by every started thread (see messsages in Debugger Console)
    • Teardown: Finish debugging session
  2. Stop on Thread Death
    • Setup: Proceed steps from Thread breakpoint testcase
    1. Select thread breakpoint in Breakpoints view and invoke Properties
    2. Select Thread Death from Stop On combobox.
    3. Press OK
    4. Invoke Debug Project action
    5. Close MemoryView application by clicking on its Close button
    • EXPECTED RESULT: Breakpoint will be hit by finished main thread after application startup and by finishing threads during closing the application
    • Teardown: Delete breakpoint
  3. Thread breakpoint hit count
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Thread from Breakpoint type combobox
    3. Select Thread Start from Stop On combobox.
    4. Select No thread (continue) from Suspend debugging combobox
    5. Check Break when hit count checkbox, select equals to and write 1 to the textfield. Confirm the dialog.
    6. Invoke Debug Project action
    • EXPECTED RESULT: Debugger Console will contain 'Thread breakpoint hit by thread main.' log.
  4. Print text
    1. Invoke action Debug | New Breakpoint from menu
    2. Select Thread from Breakpoint type combobox
    3. Select Thread Start from Stop On combobox
    4. Change Print Text to Thread {threadName} started.
    5. Select No thread (continue) from Suspend debugging combobox
    6. Press OK
    7. Invoke Debug Project action
    • EXPECTED RESULT: Breakpoint will be hit by every started thread. For each one "Thread thread_name started." will be printed to the Debugger Console.
    • Teardown: Finish debugging session and delete the breakpoint


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo