TS 67 JPDAdbg Miscellaneous

(Difference between revisions)

Revision as of 09:14, 29 October 2010

Debugger Test Specification for NetBeans 6.7 Part V - Miscellaneous

Author: Emanuel Hucka, NB6.5 revision by Petr Cyhelsky, NB6.7 Beta revision by Filip Zamboj, NB6.7.1/6.8 revision by Vojtech Sigler
Version: 1.5
Lastupdate: 2009/07/22
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 Derive (attached) in test cases.

Contents


Important!! Setup Before You Start Testing

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

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

Test suite: 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. Open ClazzOne.java in source editor
    2. Toggle line breakpoint on line 27
    3. Invoke Debug File action from context menu of file in Projects view
    4. 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 "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. - Verify General Settings
    1. Open Tools -> Options -> Java Debugger -> General
    • EXPECTED RESULT: Verify that following checkboxes are checked:
    1. Open Debugger Console for Debugging Session
  2. Step Filters - Verify Initial Settings
    1. Open Tools -> Options -> Java Debugger -> Step Filters
    • EXPECTED RESULT: Verify that following checkboxes are checked:
    1. Do not step into
      1. synthetic methods
      2. all classes added by default
        1. java.lang.ClassLoader
        2. java.lang.StringBuffer
        3. java.lang.StringBuilder
        4. java.lang.AbstractStringBuilder
        5. java.lang.String
        6. sun.*
        7. sunw.*
  3. Variable Fomratters - Initial Settings
    1. Open Tools -> Options -> Java Debugger -> Variable Formatters
    • EXPECTED RESULT:Following formatters are present by default and action Remove is disabled for each of them:
    1. Default Collection Formatter
    2. Default Map Formatter
    3. Default Map.Entry Formatter

  1. Variable Formatters - Copy Formatter
    1. Open Tools -> Options -> Java Debugger -> Variable Formatters
    2. Invoke Copy action on Default Collection Formatter
    • EXPECTED RESULT:New formatter Default Collection Formatter (copy) is created:
  2. Variable Formatters - Edit&Use Formatter
    1. use formatter you created in previous testcase
    2. Use Derive project attached to this page
    3. Change name to Array List Formatter
    4. set class types to java.util.ArrayList
    5. toggle breakpoint to line 332 of DeriveView.java where code LexAn la = new LexAn(TextInput.getText()); is present
    6. start debugging session
    7. open Variable View
    8. write 2xy to derive application window and press analyze button
    9. step over after breakpoint is hit
    10. expand node la
    • {{{1}}}
  3. Variable Formatters - Create custom formatter
    1. Create new Java Project
    2. Open Tools -> Options -> Java Debugger -> Variable Formatters
    3. Invoke Add... action
    4. Create a new formatter:
      1. name it foobar formatter
      2. insert class name foo.bar
      3. check the value formatted as a result of code snippet and insert the code snippet "FOOBAR!"
    5. create a new package foo
    6. create a new class in the project foo.bar
    7. create an instance of the foo.bar class somewhere in the main project class (let`s name it barfoo, don`t forget to resolve imports) and put a breakpoint behind it (so that it will be hit)
    8. debug the project
    9. open variables window
    • EXPECTED RESULT:There is listed variable barfoo of type foo.bar and displayed 'value' "FOOBAR!"
  4. Step Filters - Don to step into constructors
    1. Use Derive Project attached to this wiki page
    2. Open Tools -> Options -> Java Debugger -> Step Filters
    3. check constructors (don't uncheck anything)
    4. add new step filter class xd36pjp_sp.LexAn
    5. toggle breakpoint on line 332 (initialization of new instance of LexAn class) and 341 (calling sa.analyze())
    6. run debugging session
    7. write 2xy into application as expression to derive
    8. invoke step into when debugger stops on breakpoint on line 332
    • EXPECTED RESULT: debugger will stop on line 342 and WON'T enter LexAn constructor
    • Teardown: Run next instance of netbeans with different userdir.
  5. Variable Formatters Persistence - restart IDE
    1. Proceed steps from testcase Variable Formatters - Create custom formatter, but use the following code snippet:
      "FOO" //new line - important
      

+ //new line - important

"BAR!"
    1. __Make sure the code snippet is in 3 lines, not all in one, before proceeding
    2. Restart the IDE
    3. Open Tools -> Options -> Java Debugger -> Variable Formatters
    4. Select the custom formatter you created and push the Edit button
    • EXPECTED RESULT: The code snippet in the textbox is exactly the same as the one you entered.

}}

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