TS 80 ANTdbg

Ant debugger Test Specification for NetBeans 8.0

Author: Jiří Kovalský
Version: 1.0
Lastupdate: 11/07/2013
Introduction: This is full test specification for Ant Debugger in the NetBeans IDE.

Contents


Test suite: Setup NetBeans

Purpose: This test suite activates Java SE functionality in the NetBeans IDE by creating new Anagram Game project.
Setup: Launch NetBeans IDE with an empty userdir.

  1. Create Anagram Game project
    1. Invoke File > New Project... from main menu.
    2. Select Samples > Java category, Anagram Game project and push Next > button.
    3. Push Finish button. If you are asked to download JUnit and CVS plugins, do that.
    • EXPECTED RESULT: There is AnagramGame project node in Projects Explorer.

Test suite: Menu items

Purpose: This test suite verifies if all menu items are presented on correct places.
Setup: Perform Setup NetBeans test suite.

  1. Menu items on build XML file
    1. Switch to Files Explorer.
    2. Right click AnagramGame > build.xml file node.
    • EXPECTED RESULT: The menu contains item Debug Target with the following sub menu items: default, clean, compile, debug, jar, javadoc, profile, profile-single, profile-test, profile-test-single, profile-test-with-main, run, test, test-single, test-single-method, Other Targets and Advanced...
  2. Menu items on other XML file
    1. Right click AnagramGame > nbproject > project.xml file node.
    • EXPECTED RESULT: The menu does not contain item Debug Target.

Test suite: Basic operations

Purpose: This test suite verifies if very basic Ant debugger functionality works.
Setup: Perform Setup NetBeans test suite.

  1. Start debugging
    1. Right click AnagramGame > build.xml and invoke Debug Target > run.
    • EXPECTED RESULT: Debugger is started and stops execution at line 35 of build.xml file which is opened in Editor. Variables, Call Stack and Breakpoints debugger views are opened. If you invoke Windows > Output from main menu the output window contains two tabs: anagram (run) and build.xml
  2. Finish debugging
    1. Invoke Debug > Finish Debugger Session from main menu.
    • EXPECTED RESULT: Program counter is not displayed any more. Debugger toolbar is closed. Debugger views are closed. AnagramGame application is closed shortly after its execution.
  3. Step Over
    1. Right click AnagramGame > build.xml and invoke Debug Target > run.
    2. When debugger stops at line 35, invoke Debug > Step Over from main menu 2 times.
    • EXPECTED RESULT: Program counter is at line 1029 in build-impl.xml file at the beginning of EXECUTION SECTION. init depending target name is highlighted with a green color.
  4. Step Into
    1. Invoke action Debug > Step Into from main menu 2 times.
    • EXPECTED RESULT: Program counter is at line 36. Whole <target name="-pre-init"> ...</target> target has green background. Call stack view displays nodes -pre-init, init and run.
  5. Step Out
    1. Invoke action Debug > Step Into from main menu 3 more times.
    2. When program counter stops at line 41, invoke Debug > Step Out from main menu 5 times.
    • EXPECTED RESULT: Program counter is at line 1029 inside build-impl.xml file and whole target run has green background.

Test suite: Breakpoints

Purpose: This test suite verifies if line breakpoints work in Ant Debugger.
Setup: Perform Setup NetBeans test suite.

  1. Toggle breakpoint
    1. Put cursor at line 36 in build.xml file and invoke Debug > Toggle Line Breakpoint from main menu.
    2. Invoke Window > Debugging > Breakpoints from main menu.
    • EXPECTED RESULT: There is build-impl.xml:41 breakpoint created in Breakpoints view.
  2. Breakpoint functionality
    1. Right click AnagramGame > build.xml and invoke Debug Target > run.
    2. When Debugger stops execution at line 35, invoke Debug > Continue from main menu.
    • EXPECTED RESULT: Debugger will stop at line 36.
  3. Continue after breakpoint
    1. Invoke Debug > Continue from main menu.
    • EXPECTED RESULT: Rest of target run is executed without stopping and Anagrams dialog is opened.
  4. Finish debugger ignores breakpoint
    1. Invoke Debug > Finish Debugger Session from main menu.
    2. Right click AnagramGame > build.xml and invoke Debug Target > run.
    3. When Debugger stops execution at line 35, invoke Debug > Finish Debugger Session from main menu.
    • EXPECTED RESULT: Debugger will stop and breakpoint at line 36 will not be hit.
  5. Disable breakpoint
    1. In Breakpoints view right click build.xml:36 breakpoint and invoke Disable.
    2. Select node build.xml and invoke from its context menu Debug Target | run.
    3. Invoke Continue action.
    • EXPECTED RESULT: Program counter is not displayed any more. Target run is fully executed without stopping and Anagrams dialog is opened.

Test suite: Watches

Purpose: This test suite verifies if it's possible to use watches when debugging Ant scripts.
Setup: Perform Setup NetBeans test suite.

  1. New watch from editor
    1. Invoke Window > Debugging > Watches from main menu.
    2. Right click AnagramGame > build.xml file node and invoke Open it in Editor.
    3. Right click Editor area and invoke New Watch....
    4. Type hello as Watch Expression and push OK button.
    • EXPECTED RESULT: Watch with name hello is created and displayed in Watches view.
  2. New watch from view
    1. Right click Variables view area and invoke New Watch....
    2. Type world as Watch Expression and push OK button.
    • EXPECTED RESULT: Watch with name world is created and displayed in Watches view.
  3. Delete watch
    1. Right click world watch and invoke Delete.
    • EXPECTED RESULT: world watch disappeared from Watches view.
  4. Watch value
    1. At line 34 in build.xml file select text name.
    2. Right click Editor area and invoke New Watch....
    3. Modify text in Watch Expression field to ant.project.name and push OK button.
    4. Right click AnagramGame > build.xml and invoke Debug Target > run.
    • EXPECTED RESULT: Program counter is at line 35. Watches view shows watches ant.project.name with value anagrams and hello watch with value <null value>.
  5. Local Ant properties
    1. Switch to Variables view.
    • EXPECTED RESULT: Variables view lists all local Ant properties set for the build script like java.vm.version, java.vendor.url etc.
  6. Value based filtering
    1. Make sure that Show watches inside Variables view blue diamond icon is pushed.
    2. Right click anagrams value of ant.project.name watch and invoke Show only rows where > Value == anagrams.
    • EXPECTED RESULT: Variables view lists one ant.project.name watch with blue diamond icon and one ant.project.name local Ant property.

Test suite: Highlighting

Purpose: This test suite verifies if program counter highlighting works in Ant debugger.
Setup: Perform Setup NetBeans test suite.

  1. Line highlighting
    1. Right click AnagramGame > build.xml and invoke Debug Target > run.
    • EXPECTED RESULT: Line 35 is highlighted with a green color and green arrow replaced "35" line number identifier in the Editor gutter.
  2. Element highlighting
    1. Invoke Debug > Step Over from main menu.
    2. Invoke Debug > Step Into from main menu.
    • EXPECTED RESULT: Whole element <fail message="...</fail> is highlighted with a green color and green arrow replaced "23" line number identifier in the Editor gutter.
  3. Breakpoint highlighting
    1. Put cursor at line 41 in build-impl.xml file and push Ctrl + F8 to toggle line breakpoint.
    • EXPECTED RESULT: The whole line 41 is highlighted with a red color and red square replaced "41" line number identifier in the Editor gutter. Its tooltip is Breakpoint.
  4. Disabled breakpoint highlighting
    1. Invoke Window > Debugging > Breakpoints from main menu.
    2. In Breakpoints view right click breakpoint build-impl.xml:41 breakpoint and invoke Disable.
    • EXPECTED RESULT: Line 41 is highlighted with a gray color and gray square replaced "41" line number identifier in the Editor gutter. Its tooltip is Disabled Breakpoint.
  5. Hit breakpoint highlighting
    1. In Breakpoints view right click breakpoint build-impl.xml:41 breakpoint and invoke Enable.
    2. Invoke Debug > Continue from main menu.
    • EXPECTED RESULT: Debugger will stop execution at line 41. Line 41 will be highlighted with a green color and red square with green arrow will replace "41" line number identifier in the Editor gutter.
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