TS 72 JPDAdbg DebuggingViews

Debugger Test Specification for NetBeans 6.7 Part III - Debugging Views

Author: Jiří Kovalský, based on earlier versions by Emanuel Hučka, Petr Cyhelský, Filip Zamboj and Vojtěch Sigler.
Version: 1.0
Lastupdate: 2012/05/02
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 and JSPExamples.

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
  2. Disable Variable formatters
    1. Invoke Tools -> Options
    2. Select Miscellaneous -> Java Debugger -> Variable Formatters
    3. Uncheck all of the formatters



Test suite: Sessions view

Purpose: Verifies Sessions view functionality
Setup: Start NetBeans IDE with clear userdir. Open Sessions view.

  1. Session state
    1. Open project MemoryView.
    2. Invoke Debug Project action
    3. State of the session examples.advanced.MemoryView will be Running
    4. Toggle line breakpoint on line 101 in MemoryView.java
    • EXPECTED RESULT: Debugger will stop on the breakpoint and session state will be changed to Stopped
    • Teardown: Finish debugging session and delete the breakpoint
  2. Multiple sessions
    1. Open project MemoryView.
    2. Toggle line breakpoint on line 91 of file MemoryView.java
    3. Invoke Debug | New Watch and create watch expression free
    4. Invoke Debug Project action
    5. Toggle line breakpoint on line 200 of file LineBreakpoints.java
    6. Invoke Debug | New Watch and create watch expression n
    7. Invoke Debug |Debug "LineBreakpoints.java"
    • EXPECTED RESULT: Sessions view will display two sessions - examples.advanced.MemoryView, tests.LineBreakpoints - both in Stopped state. The session tests.LineBreakpoints will have different icon (with thick black border). 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). There is not current pc annotation in file MemoryView.java.
    • Teardown: Finish debugging sessions, delete breakpoints and delete watches
  3. Switch to session
    • Setup: Proceed steps from Multiple sessions testcase
    1. Close source files MemoryView.java and LineBreakpoints.java in editor
    2. Select session examples.advanced.MemoryView and invoke Make Current action from its context menu
    • EXPECTED 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).
    • Teardown: Finish debugging sessions, delete breakpoints and delete watches
  4. Finish session
    • Setup: Proceed steps from Multiple sessions testcase
    1. Close source file MemoryView.java in editor
    2. Select session examples.advanced.MemoryView (current) and invoke Finish action from its context menu
    • EXPECTED RESULT: File LineBreakpoints.java will be opened in editor and current program counter annotation will be displayed on line 200. Sessions view shows only one debugger session tests.LineBreakpoints with current session icon.
    • Teardown: Finish debugging session, delete breakpoints and delete watches
  5. Finish all sessions
    • Setup: Proceed steps from Multiple sessions testcase
    1. Invoke Debug Project action
    2. Select session tests.LineBreakpoints and invoke Finish All action from its context menu
    • EXPECTED RESULT: Both debugging sessions will be closed.
    • Teardown: Delete breakpoints and delete watches
  6. Remote session - listening
    1. Invoke "Attach Debugger..." action
    2. Select SocketListenfrom Connector combo box
    3. Type localhost in Local address edit box
    4. Type 1234 in Port edit box and press OK
    5. Execute MemoryView from console (use switches -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:1234)
    • EXPECTED 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.
    • Teardown: Finish debugging session
  7. Remote session - attaching
    1. Execute MemoryView from console (use switches -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:1234,server=y)
    2. Invoke "Attach Debugger..." action
    3. Select SocketAttachfrom Connector combo box
    4. Type localhost in Host edit box
    5. Type 1234 in Port edit box and press OK
    • EXPECTED 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.
  8. Debug current thread
    1. Open ThreadSuspending.java file
    2. Place line breakpoint on line 39
    3. In the breakpoint's properties select Suspend -> All threads
    4. Start debugging by Debug File action
    5. Wait the breakpoint is hit, go to Sessions view, select current session and invoke its popup menu settings Scope | Debug Current Thread
    6. Invoke Step Over action a few times
    • EXPECTED RESULT: Debugged application will start with a few logs from Thread-1. After the session settings and Step Over actions there must be only logs from Thread-2 in output window.
  9. View columns
    • Setup: Use running remote session from Remote Session cases.
    1. Click small button right below view close button
    2. In SessionsView - Change Visible Columns dialog check Host Name checkbox
    3. Press OK
    • EXPECTED RESULT: Sessions view will display four columns: Name, State, Language, Host Name.
    • Teardown: Close all debugger sessions.
  10. View Session Languages
    • Setup: Open JSPExamples Project. Make sure Glassfish v2 or v3 is installed and working properly.
    1. Open Projects Tab
    2. Toggle breakpoint on line 25 in date.jsp. (WebPages -> dates -> date.jsp)
    3. Toggle breakpoint on line 27 in JspCalendar.java (SourcePackages -> dates -> JspCalendar.java)
    4. Debug Project (F5)
    5. Choose Server Side Java in popup window and press debug
    • EXPECTED RESULT: A web page should open in your default browser.
    1. Choose Date -> Execute on the page
    2. Execution should stop on line 27 of JspCalendar.java
    3. Press Continue from debugging menu (F5)
    4. Execution should stop on line 25 of date.jsp
    5. Choose Language -> Java from session context menu.
    • EXPECTED RESULT: Debugging view should stay the same after language change. There should be Java Language set at JSPExamples Session in Session View. Local Variables View should change and show local Java variables not JSPVariables such as Request, Session, Context Attributes and Implicit Objects.
    1. Choose Language -> JSP in session view at particluar row using Select Box.
    • EXPECTED RESULT: Debugging view should stay the same after language change. There should be JSP Language set at JSPExamples Session in Session View. Local Variables View should change and show local JSP variables only.
    • Teardown: Close all debugger sessions.


Test suite: Threads view

Purpose: Verifies Thread View functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open Threads view.

  1. Name
    1. Invoke Debug Project action
    2. Wait until GUI of the MemoryView is shown
    3. Open Threads view and expand node system
    • EXPECTED RESULT: There will be thread with name TimerQueue.
    • Teardown: Finish debugging session
  2. State
    1. Invoke Debug Project action
    2. Wait until GUI of the MemoryView is shown
    3. Open Threads view and expand node system
    • EXPECTED RESULT: State of thread TimerQueue should be set to Waiting (this thread is spending a lot of its time by waiting).
    • Teardown: Finish debugging session
  3. Switch to thread
    1. Toggle line breakpoint on line 106 of file MemoryView.java
    2. Invoke breakpoint properties and set Suspend to All threads
    3. Invoke Debug | New Watch and create watch expression free
    4. Invoke Debug Project action
    5. Debugger should stop on the breakpoint after a while
    6. Select node TimerQueue in the Threads view
    7. Invoke Make Current action from contex menu of this node
    • EXPECTED RESULT: Editor will open Object.java. Call Stack view will show information about TimerQueue thread.
    • Teardown: Finish debugging session and delete the breakpoint
  4. Method name
    1. Toggle line breakpoint on line 106
    2. Invoke Debug Project action
    3. Debugger should stop on the breakpoint after a while
    4. Invoke Window | Debugging | Call Stack action
    • EXPECTED RESULT: Top call stack line will be MemoryView.updateStatus:106.
    • Teardown: Finish debugging session and remove breakpoint
  5. Suspend thread
    1. Invoke Debug Project action
    2. Select node TimerQueue in the Threads view
    3. Change Suspended property of this node to true using popup menu for thread node or checkbox in Suspended column. (Use customize view button and enable this column.)
    • EXPECTED RESULT: Progress bar of the MemoryView will freeze, but GUI will react to user actions (ensure Refresh Now, Garbage Collect and Close buttons are working)
    • Teardown: Finish debugging session
  6. Resume thread
    • Setup: Proceed steps from Suspend Thread testcase
    1. Set refresh time in the MemoryView application to 100 and click Apply
    2. Change suspended property of TimerQueue node to false
    • EXPECTED RESULT: Progress bar of the MemoryView will be moving again (10 times faster than before).
    • Teardown: Finish debugging session
  7. Monitors
    1. Select DeadlockTest.java in Projects view
    2. Invoke Debug |Debug "DeadlockTest.java" menu
    3. Invoke Debug | Pause after the application stops
    4. Expand nodes system | main | Thread-0 and Thread-1
    • EXPECTED RESULT: Thread-0 has Waiting for Monitor: java.lang.Object (#<ref>) with reference the same as Thread-1 has Owned monitor and vice versa, Thread-1 has Waiting for Monitor: java.lang.Object (#<ref>) with reference the same as Thread-0 has Owned monitor.
    • Teardown: Finish debugging session
  8. Go to source
    1. Toggle line breakpoint on line 106 of MemoryView.java
    2. Invoke Debug Project action
    3. Debugger will stop on the breakpoint after a while
    4. Close file in source editor
    5. Select node system | main | main in the Threads view
    6. Invoke Go To Source action from context menu of this node
    • EXPECTED RESULT: Source editor will be opened with file MemoryView.java and caret should be on line 106.
    • Teardown: Finish debugging session and delete the breakpoint
  9. View columns
    1. Click small button right below view close button
    2. In ThreadsView - Change Visible Columns dialog check Suspended checkbox
    3. Press OK
    • EXPECTED RESULT: Threads view will display three columns: Name, State, Suspended.
  10. Interrupt thread
    1. Toggle line breapoints on lines 39 and 59 of DeadlockTest.java
    2. Start debugging by Debug File action on the file
    3. Wait until debugger reaches the first breakpoint, press Step Over until debugger reaches line 44 (synchronized(mutex2))
    4. Press Step Over again
    • EXPECTED RESULT: Debugger will act as suspended, Debugging view will be contain the information 'Step is blocked by suspended thread 'Thread-1'. Resume this thread to proceed?' and 'New Breakpoint Hit' with option to move to that breakpoint. .
  11. Interrupt thread - Resume
    • Setup: Continue with previous test case
    1. Press Resume button in Debugging view.
    • EXPECTED RESULT: Program will be running but both threads will have state On Monitor. Synchronization probably didn't occur. Therefore no action will be visible.
  12. Interrupt thread - Go to Breakpoint
    • Setup: Stop debugging session. Leave brekapoints on the same lines (39, 59)
    1. Invoke debuge file action
    2. Wait until debugger stops at line 39 and a 'New Breakpoint Hit' information appears in debugging window.
    3. Press the arrow at mentioned information
    • EXPECTED RESULT: Debugger will jump to line 59 and continue debugging of method Thread2.run().


Test suite: Call Stack view

Purpose: Verifies Call Stack window functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open file MemoryView.java in editor Open Call Stack view.

  1. Stack trace
    1. Toggle line breakpoint on line 101
    2. Invoke Debug Project action
    3. Debugger should stop on the breakpoint after a while
    4. Look at the content of the Call Stack view
    • EXPECTED RESULT: There will be three lines in the Call Stack view: "MemoryView.updateStatus:101" "MemoryView.<init>:58" "MemoryView.main:236"
    • Teardown: Finish debugging session and delete the breakpoint
  2. Hidden source calls
    • Setup: Proceed steps from Stack trace testcase
    1. Invoke Continue action
    2. Invoke Window | Debugging | Threads action
    3. Expand node System, main and doubleclick on node AWT-EventQueue-0
    • EXPECTED RESULT: Call Stack view will display top entry MemoryView.updateStatus:101 and last entry will be expandable node Hidden Source Calls. It will contain calls from JDK classes.
    • Teardown: Finish debugging session and delete the breakpoint
  3. Hidden source calls II
    • Setup: Proceed steps from Hidden source calls testcase
    1. Invoke Window | Debugging | Sources action
    2. Find line with path to JDK sources and check it to be used for debugging
    • EXPECTED RESULT: Call stack will display all entries and no Hidden Source Calls will be displayed
    • Teardown: Finish debugging session and delete the breakpoint
  4. Moving current frame
    1. Toggle line breakpoint on line 101
    2. Invoke Debug Project action
    3. Debugger should stop on the breakpoint after a while
    4. Create watch for expression free and check if it was evaluated
    5. Check if Local Variables view shows nodes: this, r, free, total, taken
    6. Select third line in Call Stack view and invoke Make Current from its context menu
    • EXPECTED RESULT: The watch will be marked as not know in the context. The Variables view will show nodes this and ev. The caret will be moved to line 62 of file MemoryView.java.
    • Teardown: Finish debugging session and delete the breakpoint
  5. Make caller current
    1. Place caret on line 121
    2. Invoke Run To Cursor action from menu or toolbar
    3. Wait until debugger is stopped on the line with caret
    4. Invoke Debug | Stack | Make Caller Current action from menu
    • EXPECTED RESULT: Editor will scroll to line 45, which will be highlighted by lilac and gutter will show lilac triangle. Second frame in the Call Stack view will be highlighted.
    • Teardown: Finish debugging session
  6. Make callee current
    • Setup: Process steps from Make caller current testcase
    1. Invoke Debug | Stack | Make Calee Current action from menu
    • EXPECTED RESULT: Editor will scroll back to line 121. Line will be highlighted same way as paused debugger and first frame will be hightlighted in Call Stack view.
    • Teardown: Finish debugging session
  7. Pop topmost call
    • Setup: Proceed step from Make caller current testcase
    1. Invoke Debug | Stack | Pop topmost call action from menu
    • EXPECTED RESULT: Editor will scroll to line 45. Line will be highlighted green with green arrow in forn of it. Call Stack view will display only two entries: MemoryView.<init>:45, MemoryView.main:236. First line will be highlighted.
    • Teardown: Finish debugging session
  8. Go to source
    1. Toggle line breakpoint on line 101
    2. Invoke Debug Project action
    3. Debugger should stop on the breakpoint after a while
    4. Close the file in editor
    5. Double-click on the top level call stack frame
    • EXPECTED RESULT: Source editor will show MemoryView.java and move caret to the line 101.
    • Teardown: Finish debugging session and delete the breakpoint
  9. View columns
    1. Click small button right below view close button
    2. In CallStackView - Change Visible Columns dialog check Location checkbox
    3. Press OK
    • EXPECTED RESULT: Call Stack view will display two columns: Name, Location


Test suite: Variables view

Purpose: Verifies Variables view functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open file MemoryView.java in editor Open Local Variables view.

  1. Local variables
    1. Put caret on line 91
    2. Invoke Run To Cursor action
    • EXPECTED RESULT: Debugger will stop on line 91. Local Variables view will contain nodes this, r, free, total. Nodes this and r should be expandable.
    • Teardown: Finish debugging session
  2. Member variables
    • Setup: Proceed steps from Local Variables testcase
    1. Expand node this
    • EXPECTED RESULT: Variables view will contain node timer, Static, Inehrited and other nodes under node this. Ensure node this is not under node this again.
    • Teardown: Finish debugging session
  3. Static variables
    • Setup: Proceed steps from Member Variables testcase
    1. Expand node Static
    • EXPECTED RESULT: Nodes msgMemory, bundle and other nodes will be under node Static. Ensure node Static is not under node Static again.
    • Teardown: Finish debugging session
  4. Inherited variables
    • Setup: Proceed steps from Member Variables testcase
    1. Expand node Inherited
    • EXPECTED RESULT: Nodes of variables from javax.swing.JFrame will be under node Inherited. Ensure node Inherited is not under node Inherited again.
    • Teardown: Finish debugging session
  5. Go to source
    • Setup: Proceed steps from Member Variables testcase
    1. Close file MemoryView.java in editor
    2. Select node jPanel1 under node this and invoke Go To Source from its context menu
    • EXPECTED RESULT: File MemoryView.java will be opened in editor. Caret will be on line 223.
    • Teardown: Finish debugging session
  6. Create fixed watch
    • Setup: Proceed steps from Member Variables testcase
    1. Select node r and invoke Create Fixed Watch from its context menu
    • EXPECTED RESULT: Node r will be in Watches view. Value of the node in watches view will be the same as in the Local Variables view.
    • Teardown: Finish debugging session
  7. View columns
    1. Click small button right below view close button
    2. In LocalsView - Change Visible Columns dialog check toString() checkbox
    3. Press OK
    • EXPECTED RESULT: Local Variables view will display four columns: Name, Type, Value, toString()
  8. Modify value
    1. Put caret on line 194 of MemoryView.java
    2. Invoke Run To Cursor action
    3. In MemoryView application press Apply button
    4. In Local Variables view doubleclick node rate
    5. Change its value to 10000
    6. Invoke Continue action
    • EXPECTED RESULT: The status of used memory will be updated every 10 seconds
    • Teardown: Finish debugging session
  9. Long arrays
    1. Open file LongArrays.java in editor
    2. Toggle line breakpoint on line 38
    3. Invoke Debug|Debug "LongArrays.java" action
    • EXPECTED RESULT: Nodes a, i, s, v will be in Local variables. When the nodes will be expanded, there will be subnodes with ranges 0-99, 100-199 to 900-999. Under these subnodes will be actual array members with their values. Ensure all nodes are shown in the view and all values are correct (value is equal to index).
    • Teardown: Finish debugging session, remove breakpoint and close file
  10. Tree/Table views
    1. Open file MemoryView.java in Editor.
    2. Press F7 button to start debugging MemoryView project.
    3. When debugger stops at line 236, right click in Variables view and select View as > Tree from popup menu.
    • EXPECTED RESULT: Variables view switched to show variables as tree expandable nodes. Make sure that Static and args variables are expandable and Type and Value columns are not displayed. Verify that View as > Table action returns back to table view.
    • Teardown: Finish debugging session.


Test suite: Loaded Classes view

Purpose: Verifies Loaded Classes view functionality
Comments: Loaded Classes view was replaced by HeapWalker for JDK version 1.6.0 and newer.
Setup: Start NetBeans IDE with clear userdir on JDK 1.5 or older. Open project MemoryView.. Open file MemoryView.java in editor. Open Loaded Classes view.

  1. Class loaders
    1. Put caret on line 91 of MemoryView.java
    2. Invoke Run To Cursor action
    • EXPECTED RESULT: There will be two nodes in Loaded Classes view: System Class Loader, Application Class Loader. The nodes will be expandable.
    • Teardown: Finish debugging session
  2. Package names
    1. Expand nodes System Class Loader and Application Class Loader
    • EXPECTED RESULT: There will be nodes with names com, java, javax, sun undes System Class Loader and node examples under Application Class Loader. The nodes will be expandable.
    • Teardown: Finish debugging session
  3. Inner classes
    1. Expand node Application Class Loader | examples.advanced | MemoryView
    • EXPECTED RESULT: There will be nodes with names 2, 3, 4, 5, 6. The nodes represent anonymous innner classes.
  4. View columns
    1. Click small button right below view close button
    2. In ClassesView - Change Visible Columns will be only one checkbox Name
    3. Press OK
    • EXPECTED RESULT: Loaded Classes view will display one column: Name

Teardown: Finish debugger session.

Test suite: HeapWalker

Purpose:
Setup: Start NetBeans IDE with clear userdir on JDK version 1.6.0 and newer. Open project MemoryView.. Open file MemoryView.java in editor. Close other editor windows.

  1. Classes View
    1. Put caret on line 116
    2. Invoke Run To Cursor action
    3. Open Window | Debugging | Loaded Classes view
    4. Find javax.swing.JPanel class
    5. Invoke Step over action
    • EXPECTED RESULT: Instances number of javax.swing.JPanel is increased.
  2. Show Only Subclasses
    • Setup: Continue with test case Loaded Classes View
    1. Sort the classes by name and find javax.swing.JComponent class
    2. Call popup menu on the class and invoke Show Only Subclasses action.
    3. Subclass of filter is selected with javax.swing.JComponent in its combobox
    4. Watch javax.swing.JLabel class
    5. Invoke step over action
    • EXPECTED RESULT: One instance of javax.swing.JLabel is added to the classes list.
  3. Show in Instances View
    • Setup: Continue with test case Show Only Subclasses
    1. Select the javax.swing.JLabel class in Classes view and invoke Show in Instances View action
    • EXPECTED RESULT: There should be one item in Instances list, a tree with root node this and subnodes e.g. text, mnemonic and defaulticon in Fields view and tree with root node this and subnodes text (MemoryView) and source (PropertyChangheSupport) in References view.
  4. Show in Classes View
    • Setup: Continue with test case Show In Instances View
    1. Select field text in Fields view and invoke Show in Classes View action from its popup menu
    • EXPECTED RESULT: java.lang.String should be selected in Classes view
  5. Show Instance
    • Setup: Continue with test case Show In Instances View
    1. Put editor cursor on line 58 in editor of MemoryView.java and invoke Run to Cursor action
    2. Find javax.swing.JLabel in Classes view and show its instances
    3. Select the first instance of the javax.swing.JLabel (or the one with Refresh time: in its text field)
    4. Select field text in Fields view and invoke Show Instance action from its popup menu
    5. Instances of java.lang.String are shown in Instances view. An instance is selected with 'Refresh time:' value in its value field
    6. Select text (JLabel) in References view and invoke its Show Instance popup action
    • EXPECTED RESULT: Instances of javax.swing.JLabel are shown again with first (the one from step 3) instance selected.
  6. Go To Source
    • Setup: Continue with test case Show Instance
    1. Select txtTime (MemoryView) reference in References view
    2. Invoke Go To Source action from its popup menu
    • EXPECTED RESULT: MemoryView.java editor should be opened. Cursor should be moved on MemoryView class definition line.

Teardown: Finish debugger session, remove all breakpoints.

Test suite: Sources view

Purpose: Verifies Sources view functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open file MemoryView.java in editor. Open Sources view.

  1. View columns
    1. Invoke Step Into action
    2. Click small button right below view close button
    3. In SourcesView - Change Visible Columns there is only one selected and grayed out option Source Root
    4. Press OK
    • EXPECTED RESULT: Classes view will display one column: Source Root. There will be checkboxes at the beginning of each row in the table.
  2. Default source roots
    • Setup: Proceed steps from View columns testcase
    • EXPECTED RESULT: Sources view will display following source roots:
    • <path to project./MemoryView/src (project MemoryView)
    • <path to JDK>/src.zip
    • Jdk source root will be displayed only if JDK sources are available.
    • Teardown: Finish debugging session
  1. Do not use JDK sources
    • Setup: Restart your netbeans with clean userdir. Ignore initial setup at the beginning of these page and repeat this Test Suite. Setup JDK sources in Java Platform Manager
    1. Place caret on line 98
    2. Invoke Run to Cursor
    3. Ensure JDK sources are checked to be used for debugging
    4. Disable JDK sources
    5. Invoke Step Into
    • EXPECTED RESULT: Debugger will stop on line 99.
    • Teardown: Finish debugger session
  2. Use JDK sources
    • Setup: Setup JDK sources in Java Platform Manager
    1. Place caret on line 98
    2. Invoke Run to Cursor
    3. Set JDK sources to be used for debugging
    4. Invoke Step Into
    • EXPECTED RESULT: Debugger will stop on JProgressBar.java on line 882 (for sun jdk 1.6.0).
    • Teardown: Finish debugging session


Test suite: Breakpoints view

Purpose: Verifies Breakpoints window functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open file MemoryView.java in editor. Open Breakpoints view.

  1. Add line breakpoint
    1. Toggle line breakpoint on line 91
    • EXPECTED RESULT: Breakpoint with name Line MemoryView.java:91 will be created. Icon of the breakpoint will be red sqaure.
    • Teardown: Delete breakpoint
  2. Remove line breakpoint
    • Setup: Proceed steps from Add line breakpoint testcase
    1. Toggle line breakpoint on line 91
    • EXPECTED RESULT: Breakpoint will be removed from breakpoints view.
  3. Add 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 and press OK
    • EXPECTED RESULT: Breakpoint with name Method MemoryView:updateStatus will be created. Icon of the breakpoint will be red triangle.
  4. Customize breakpoint
    • Setup: Proceed steps from Add method breakpoint testcase
    1. Invoke Properties action from the pop-up menu of the breakpoint node
    • EXPECTED RESULT: The Breakpoint Properties dialog must be shown
    • Teardown: Delete breakpoint
  5. Disable breakpoint
    1. Toggle line breakpoint on line 91
    2. Uncheck enabled property of breakpoint Line MemoryView.java:91 in Breakpoints view
    3. Invoke Debug Project action
    • EXPECTED RESULT: Application will be started and will not stop on the breakpoint.
    • Teardown: Finish debugging session and delete breakpoint
  6. Disable all breakpoints
    1. Open
      examples.advanced.MemoryView
      in source editor
    2. Toggle several breakpoints in editor gutter
    3. Create several non-line breakpoints - Debug | New Breakpoint ...
    4. Invoke Disable All action from the pop-up menu of the Breakpoints window pane
    • EXPECTED RESULT: All breakpoint must have Enabled property set to "False".
  7. Enable all breakpoints
    1. Invoke Enable All action from the pop-up menu of the Breakpoints window pane
    • EXPECTED RESULT: All breakpoint must have Enabled property set to "True".
  8. Remove all breakpoints
    1. Select any breakpoint from Breakpoints view and invoke Delete All action from its context menu
    • EXPECTED RESULT: All breakpoints will be removed from breakpoints view.
  9. Add to group
    1. Toggle breakpoints on lines 86, 91, 101
    2. Select node Line MemoryView.java:86 in Breakpoints View and invoke Move Into Group -> New action from its context menu
    3. In the dialog insert name group_a and press OK
    • EXPECTED RESULT: A group with name group_a will be created and it will contain tLine MemoryView.java:86 breakpoint. The breakpoint will not be visible in top level brekapoint list.
  10. Remove from group
    1. Select node Line MemoryView.java:91 and Line MemoryView.java:101 together and invoke Move Into Group -> New action from their context menu
    2. In the dialog insert name group_b and press OK
    3. Expand node group_b
    4. Select node Line MemoryView.java:91 and invoke Move Into Group -> Default action from its context menu
    • EXPECTED RESULT: Breakpoint Line MemoryView.java:91 will be removed from the group and will be displayed in toplevel breakpoints list.
    • Teardown: Delete all breakpoints
  11. Move to other group
    1. Toggle breakpoints on lines 86, 91, 101
    2. Select node Line MemoryView.java:86 and Line MemoryView.java:101 together and invoke Move Into Group -> group_a action from their context menu
    3. Select node Line MemoryView.java:86 and invoke Move Into Group -> New action from its context menu
    4. In the dialog insert name group_b and press OK
    • EXPECTED RESULT: Breakpoint Line MemoryView.java:86 will be removed from breakpoint group group_a. A group with name group_b will be created and it will contain breakpointLine MemoryView.java:86 breakpoint.
  12. Persistence - debugger start
    • Setup: Proceed steps from Move to other group testcase
    1. Uncheck enabled property of breakpoint Line MemoryView.java:86
    2. Invoke Debug Project action
    • EXPECTED RESULT: Debugger will stop on breakpoint on line 91. When debugging session is Finished, breakpoints will be in same groups as before debugger start.
  13. Persistence - restart IDE
    • Setup: Proceed steps from Move to other group testcase
    1. Uncheck enabled property of breakpoint Line MemoryView.java:86
    2. Select node Line MemoryView.java:101 and invoke Properties action from its context menu
    3. Check Condition checkbox and set condition value to true
    4. Put caret on line 62
    5. Invoke action Debug | New Breakpoint from menu
    6. In New Breakpoint dialog set Breakpoint Type to Method and press OK
    7. Select variable timer on line 38 (doubleclick on the variable name or select variable name in editor)
    8. Invoke action Debug | New Breakpoint from menu
    9. Ensure the Stop on is set to Field Access and press OK
    10. Restart IDE
    • EXPECTED RESULT: All breakpoints will be same as before IDE restart
    • Teardown: Delete all breakpoints
  14. Breakpoint highlighting
    1. Toggle line breakpoint on line 91 and 107
    2. Invoke Debug Project action
    3. When debugger stops on line 91, invoke Continue action
    • EXPECTED RESULT: Breakpoint Line MemoryView.java:91 is diplayed in plain text. Breakpoint Line MemoryView.java:107 is displayed in bold text.
    • Teardown: Finish debugging session and delete all breakpoints
  15. View columns
    1. Toggle line breakpoint on line 91 and 107
    2. Click small button right below view close button
    3. In BreakpointsView - Change Visible Columns there will be only one selected grayed out option Name
    4. Press OK
    • EXPECTED RESULT: Breakpoints view will display one column: Name. There will be a checkbox at the beginning of each row in the Breakpoints view.


Test suite: Watches view

Purpose: Verifies Watches view functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open file MemoryView.java in editor. Open Watches view.
Additional verification for each testcase in this test suite:

    1. for each testcase verifiy that you get the same result after you select blue diamond with tooltip Show watches in Variables view
    2. verify that icons in Variables View are the same as in watches view
  1. View columns
    1. Click small button right below view close button
    2. In WatchesView - Change Visible Columns dialog check toString() checkbox
    3. Press OK
    • EXPECTED RESULT: Watches view will display four columns: Name, Type, Value, toString()
  2. Add simple watch
    1. Invoke Debug | New Watch ... menu
    2. Enter name of the watch taken
    • EXPECTED RESULT: Watches view will show node with name taken. Other columns of the view will be empty.
  3. Add watch expression I
    1. Invoke Debug | New Watch ... menu
    2. Enter name of the watch System.getProperty("java.version")
    • EXPECTED RESULT: Watches view will show node with name System.getProperty("java.version"). Other columns of the view will be empty. Make sure code completition works!
  4. Add watch expression II
    1. Invoke New Watch from watches view context menu
    2. Enter name of the watch System.getProperty("java.version")
    • EXPECTED RESULT: Watches view will show node with name System.getProperty("java.version"). Other columns of the view will be empty. Make sure code completition works and New Watch dialog is the same as in testcase Add Watch Expression I!
  5. Add object watch
    1. Invoke Debug | New Watch ... menu
    2. Enter name of the watch bundle
    • EXPECTED RESULT: Watches view will show node with name bundle. Other columns of the view will be empty.
  6. Watches functionality
    1. Put caret on line 101
    2. Invoke Run to Cursor action
    • EXPECTED RESULT: Watches view will show nodes with names taken, System.getProperty("java.version") and bundle with types int, String and PorpertyReourceBundle. Value and toString() will show values of the first two watches and both columns will show the same value. Value for bundle will be its instance number. The third node will be expandable and it will contain nodes Static, Inherited, lookup.
    • Teardown: Finish debugging session
  7. Delete
    • Setup: Continue after Watches functionality testcase
    1. Select watch node with name System.getProperty("java.version")
    2. Invoke Delete action from pop-up menu
    • EXPECTED RESULT: The watch node will be deleted.
  8. Delete all
    • Setup: Continue after Delete testcase
    1. Put caret on line 101
    2. Invoke Run to Cursor action
    3. Select watch node with name bundle
    4. Invoke Create Fixed Watch action from its pop-up menu
    5. Select watch node with name taken
    6. Invoke Delete All action from the pop-up menu of the Watches view
    • EXPECTED RESULT: All watches except the fixed watch bundle will be deleted.
    • Teardown: Finish debugger session
  9. Create fixed watch I
    1. Create watch free
    2. Toggle line breakpoint on line 101
    3. Invoke Debug Project action
    4. Create new watch new Long(free)
    5. Invoke Create Fixed Watch action from pop-up menu
    6. Invoke Debug | Continue action
    • EXPECTED RESULT: Debugger will hit the breakpoint again. Fixed watch will display same value, the normal watch will change value.
    • Teardown: Finish debugging session, delete breakpoint and watches
  10. Create fixed watch II
    • Setup: Proceed steps from Create fixed watch I testcase
    1. Select fixed watch node with name new Long(free)
    2. Invoke its context menu
    • EXPECTED RESULT: There will be no menu item Create Fixed Watch
    • Teardown: Finish debugging session, delete only watch
  11. Create fixed watch III
    • Setup: Continue after Create fixed watch II testcase
    1. Invoke Debug Project action
    2. Invoke Window | Debugging | Variables action from main menu
    3. Select node taken in Variables view
    4. Invoke its context menu
    • EXPECTED RESULT: The Create fixed watch menu item will be disabled.
    • Teardown: Finish debugging session, delete breakpoint and watch
  12. Out of scope watch
    1. Put caret on line 101
    2. Create watch notInScope
    3. Invoke Run to Cursor action
    • EXPECTED RESULT: The watch value will be >"notInScope" is not a known variable in current context<
    • Teardown: Finish debugging session and delete watch
  13. Evaluation I
    1. Put caret on line 101
    2. Invoke Run to Cursor action
    3. Create watch System.out.println("Evaluated")
    • EXPECTED RESULT: There will be only one string Evaluated in the Output Window.
  14. Evaluation II
    1. Create watch #1s_45H-?
    • EXPECTED RESULT: Watch will have value Lexical error at line 1, column 1. Encountered: "#" (35), after : ""
  15. Evaluation III
    1. Create watch .aaa()
    • EXPECTED RESULT: Watch will have value Encountered "." at line 1, column 1.
  16. Evaluation IV
    1. Create watch this.aaa()
    • EXPECTED RESULT: Watch will have value There is no method "aaa" in class "examples.advanced.MemoryView".
  17. Evaluation V
    1. Put caret on line 106
    2. Invoke Run to Cursor action
    3. Create watch text.getText().substring(0,5)+text.getText().substring(text.getText().length()-6,text.getText().length())
    • EXPECTED RESULT: Watch will have value Used memory.
    • Teardown: Finish debugging session and delete all watches
  18. Evaluation VI
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoint on line 200
    3. Invoke Debug File action from context menu of the file in Projects explorer
    4. Create watch policko 10
    • EXPECTED RESULT: Watch will have value Array index "10" is out of range &lt;0,4&gt;
    • Teardown: Finish debugging session, delete watch and breakpoint
  19. Watch highlighting
    1. Open file LineBreakpoints.java in editor
    2. Toggle line breakpoint on line 195
    3. Invoke Debug File action from context menu of the file in Projects explorer
    4. Create watches i, s, llist
    5. Invoke Continue action
    • EXPECTED RESULT: Values of watches i and s will be displayed in bold font. Watch llist will be displayed normal.
    • Teardown: Finish debugging session, delete watches and breakpoint
  20. Long arrays
    1. Open file LongArrays.java in editor
    2. Toggle line breakpoint on line 38
    3. Invoke Debug|Debug "LongArrays.java" action
    4. Create watches with expressions a, i, s, v
    • EXPECTED RESULT: When the nodes a, i, s, v will be expanded, there will be subnodes with ranges 0-99, 100-199 to 900-999. Under these subnodes will be actual array members with their values. Ensure all nodes are shown in the view and all values are correct (value is equal to index).
    • Teardown: Finish debugging session, remove breakpoint, close file and delete watches
  21. Modify value
    1. Put caret on line 194 of MemoryView.java
    2. Invoke Run To Cursor action
    3. In MemoryView application press Apply button
    4. Create watch with expression rate
    5. Dobleclick its value and change it to 10000
    6. Invoke Continue action
    • EXPECTED RESULT: The status of used memory will be updated every 10 seconds
    • Teardown: Finish debugging session, delete watch
  22. Persistence - debugger start
    1. Toggle line breakpoint on line 101 of MemoryView.java
    2. Invoke Debug Project action
    3. Create watches bundle, taken, free.
    4. Select watch node with name bundle
    5. Invoke Create Fixed Watch action from pop-up menu
    6. Invoke Finish Debugger Session action
    7. Invoke Debug Project action
    • EXPECTED RESULT: Watches will be same as in previous debugging session except fixed watch which will be removed. All watches will have correct value.
  23. Persistence - restart IDE
    1. Select watch node with name free
    2. Invoke Create Fixed Watch action from pop-up menu
    3. Invoke Debug | Finish Debugger Session from main menu
    4. Restart IDE
    5. Invoke Debug Project action
    • EXPECTED RESULT: Watches will be same as in previous debugging session except fixed watch, which will be removed. All watches will have correct value.
    • Teardown: Finish debugging session, delete watches and breakpoint
  24. Tree/Table views
    1. Toggle breakpoint at line 239 in MemoryView.java.
    2. Using Debug > New Watch... create two watches: d and m.
    3. Press Ctrl+F5 to start debugging MemoryView project.
    4. When debugger stops at line 239, right click in Watches view and select View as > Tree from popup menu.
    • EXPECTED RESULT: Watches view switched to show watches as tree expandable nodes. Make sure that d and m watches are expandable and Type and Value columns are not displayed. Verify that View as > Table action returns back to table view.
  25. Dis/Enable watches
    1. Uncheck checkbox before m watch.
    2. Uncheck checkbox before d watch and then check it again.
    • EXPECTED RESULT: Watches view shows value and type of d watch but m watch has empty type and >disabled< is shown as value. Make sure that d watch is expandable.
    • Teardown: Finish debugging session.

Test suite: View filters

Purpose: Verifies functionality of filters in Local Variables and Watches view
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open file LineBreakpoints.java in editor. Toggle line breakpoint on line 200. Invoke Debug File action from context menu of the file in Projects explorer. Open Watches view.

  1. Primitive filter
    1. Create watch n
    2. Select the watch and invoke Display as | ... action
    • EXPECTED RESULT: The value will be displayed in these formats:
    • Decimal - 50
    • Hexadecimal - 0x32
    • Octal - 062
    • Binary - 110010
    • Character - '2'
    • toString() column will change in primitive types as display type changes.
  1. Filter based on value
    1. Create new watch string (note: You should have two watches active in your watches view, n of type int and string of type String)
    2. Select the watch you created in previous testcase and invoke Show only rows where | ... action on column value of watch n
    • {{{1}}}
  2. String filter
    1. Create watch string
    • EXPECTED RESULT: Node with name string will have value "Hi!". toString() column will display same value.
    • Teardown: Delete watch
  3. List filter
    1. Create watches llist, alist, vec
    • EXPECTED RESULT: Node with name llist will have type LinkedList. Node with name alist will have type ArrayList. Node with name vec will have type Vector. toString() value of the nodes will be 0. item, 1. item, 2. item, 3. item, ... 48. item, 49. item. Nodes will be expandable. Expanded node will show nodes with names 0 to 49, type of the subnodes will be String.
    • Teardown: Delete watch
  4. Map filter
    1. Create watches hmap, htab, tmap
    • {{{1}}}
    • Teardown: Delete watches
  5. Set filter
    1. Create watches hset, tset
    • EXPECTED RESULT: Node with name hset will have type HashSet. Node with name tset will have type TreeSet. toString() value of the nodes will be 0. item, 1. item, 2. item, 3. item, ... 48. item, 49. item, the items in it may not be ordered. Nodes will be expandable. Expanded node will show nodes with names 0 to 49, type of the subnodes will be String.
    • Teardown: Delete watches
  6. Array filter
    1. Create watches policko, pole, d2, d2 0
    • EXPECTED RESULT: Node with name pole will have type int[[ | ]] with length 50. Node with name policko will have type int[[ | ]] with length 5. Node with name d2 will have type int[[ | ]][[ | ]] with length 10. Node with name d2 0 will have type int[[ | ]] with length 20. Nodes will be expandable. Expanded node will show nodes with names 0 to its length. Type of the subnodes will be int for nodes policko, pole, d2 0. Type of subnodes will be int[[ | ]] for node d2, each subnode will be expandable and will show subnodes with names 0 to 20 and type int.
    • Teardown: Delete watches
  7. Object filter
    1. Create watch clazz
    • EXPECTED RESULT: Node with name clazz will have type Class and value class java.lang.Runtime.
    • Teardown: Delete watch


Test suite: New watch dialog

Purpose:
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView.. Open file MemoryView.java in editor.

  1. Dialog from main menu
    1. Invoke Debug | New Watch ... menu
    • EXPECTED RESULT: New Watch dialog will be shown.
    • Teardown: Close dialog
  2. Dialog from editor
    1. Invoke New Watch ... action from the pop-up menu of Editor
    • EXPECTED RESULT: New Watch dialog will be shown. This dialog is maintained by the editor module, ensure its design is the same as the design of the dialog from the debuggercore module.
    • Teardown: Close dialog
  3. Dialog from Watches view
    1. Invoke Window | Debugging | Watches menu
    2. Invoke New Watch... from context menu of Watches view
    • EXPECTED RESULT: New Watch dialog will be shown. Ensure its design is the same as the design of previos dialogs.
    • Teardown: Close dialog
  4. {{{1}}}
    1. Toggle line breakpoint on line 101
    2. Invoke Debug Project menu
    3. Invoke New Watch from context menu of Watches view
    • EXPECTED RESULT: New Watch dialog will be shown. The dialog will have code completion in its Watch Expression field.
  5. Code completion context I
    1. Write text String. into expression field
    2. If code completion is not opened automatically, press Ctrl+Space
    • EXPECTED RESULT: Code completion with static memeber and static methods of class String will be opened.
    • Teardown: Cancel code completion and delete written string
  6. Code completion context II
    1. Press Ctrl+Space
    2. Cancel code completion
    3. Write text this. into expression field
    4. If code completion is not opened automatically, press Ctrl+Space
    • EXPECTED RESULT: In the first case the completion list should start with free, r, taken and total. After this point to wait(timeout, nanos) both cases will be the same. The second case will end here and the first will mode items starting with assert, boolean, ...


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