TS 74 Ant

NetBeans Ant Test Specification

Author: Jaromir Uhrik, Adam Senk, Matej Bukovsky
Last update: 15.07.2013
Introduction: This document is intended to be a test specification for NetBeans ant module. It can be used when the manual testing of NetBeans Ant module is executed. Scenarios in this documents cover main areas of the module functionality testing.

Contents


Test suite: Target display

Purpose:
Setup: Create new j2se project and go to Files view

  1. Description
    1. Open build.xml Ant script and expand it's node
    • EXPECTED RESULT: All targets with containing 'description' attribute must have badged icon File:badgeico.png (except internal targets; those starting with '-').
  2. Default target
    1. Open build.xml Ant script and expand it's node
    • EXPECTED RESULT: Default target 'default' must be shown in bold face. Context menu on the build.xml must list 'default' target as first.
  3. Internal target
    1. Open build.xml Ant script and expand it's node.
    • EXPECTED RESULT: All targets starting with '-' must be shown in grey and they cannot be executed (see issue 212700).
  4. Imported Target
    1. Open build.xml Ant script and expand it's node
    • EXPECTED RESULT: All targets that are declared in imported build script must be shown in italics.
  5. Overridden target
    1. Open build.xml Ant script and expand it's node
    2. Double click target 'clean'
    3. Copy target 'clean' from build-impl.xml to clipboard by Ctrl+C
    4. Paste by Ctrl+V the clipboard content to the build.xml prior to project ending tag (</project>)
    • EXPECTED RESULT: Overridden target must be displayed in regular font.

Test suite: Target Context Menu

Purpose:
Setup:Use project from last test spec.

  1. Open Script
    1. Select Open in context menu of ant build script
    • EXPECTED RESULT: Script must be opened in editor.
  2. Open Target
    1. Select Open action in context menu of Ant target
    • EXPECTED RESULT: Script must be opened in editor and caret must be placed on the beginning element of the target.
  3. Internal target
    1. Invoke context menu of internal Ant target
    • EXPECTED RESULT: Only Open and Properties are available. You cannot Run internal targets. (see issue 212700)

Test suite: Run Target

Purpose:
Setup: Use project from last test spec.

  1. Run Target
    1. Invoke action Run Target on any type of target (default, regular, imported, overridden, with description)
    • EXPECTED RESULT: All targets must be successfully executed and each target prints some identifying message into Output Window.First line in output is the closest equivalent command line.(e.g. "ant -f /home/tester/NetBeansProjects/Ant72/nbproject/build-impl.xml clean" for target "clean")
  1. Debug Target
    1. Invoke action Debug Target (from context menu) on any type of target (default, regular, imported, overridden, with description)
    • EXPECTED RESULT: Debuger is started for all types of targets.
  1. Run Target Menu
    1. Invoke Run Target context menu on build.xml script
    • EXPECTED RESULT:Target 'default' must be listed as first, targets with description will be listed below the default one.
  1. Create target with name 'property'
    1. Write <target name="property"><echo message="TargetProperty = ${target.property}"/></target> to the build.xml prior to project ending tag (</project>)
    2. Invoke popup menu item Run target|Other targets|property
    • EXPECTED RESULT: The result in output window is following
      property:
      TargetProperty = ${target.property}
      BUILD SUCCESSFUL (total time: 0 seconds).
  1. Run Target - Advanced
    1. Invoke Run Target | Advanced on build.xml
    2. Select 'property' target in the combo box
    3. Enter property 'target.property=ahoj', click Run
    • EXPECTED RESULT: Target must be executed and the output window must contain the following text
      property:
      TargetProperty = ahoj
      BUILD SUCCESSFUL (total time: 0 seconds).
  1. Run Target - Advanced, Verbosity level
    1. Invoke Run Target | Advanced on build.xml
    2. Select any target and change Verbosity level to Debug, click Run
    • EXPECTED RESULT: Target must be successfully executed and debugging info must be printed to Output Window.
  1. Run Target - Other Targets
    1. Invoke Run Target | Other Targets on build1.xml
    2. Select any target there
    • EXPECTED RESULT: Target must be successfully executed. There must be only targets without description attribute on the submenu Other Targets.

Test suite: Shortcuts

Purpose:
Setup: Use project from last test spec.

  1. Create Shortcut
    1. Select target 'default' in build.xml script
    2. Invoke Create Shortcut action in context menu of the target
    3. Check all four checkboxes, Click Next
    4. Select some menu, enter name of the action, click Next
    5. Select Toolbar and enter another name of the action, click Next
    6. Select unused shortcut (e.g. Ctrl+Alt+Shift+U), click Next
    7. Click Finish
    • EXPECTED RESULT: Verify that actions were added to the menu and toolbar and that shortcut executes the target as well.


Test suite: Actions coverage

Purpose: To cover actions calling that are related to Ant (Run Target, Debug Target, Repeat Build/Run, Stop Build/Run)
Setup: Create new j2se project named PRJ_1 and create new JFrame Form in this project with name JFrame_1

  1. Stop Build/Run
    1. Select JFrame_1 in the Projects view.
    2. Invoke popup menu and push Run File (try Shift+F6 too).
    3. In main menu select Run|Stop Build/Run: PRJ_1(run-single).
    • EXPECTED RESULT: The process with JFrame_1 finishes, the JFrame_1 is closed. The menu item gets disabled.Try the same with corresponding icon in output.
  2. Repeat Build/Run
    1. Invoke popup menu and push Run File (try Shift+F6 too).
    2. In main menu select Run|Repeat Build/Run: PRJ_1(run-single).
    • EXPECTED RESULT: The JFrame_1 form must appear. Close the JFrame_1 form. Try the same with corresponding icon in output.
  3. Test Run Target submenu
    1. Select build.xml belonging to the PRJ_1 in the Files View and invoke popup menu.
    2. Select Run Target and invoke each of its subitems including subitems of Other Targets.
    • EXPECTED RESULT: Proper target must be executed and the corresponding output must be printed to output window.
  4. Test Debug Target submenu
    1. Select build.xml belonging to the PRJ_1 in the Files View and invoke popup menu.
    2. Select Debug Target and invoke each of its subitems including subitems of Other Targets.
    • EXPECTED RESULT: Proper target must start in debugger and corresponding output must be printed to output window.
  5. Test Options from output tab
    1. Have output tab whith the result of some ant build action
    2. Click Options icon
    • EXPECTED RESULT: Options are opened on Ant's settings.


Test suite: Ant Options

Purpose: To cover testing of general options related to Ant
Setup: Run IDE with clear userdir and go to Tools|Options (or NetBeans|Preferences on Mac)

  1. Ant options position
    1. Go to Tools|Options and select Java
    • EXPECTED RESULT: The first tab should be named "Ant" and it is selected.
  2. Ant version
    1. Go to Tools|Options and select Java
    • EXPECTED RESULT: Check the default ant version. It should be version 1.9

File:Default_Ant_Version_NB74.jpg

  1. Change ant home
    1. Push Browse... button and select some older version of Ant.
    • EXPECTED RESULT: The older ant version path appears in ant home textfield. This ant version is used then for invoking project targets in IDE. The text below the textfield contains information about Ant version and the compilation date.
  2. Set default ant home
    1. Push default button.
    • EXPECTED RESULT: The default path appears again in ant home textfield. This ant version is used then for invoking project targets in IDE. The text below the textfield contains information about Ant version and the compilation date.
  3. Verbosity level set up
    1. Create new j2se project PRJ_001.
    2. In ant options set the verbosity level and run the project (try this with all verbosity level possibilities - normal, quiet, verbose, dubug).
    • EXPECTED RESULT: The output window contains proper text according to selected verbosity level.
  4. Saving files test
    1. Set Verbosity Level to "Normal".
    2. Deselect all checkboxes below the Ant Home textfield.
    3. Write some "System.out.println("saved");" to the main method of opened Main class of PRJ_001.
    4. Run project by F6->The file is not saved ("saved" is not printed in output window).
    5. Set the Checkbox "Save All Modified Files Before Running Ant" selected again and push F6
    • EXPECTED RESULT: The Main file is saved first and then executed ("saved" is printed in output window).
  5. Test of tab reuse
    1. Push F6 -> A new tab is added to output window
    2. In Options dialog set checkbox "Reuse Output Tabs from Finished Processes" selected
    3. Close options
    4. Run default project by F6
    • EXPECTED RESULT: A new tab is not added to output window, tabs disappear from the output window and only one open window is available.
  6. Always show output
    1. In Ant options set checkbox "Always Show Output" selected
    2. Go to Editor - select it by Ctrl+0
    3. Push Shift+Escape to maximize editor
    4. Push Shift-F11-> output window appears (always hide it by Escape)
    5. In Ant Options set checkbox unselect checkbox "Always Show Output"
    6. Close options
    7. Push Shift-F11
    • EXPECTED RESULT: Output window doesn't pop up.
  7. Create target test
    1. Create new j2se project PRJ_XYZ
    2. Open Files view and open the build.xml
    3. Type "<target name="xyz"><echo message="xyz = ${xyz.property}"/></target>"
    4. Execute target xyz (Run target|Other Targets|xyz)
    • EXPECTED RESULT: Output window contains
      xyz:
      xyz = ${xyz.property}
      BUILD SUCCESSFUL (total time: 0 seconds).
  8. Properties test
    1. Go to ant options and write to properties text area the following line:
      xyz.property=yep!
    2. Execute target xyz (Run target|Other Targets|xyz)
    • EXPECTED RESULT: Output window contains
      xyz:
      xyz = yep!
      BUILD SUCCESSFUL (total time: 0 seconds).
  9. Ant version in manifest
    1. Create new j2se project PRJ_ONE and build it with default ant
    2. Check "Ant-Version" property in Files view dist/PRJ_ONE.jar/META-INF/MANIFEST.MF
    3. In ToolS|Options|Miscellaneous|Ant try to change the Ant Home to some non default
    4. Build the project PRJ_ONE
    5. Check "Ant-Version" property in Files view dist/PRJ_ONE.jar/META-INF/MANIFEST.MF
    • EXPECTED RESULT: In the MANIFEST.MF there must be written Ant-Version properly according to the current Ant Home setup.


Test suite: Code completion

Purpose: Covers code completiton feature in Ant module.
Setup:Use project from last test spec.

  1. Code completion
    1. Select Open in context menu of ant build script.
    2. Try to write new target:
    3. Type:"<tar"
    4. Some possibilities are offered. Select target.
    5. Code is completed as: "<target"
    6. Type: '>'
    7. "</target>" end tag is offered. Select it.
    8. Try to write some more tags and some attributes into them.
    • EXPECTED RESULT: Code Completion works correctly.
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