TS 68 Debugger Sanity

(Difference between revisions)
Vsigler (Talk | contribs)
(Debugger Sanity Test Specification for NetBeans 6.8)
Newer edit →

Revision as of 15:00, 25 November 2009

Debugger Sanity Test Specification for NetBeans 6.8

Author: Vojtech Sigler based on previous version by Filip Zamboj
Version: 1.0
Last update: 2009/25/11
Introduction: Testcases for sanity testing all subcomponents of debugger module in NetBeans ide. (In Bugzilla: debugger->Java, Code, Ant)
Comments: There are used test projects MemoryView and freeform and JSPExamples 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 6.7 JDK sources are enabled by default. Uncheck them)
    1. Perform this setting on each test suite if instructions in test suite are not stating anything else
    2. Open your testing project according to test suite
    3. Invoke from main panel Window -> Debugger -> Sources
    4. uncheck <JAVA_HOME>/src.zip


Test suite: Projects View

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.

  1. Tree Projects View
    1. Invoke Projects popup menu
    2. Select View Java Packages as
    3. Select Tree
    • EXPECTED RESULT: Packages should switch to tree view. You should see 'folder' hierarchy that finishes at .java files.
  2. List Projects View
    1. Invoke Projects popup menu
    2. Select View Java Packages as
    3. Select List
    • EXPECTED RESULT: Packages should switch to list view. You should see the Project Name - Source Pakacges Folder - Packages (specified by brown picture in shape of cube)
    • Teardown: Close the project


Test suite: Java Debugger General Options

Purpose: Verifies if general options are present
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor.

  1. Java Debugger Options
    1. Invoke Tools -> Options -> Miscellaneous Tab -> Java Debugger Tab
    • EXPECTED RESULT: You see 3 categories for various settings of Java Debugger. These categories are: General, Step Filters, Variable Formatters
    • Teardown: Close the project


Test suite: Evaluate Expression View

Purpose: Verifies Evaluate Expression View
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor.

  1. Expression Evaluator view
    • Setup: Open project MemoryView
    1. Open file MemoryView.java in editor
    2. Invoke Debug Project
    3. Invoke Debug and pick Evaluate Expression
    • EXPECTED RESULT: Make sure that Expression Evaluator appeared between Editor and bottom Task panel. There must be a History button (triangle or arrow pointing down) and Evaluate Code Fragment button (a green arrow-like shape)
    • Teardown: Close the project


Test suite: Evaluate expression

Purpose: Verify functionality of the evaluator window
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor. Toggle line breakpoint on line 106 (text: text.invalidate();) and invoke Debug project action. Make sure that the violet diamond is pressed in Variables view!

  1. Primitive types
    1. Invoke Debug | Evaluate Expression action
    2. To expression field write {(int)(total-free);}
    3. Press Evaluate button
    • EXPECTED RESULT: The expression {(int)(total-free);} is not valid. Dialog with text "Malformed Expression: "(ERROR)"" and a button OK should appear.
  2. Variables
    1. Invoke Debug | Evaluate Expression action
    2. To expression field write return text.getText();
    3. Press Evaluate button
    • EXPECTED RESULT: Result list will contain result with name return text.getText() of type String and "Used ... bytes of ... allocated memory" String value
    • Teardown: Close the project
  3. Evaluation result view
    1. Continue with testcase Variables
    2. In Variables view click on the violet diamond
    • EXPECTED RESULT: The violet node disappears from the Variables view and a separate view titled Evaluation Result opens. The view contains a violet node with the latest evaluation result and a History node, which is expandable and contains all previous expressions.


Test suite: View filters

Purpose: Verifies functionality of filters in Variables and Watches view
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. 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.
  2. 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
    • EXPECTED RESULT: You should have several possibilites to filter watches:
      • Type == 50 with a result shows only n watch
      • Type <> 50 with a result shows only string watch
      • Type > 50 with a result shows no watch (note: to remove the filter invoke popup menu somewhere in the value column and select Show only rows where -> No Filter)
      • Type < 50 with a result shows only string watch
      • Type >= 50 with a result shows only n watch
      • Type <= 50 with a result shows only n and string watch
      • No filter with a result shows both watches
    • Teardown: Delete watch


Test suite: Basic functionality

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.

  1. Breakpoint functionality
    1. Open file MemoryView.java in editor
    2. Place your caret on line 101
    3. Invoke Toggle Line Breakpoint action from editor's popup menu
    4. Invoke Debug Project action from menu or toolbar
    • EXPECTED RESULT: Debugger will be started and after a while it will stop on line 101
    • Teardown: Remove the breakpoint
  2. Run to cursor
    • Setup: Proceed steps from Breakpoint functionality tescase
    1. Press F5 - an application window should appear a debugger should shop again at breakpoint on line 101
    2. Place your caret on line 96
    3. Invoke Run to Cursor action from menu or toolbar
    • EXPECTED RESULT: Debugger will run for a while and stop on line 96.
    • Teardown: Finish debugging session
  3. Run to cursor - start debugging
    1. Open file MemoryView.java in editor
    2. Place your caret on line 101
    3. Invoke Run to Cursor action from menu or toolbar
    • EXPECTED RESULT: Debugger will start and run for a while and stop on line 101.
    • Teardown: Finish debugging session
  4. Step Into - start debugging
    1. Invoke Step Into action from menu or toolbar
    • EXPECTED RESULT: Debugger will be started and stop on the first line of main method.
    • Teardown: Finish debugging session
  5. Step Into
    1. Open file MemoryView.java in editor
    2. Place your caret on line 58
    3. Invoke Toggle Line Breakpoint breakpoint from editor's popup menu
    4. Invoke Debug Project action from menu or toolbar
    5. Wait till debugger stops on line 58
    6. Invoke Step Into action
    • EXPECTED RESULT: Debugger will stop on line 86.
    • Teardown: Finish debugging session
  6. Step Over
    1. Invoke Debug Project action from menu or toolbar
    2. Wait till debugger stops on line 58
    3. Invoke Step Over action
    • EXPECTED RESULT: Debugger will stop on line 60.
    • Teardown: Finish debugging session and delete all breakpoints
  7. Step Over Expression
    1. Toggle line breakpoint on line 101
    2. Invoke Debug Project action from menu or toolbar
    3. Wait till debugger stops on line 101
    4. Invoke Step Over Expression action five times
    • EXPECTED RESULT: Debugger will step on all methods of the expression
    • Teardown: Finish debugging session and delete all breakpoints
  8. Step Out
    1. Toggle line breakpoint on line 58
    2. Invoke Debug Project action from menu or toolbar
    3. Wait till debugger stops on line 58
    4. Invoke Step Into action
    5. Wait till debugger stops on line 86
    6. Invoke Step Out action
    • EXPECTED RESULT: Debugger will stop on line 60.
    • Teardown: Finish debugging session and remove breakpoint
  9. Run Into Method
    1. Toggle line breakpoint on line 53
    2. Invoke Debug Project action from menu or toolbar
    3. Wait till debugger stops on line 53
    4. Place your caret on line 62 between 17th and 29st character (text updateStatus)
    5. Invoke Run Into Method action from editor popup menu
    • EXPECTED RESULT: The application will run for a second and after that debugger will stop on line 86.
    • Teardown: Finish debugging session and remove breakpoint
  10. Step Over Expression - Arguments
    1. Toggle line breakpoint on line 99
    2. Invoke Debug Project action
    3. Wait till debugger stops on line 99 and invoke Step Over action
    4. Invoke Step Over Expression action
    • EXPECTED RESULT: Debugger will stop on line 102, constructor Long is selected by a green color. Variables view contains Before call to '<init>' with subnode Arguments which contains subnode total. The icon next to Before call to '<init>' and Arguments nodes is a smaller version of the icon on Step Over Expression button in the Debug toolbar.
  11. Step Over Expression - Return Values
    1. Invoke Step Over Expression action
    • EXPECTED RESULT: Debugger will stop on line 103, constructor Long is selected by a green color. Variables view contains Before call to '<init>' node with subnodes Arguments and Return values history. Arguments node contains subnode free and node Return values history contains return <init>() subnode. The icon next to Before call to '<init>' and Arguments nodes is a smaller version of the icon on Step Over Expression button in the Debug toolbar. Return values history and its subnodes have an icon with a grey rectangle and a grey triangle. The Type column is empty and the Value column shows null. The constructor from previous test case is underlined.
  12. Step Over Expression - Arguments 2
    1. Invoke Step Over Expression action 2 times
    • EXPECTED RESULT: Debugger will stop on line 101, method format is selected by a green color. Variables view contains Before call to format node with subnodes Arguments and Return values history. Arguments node contains a subnode new Object[[ | ]]{new Long(total),new Long(free),new Integer(taken)} containing 3 subnodes of all array items. The Return values history node contains 3 return <init>() subnodes. The icon next to Before call to 'format' and Arguments nodes is a smaller version of the icon on Step Over Expression button in the Debug toolbar. Return values history and its subnodes have an icon with a grey rectangle and a grey triangle. All constructors in the expression are underlined.
  13. Step Over Expression - Return Values 2
    1. Invoke Step Over Expression action again
    • EXPECTED RESULT: Debugger will stop on line 101, method setText is selected by a green color. Variables view contains Before call to setText() node with subnodes Arguments and Return values history. Arguments node contains a node msgMemory.format(new Object[[ | ]]{new Long(total),new Long(free),new Integer(taken)}) of String type. Node Return values history contains 3 return <init>() subnodes and String node return format(). The icon next to Before call to 'setText()' and Arguments nodes is a smaller version of the icon on Step Over Expression button in the Debug toolbar. Return values history and its subnodes have an icon with a grey rectangle and a grey triangle. All constructors in the expression are underlined.
    • Teardown: Finish debugger session, delete all breakpoints


Test suite: Apply Code Changes

Purpose: To verify a Fix and Continue functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file FixAndContinue.java in editor.

  1. Change method I
    1. Toggle line breakpoint on line 25 of the file FixAndContinue.java
    2. Invoke Debug File action form context menu of file in Projects view
    3. Invoke Step Over
    4. Change method call on line 30 to afterFix();
    5. Invoke Apply Code Changes
    6. Invoke Step Over
    • EXPECTED RESULT: In output will be two messages: Before code changes followed by After code changes
    • Teardown: Finish debugging session Change method call on line 30 to beforeFix(); Remove brekapoint from line 25


Test suite: Variables view

Purpose: Verifies Variables window functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor Open Variables view.

  1. Variables
    1. Put caret on line 91
    2. Invoke Run To Cursor action
    • EXPECTED RESULT: Debugger will stop on line 91. 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 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 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 (or duplicated with watch icon when watches are shown in the Variables view). Value of the node in watches view will be the same as in the Variables view.
    • Teardown: Finish debugging session


Test suite: Breakpoints view

Purpose: Verifies Breakpoints window 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. 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 square.
    • 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 MemoryView.java 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. 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


Test suite: Watches view

Purpose: Verifies Watches view functionality
Important: Do this test suite with standalone Watches view as well as when it is integrated in the Variables view!! Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor. Open Watches view.

  1. 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.
  2. 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!
  3. 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!
  4. Add watch expression III
    1. Create a new watch System.getProperty("java.version") by typing into the Enter New Watch row in the Watches/Variables view and pressing enter
    • EXPECTED RESULT: Watches view will show node with name System.getProperty("java.version"). Other columns of the view will be empty. As of now the this method does not have code completion (bug #168970).
  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. 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


Test suite: New watch dialog

Purpose:
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open file MemoryView.java in editor.

  1. 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
  2. Dialog with code completion
    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.
  3. 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
  4. 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 continue showing items starting with assert, boolean, ...


Test suite: Threads view (Multithread)

Purpose: Verifies Thread View functionality
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project. Open Threads view.

  1. Switch to thread
    1. Toggle line breakpoint on line 106 of file MemoryView.java
    2. Open breakpoint properties and select Suspend -> 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: Call Stack view will show information about TimerQueue thread.
    • Teardown: Finish debugging session and delete the breakpoint
  2. 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
  3. 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
  4. 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
  5. 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 once more
    • 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. .
  6. 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 show state 'On Monitor'. Synchronization probably didn't occur. Therefore no action will be visible.
  7. 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: Line breakpoints (Multithread)

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. 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
  2. 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
  3. 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
  4. 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



Test suite: Sessions view (Multithread)

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

  1. Debug all threads
    1. Open ThreadSuspending.java file
    2. Place line breakpoint on line 39
    3. Invoke properties on the breakpoint and change Suspend property to 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 All Threads
    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 will be mixed logs from Thread-1 and Thread-2 in output window.
  2. Debug current thread
    1. Continue with previous testcase (Debug all threads)
    2. Select the current session in Sessions view and invoke its popup menu
    3. Select Scope | Debug Current Thread
    4. Invoke Step Over action a few times
    • EXPECTED RESULT: There will be only logs from Thread-2 after this set of Step Over actions.
    • Teardown: Finish debugging session and remove breakpoint
  3. 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. Invoke Clean and Build Project
    5. Debug Project (Ctrl + F5)
    • 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: Resume/Suspend threads. (Multithread)

Purpose: Verifies the functionality of threads table buttons

Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project.

  1. Suspend running thread
    1. Make sure that Debugging view is opened.
    2. Select ThreadSuspending1.java, invoke Debug "ThreadSuspending1.java" popup menu action and switch to Debugging view.
    3. Make sure that Show suspend/resume table button is turned on and Show system threads button is turned off.
    4. 3 threads should be running.
    5. Select Thread-1, invoke Make Current from its popup menu and push SUSPEND button.
    • EXPECTED RESULT: Thread-1 should be suspended. This thread also should be marked as Current Thread by green bar in the left. Its title should be changed to Thread-1 suspended at Thread.sleep. Appropriate node for this thread should expandable (+). There should be shown thread frame where the thread was suspended. The Debugger Console tab of Output view prints Thread Thread-1 stopped at Thread.java.sleep. The left icon (with SUSPEND) next to node should be orange. The button for this thread should change to RESUME
  2. Resume suspended thread
    1. Make sure that Debugging view is opened.
    2. Make sure that Show suspend/resume table button is turned on and Show system threads button is off.
    3. Push RESUME button next to suspended Thread-1 suspended at Thread.sleep in Debugging view.
    • EXPECTED RESULT: Thread-1 should be running. The Debugger Console tab of Output view prints User Program running. Its title should be changed back to Thread-1. Now the left icon (without SUSPEND) next to node should be green. The button for this thread should change to SUSPEND
  3. Suspend running thread - popup menu
    1. Make sure that Debugging view is opened.
    2. Switch to Debugging view.
    3. 3 threads should be running.
    4. Select Thread-1 thread and invoke Suspend popup menu action. (Make Current item has to be disabled and Suspend and Interrupt items have to be enabled)
    • EXPECTED RESULT: Thread-1 should be suspended. This thread also should be marked as Current Thread by green bar in the left. Its title should be changed to Thread-1 suspended at Thread.sleep. Appropriate node for this thread should expandable (+). There should be shown thread frame where the thread was suspended. The Debugger Console tab of Output view prints Thread Thread-1 stopped at Thread.java.sleep. The left icon (with SUSPEND) next to node should be orange. The button for this thread should change to RESUME
  4. Resume suspended thread - popup menu
    1. Make sure that Debugging view is opened.
    2. Select suspended Thread-1 suspended at Thread.sleep in Debugging view and invoke Resume popup menu action. (Make Current and Interrupt items have to be disabled)
    • EXPECTED RESULT: Thread-1 should be running. The Debugger Console tab of Output view prints User Program running. Its title should be changed back to Thread-1. Now the left icon (without SUSPEND) next to node should be green. The button for this thread should change to SUSPEND
  5. Multiple selection
    1. Select more than 1 thread and invoke popup menu.
    • EXPECTED RESULT: For threads in running state there should be Interrupt and Suspend actions enabled. For threads in suspended state there should be Resume action enabled only. For threads in different state (suspended and running) all action should be disabled.
  6. Set Current Thread
    1. Suspend All Threads
    2. Make Thread 3 current as described in Test suite: Debugging application, point 3 of this document
    3. Invoke Debug from main menu
    4. Choose Set Current Thread option
    5. Choose Thread 2
    6. Confirm by enter
    • EXPECTED RESULT: Thread should be highlighted and set as current.
    • Teardown: Stop debugged application - invoke Debug | Finish Debugger Session from main menu.


Test suite: Debugging application (Multithread)

Purpose: Verifies breakpoints usage
Setup: Start NetBeans IDE with clear userdir. Open project MemoryView and set it as main project.

  1. Stopping at breakpoints
    1. Open ThreadSuspending1.java file and put breakpoints to 28, 47, and 63 lines (line contains i++;)
    2. Invoke Debug "ThreadSuspending1.java" popup menu action and switch to Debugging view.
    • EXPECTED RESULT: In a moment Thread-1, Thread-2 and Thread-3 should be suspended annotated with orange icon with red rectagle. For each application thread there should be RESUME button available. Thread-1 has to be marked as Current Thread by green bar. Thread-2 and Thread-3 have to be suspended - yellow bar. Application threads must be expandable (+). Ensure that each thread was suspended on appropriate line as defined in step 1. In the bottom of Debugging view another panel should appear. Verify that New Breakpoint Hits (2) and bold arrow are present in the bottom of Debugging view. Scroll down BOLD ARROW: Thread-2 stopped at LineBreakPoint ThreadSuspendin.java:47 and Thread-3 stopped at LineBreakPoint ThreadSuspendin.java:63 have to be there. Debugger Console of Output there has to be
      • Listening on port <portnumber>
      • User program running
      • LineBreakPoint ThreadSuspending1.java : 28 successfully submitted.
      • LineBreakPoint ThreadSuspending1.java : 47 successfully submitted.
      • LineBreakPoint ThreadSuspending1.java : 63 successfully submitted.
      • Breakpoint hit at line 28 in class tests.ThreadSuspending$1 by thread Thread-1.
      • Thread Thread-1 stopped at ThreadSuspendin.java:28.
      • Breakpoint hit at line 47 in class tests.ThreadSuspending$2 by thread Thread-2.
      • Breakpoint hit at line 63 in class tests.ThreadSuspending$3 by thread Thread-3.
  2. Resuming threads
    1. Switch to Debugging view
    2. Select all application threads. (Thread-1, Thread-2 and Thread-3) and invoke Resume popup menu action.
    • EXPECTED RESULT: Application threads should be resumed and suspended afterwards immediately.
  3. Change Current Thread
    1. Switch to Debugging view and select non current thread which encountered breakpoint.
    2. Invoke Make Current popup menu action.
    • EXPECTED RESULT: This thread should be marked as current (Thread title should be ) with green bar, highlighted breakpoint (green line in editor) belongs to current thread now. New Breakpoint Hits decreases by 1.
  4. Change Current Thread II
    1. Switch to Debugging view
    2. Double click non current suspended thread - it is current thread now.
    3. Text of current thread name should be bold.
    4. Expand current thread node.
    • EXPECTED RESULT: This thread should be marked as current (method of suspended thread is printed in BOLD only, collapsing thread node should make thread's name bold again) with green bar, highlighted breakpoint (green line in the editor) belongs to current thread now. New Breakpoint Hits decreases by 1.
    • Teardown: Stop debugged application - invoke Run
  5. Current Thread Chooser
    1. Invoke Debug ThreadSuspending1.java popup menu action.
    2. In a while all application threads should be suspended.
    3. Press ALT+SHIFT+T - "Current Thread Chooser" dialog should be shown.
    4. Holding both ALT and SHIFT key and pushing T key should switch among all suspended threads.
    • EXPECTED RESULT: Verify the functionality of choosing current thread. Chosen thread should be also indicated in Debugging view by green bar next to it.
    • Teardown: Stop debugged application - invoke Run
  6. Monitors
    1. Edit ThreadSuspending1.java. Surround i++; line with synchronized (this) {} and make sure that breakpoints are set for lines increasing variable i
    2. Invoke Debug ThreadSuspending1.java popup menu action.
    3. In a while all application threads should be suspended.
    4. Push Show monitors button from the toolbar of Debugging view.
    • EXPECTED RESULT: Monitors for each thread should be shown for appropriate line in thread frame of Debugging view.
    • Teardown: Stop debugged application - invoke Run
  7. Deadlock detection
    1. Select DeadlockTest.java and Debug DeadlockTest.java popup menu action.
    2. Invoke debugging view's context menu
    3. select check for deadlock option
    • EXPECTED RESULT: Over the Debugging toolbar there should appear yellow panel with Deadlock detected label.
    • Teardown: Stop debugged application - invoke Run


Test suite: Operations (Ant)

Purpose:
Setup: Start NetBeans with clean userdir. Open/create sample project AnagramGame. Switch to Files view.

  1. Start debugging
    1. Select node build.xml and invoke from its contex menu Debug Target | run
    • EXPECTED RESULT: Debugger stops on line 35 of build.xml opened in editor. Variables, Watches and Call Stack debugger views are opened. Output contains two tabs: anagram (run) and build.xml
    • Teardown: Finish debugging session
  2. Finish debugging
    • Setup: Perform steps from Start debugging case
    1. Finish debugging session
    • EXPECTED RESULT: Program counter is not displayed any more. Debugger toolbar is closed. Target run is not executed (check messages in ant-debugger-tests output). Debugger views are closed
  3. Step over
    • Setup: Perform steps from Start debugging case
    1. Invoke action Step Over two times
    • EXPECTED RESULT: Program counter is on line 474 in build-impl.xml at the beginning of EXECUTION SECTION.
    • Teardown: Finish debugging session
  4. Step into
    • Setup: Perform steps from Start debugging case
    1. Invoke action Step Over 4 times
    2. Invoke action Step Into
    • EXPECTED RESULT: Program counter is on line 475. Whole target "j2seproject1" node has green background. Call stack view displays nodes j2seproject1 and run
    • Teardown: Finish debugging session
  5. Step out
    • Setup: Perform steps from Start debugging case
    1. Invoke action Step Into 8 times
    • EXPECTED RESULT: Program counter is on line 41. Target -init-private is executed. Program counter is on first property line.
    1. Invoke action Step Out 3 times
    • EXPECTED RESULT: Program counter is on line 474 inside build-impl.xml and whole target run has green background.
    • Teardown: Finish debugging session


Test suite: Breakpoints (Ant)

Purpose:
Setup: Start NetBeans with clean userdir. Open/create sample project AnagramGame. Switch to Files view and open build.xml file.

  1. Toggle breakpoint
    1. Toggle breakpoint on line 36
    • EXPECTED RESULT: Line 36 is highlighted with red background and red square in gutter
    • Teardown: Remove breakpoint
  2. Breakpoint functionality
    • Setup: Perform step from Toggle breakpoint case
    1. Select node build.xml and invoke from its contex menu Debug Target|run
    2. Invoke Continue action
    • EXPECTED RESULT: Program counter is on line 36. The line is highlighted with green background and red square with green arrow in gutter
    • Teardown: Finish debugger and remove breakpoint
  3. Continue after breakpoint
    • Setup: Perform steps from Breapkoint functionality case
    1. Invoke Continue action
    • EXPECTED RESULT: Rest of target run is executed without stopping. Debugger views are closed
    • Teardown: Remove breakpoint
  4. Finish debugger does not stop on breakpoint
    • Setup: Perform step from Toggle breakpoint case
    1. Select node build.xml and invoke from its contex menu Debug Target|run
    2. Invoke Finish Debugger Session action
    • EXPECTED RESULT: Program counter is not displayed any more. Target run is not executed (check messages in ant-debugger-test output). Debugger views are closed
    • Teardown: Remove breakpoint
  5. Disable breakpoint
    • Setup: Perform step from Toggle breakpoint case
    1. Invoke Window|Debugging|Breakpoints action
    2. In Breakpoints view select breakpoint build.xml:36 and invoke Disable from its context menu
    3. Select node build.xml and invoke from its context menu Debug Target|run
    4. Invoke Continue action
    • EXPECTED RESULT: Program counter is not displayed any more. Target run is fully executed without stopping (check messages in output window). Debugger views are closed
    • Teardown: Remove breakpoint


Test suite: Watches & Local Variables (Ant)

Purpose:
Setup: Start NetBeans with clean userdir. Open/create sample project AnagramGame. Switch to Files view.

  1. Stop on watch
    1. On line 34 inside build.xml file select text name
    2. Invoke action New Watch from editor context menu, modify text to "ant.project.name" and press OK in New Watch dialog
    3. Select node build.xml and invoke from its context menu Debug Target|run
    • EXPECTED RESULT: Program counter is on line 35. Watches view shows watch ant.project.name with value anagrams
    • Teardown: Finish debugging session and delete watch
  2. Local variables
    1. Select node build.xml and invoke from its context menu Debug Target|run
    2. Invoke Window|Debugging|Local Variables from main menu
    • EXPECTED RESULT: Local Variables lists all properties set for the build script. List contains ant.project.name with value anagrams
    • Teardown: Finish debugging session


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