TS 74 JPDAdbg Miscellaneous

Debugger Test Specification for NetBeans 6.7 Part V - Miscellaneous

Author: Jiří Kovalský, based on earlier versions by Emanuel Hučka, Petr Cyhelský, Filip Zamboj and Vojtěch Sigler.
Version: 1.0
Lastupdate: 2013/08/21
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: The following test projects are used in the test suites: MemoryView and freeform and Derive.

Contents


Test suite: Miscellaneous

Purpose: Verified a various debugger's functionality
Setup: Start NetBeans IDE with clear userdir Open project MemoryView and project Derive. Set Memory View as main project for now.

  1. Two top level classes in one file - step functionality
    1. Invoke Window > Debugging > Sources from main menu.
    2. Uncheck <JAVA_HOME>/src.zip source root.
    3. Open ClazzOne.java in source editor.
    4. Toggle line breakpoint on line 27
    5. Invoke Debug File action from context menu of file in Projects view
    6. Invoke Step Into until debugger finishes
    • EXPECTED RESULT: Debugger will step through constructor of class ClazzTwo and method doit()
    • Teardown: Delete breakpoint
  2. Two top level classes in one file - line breakpoint
    1. Open ClazzOne.java in source editor
    2. Toggle line breakpoint on line 39
    3. Invoke Debug File action form context menu of file in Projects view
    • EXPECTED RESULT: Breakpoint Line ClazzOne.java:39 will be created. Debugger will stop on the breakpoint.
    • Teardown: Finish debugging session and delete breakpoint
  3. Two top level classes in one file - class breakpoint
    1. Open ClazzOne.java in source editor
    2. Place caret on line 33
    3. Invoke New Breakpoint and create class breakpoint
    4. Invoke Debug File action form context menu of file in Projects view
    • EXPECTED RESULT: Breakpoint Class ClazzTwo load / unload will be created. Debugger will stop on line 27 when loading class.
    • Teardown: Finish debugging session and delete breakpoint
  4. Two top level classes in one file - method breakpoint
    1. Open ClazzOne.java in source editor
    2. Place caret on line 39
    3. Invoke New Breakpoint and create method breakpoint
    4. Invoke Debug File action form context menu of file in Projects view
    • EXPECTED RESULT: Breakpoint Method ClazzTwo.doit will be created. Debugger will stop on the breakpoint.
    • Teardown: Finish debugging session and delete breakpoint
  5. Code completion in condition field
    1. Toggle line breakpoint on line 101 of MemoryView.java
    2. Invoke Breakpoint|Properties from context menu of breakpoint annotation in guter
    • EXPECTED RESULT: Breakpoint Properties dialog will be opened. Code completion with context of MemoryView.java file will be possible in Condition field.
    • Teardown: Cancel the dialog and delete breakpoint
  6. Debugging multithreaded application
    1. Open file ThreadSuspending.java in editor
    2. Toggle breakpoints on lines 28 and 38
    3. Create watch i
    4. Invoke Debug|Debug File "Thread Suspending.java" menu
    5. When debugger stops on breakpoint, invoke Step Into or Step Over action
    • EXPECTED RESULT: It will be possible to invoke the actions and debugger will not freeze. If the step actions will be dissabled, action Continue will start the debuged process and the breakpoints will be hit again.
    • Teardown: Finish debugging session, delete breakpoints and watch, close the file
  7. Abort debugging session
    1. Invoke Step Into menu
    2. Right click on progress bar in status bar and invoke Cancel Process from the context menu
    • EXPECTED RESULT: Debugged application will be killed and debugger finished.

Test suite: JPDA Debugger Options

Purpose: Verified a various debugger's functionality
Setup: Start NetBeans IDE with clear userdir Open project MemoryView and set it as main project.

  1. General Settings
    1. Open Tools > Options from main menu (or NetBeans > Preferences on Mac OS X)
    2. Select Java category and Java Debugger tab.
    3. Select General category of Debugger options.
    • EXPECTED RESULT: The following checkboxes are checked: Open Debugger Console for debugging session, Reuse Editor when displaying source code.
  2. Step Filters
    1. Select Step Filters category of Debugger options.
    • EXPECTED RESULT: The following checkboxes are checked: Do not step into, synthetic methods and all classes added by default: java.lang.ClassLoader, java.lang.StringBuffer, java.lang.StringBuilder, java.lang.AbstractStringBuilder, java.lang.String, java.lang.invoke.ConstantCallSite, java.lang.invoke.Invokers and java.lang.invoke.LambdaForm.
  3. Variable Formatters
    1. Select Variable Formatters category of Debugger options.
    • EXPECTED RESULT: The following formatters are present, enabled and button Remove is disabled for each of them: Default CharSequence Formatter, Default Collection Formatter, Default Map Formatter, Default Map.Entry Formatter and Default Enum Formatter
  4. Variable Formatters - Copy Formatter
    1. Select Default Collection Formatter.
    2. Push Copy button.
    • EXPECTED RESULT: New formatter Default Collection Formatter (copy) is created.
  5. Variable Formatters - Edit&Use Formatter
    1. Open Derive project and install missing Swing Application Framework Library plugin from the NetBeans Update Center.
    2. Select Default Collection Formatter (copy) and click Edit... button.
    3. Change the name to Array List Formatter.
    4. Set Class types: to java.util.ArrayList.
    5. Push OK button and close the Options window.
    6. Toggle line 332 breakpoint in DeriveView.java with LexAn la = new LexAn(TextInput.getText()); code.
    7. Push Ctrl+F5 to start debugging session.
    8. Write 2xy to derive application window and press Analyze button.
    9. One the line 332 breakpoint is hit, push 'Step Over button.
    10. In Variables view expand node la.
    • EXPECTED RESULT: Verify there is instance al of ArrayList present. Its String value (not displayed by default) is size = 0 and it has no child.
  6. Variable Formatters - Create custom formatter
    1. Create a new Java Application project.
    2. Open Tools > Options from main menu (or NetBeans > Preferences on Mac OS X)
    3. Select Java category and Java Debugger tab.
    4. Select Variable Formatters category of Debugger options.
    5. Push Add... button.
    6. Set FooBar Formatter as its name.
    7. Set foo.Bar as Class types.
    8. Check the Value formatted as a result of code snippet option and insert the code snippet "FOO.BAR CLASS!".
    9. Push OK button and close the Options window.
    10. Create a new Java Package foo.
    11. Create a new Bar Java Class in the foo package.
    12. Modify main(String[] args) method of your application to contain Bar bar = new Bar(); code followed by System.out.println("foo.Bar class created.");.
    13. Create a line breakpoint on the second line with the System.out.println.
    14. Push Ctrl+F5 to start debugging session.
    • EXPECTED RESULT: There is a bar variable in the Variables window of type Bar and its String value is "FOO.BAR CLASS!".
  7. Step Filters - Do not to step into constructors
    1. Open Tools > Options from main menu (or NetBeans > Preferences on Mac OS X)
    2. Select Java category and Java Debugger tab.
    3. Select Step Filters category of Debugger options.
    4. Check constructors option and don't uncheck anything else.
    5. Push Add... button.
    6. Name it java.io.* and let it checked.
    7. Push OK button and close the Options window.
    8. Create a line breakpoint at line with the Bar bar = new Bar(); code.
    9. Push Ctrl+F5 to start debugging session.
    10. Invoke Step Into twice when the line breakpoint is hit.
    • EXPECTED RESULT: Debugger will neither step into constructor of the foo.Bar class nor to java.io.PrintStream class.
  8. Variable Formatters Persistence - restart IDE
    1. Restart the NetBeans IDE.
    2. Open Tools > Options from main menu (or NetBeans > Preferences on Mac OS X)
    3. Select Java category and Java Debugger tab.
    • EXPECTED RESULT: Verify that all changes you did to variable formatters and step filters persisted.
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