TS 71 APISupport Ant ProjectOperations

Test Specification for Ant-based NetBeans Suite and Module Projects Operations

Updated by: Hermien Pellissier
Original Author: Petr Zajac
Last update: 29 June 2012
Version: NetBeans 7.1
Introduction: This test specification covers the actions available for Ant-based NetBeans platform suite and module projects.

Contents


Test suite: Operations on Ant-based Module Projects

Purpose: Verifying that the actions available for Ant-based Module Projects work correctly. All tests in this suite are intended to be executed sequentially.
Setup: No setup is required.

  1. Create a new standalone module
    1. From the File menu choose New Project...
    2. Choose the NetBeans Modules category and pick the Module project.
    3. Click Next.
    4. On the name and location page, choose a convenient location for the new module. Type in a Project name.
    5. Make sure that Standalone Module is selected.
    6. Click Next.
    7. Specify a valid code name base, e.g. org.myorg.
    8. Click Finish.
    • EXPECTED RESULT: The new module appears in the Projects view. This module will be used for the remainder of this test suite and will simply be referred to as "the standalone module".
  2. Build
    1. In Files view, inspect the standalone module's folder. Note that the folder called build should be absent.
    2. In the Projects view, right-click on the standalone module and choose Build.
    3. Switch to the Files view again and inspect the standalone module's folder.
    • EXPECTED RESULT: A new folder called build should have been created, containing folders such as classes and cluster.
  3. Clean
    1. In the Projects view, right-click on the standalone module and choose Clean.
    2. Switch to the Files view again and inspect the standalone module's folder.
    • EXPECTED RESULT: The build folder that was created in the previous test has now been deleted.
  4. Clean and Build
    1. In the Projects view, right-click on the standalone module and choose Clean and Build.
    2. Inspect the title of the output window.
    • EXPECTED RESULT: The title of the output window should indicate that the clean and netbeans ant targets were called.
  5. Creating a New Window
    1. In the Projects view, right-click on the standalone project and choose New > Other...
    2. Select the Module Development category and choose the Window file type.
    3. Click Next.
    4. Ensure that the Open on Application Start option is checked.
    5. Click Next.
    6. Enter a valid Class Name Prefix and make sure that the package is org.myorg.
    7. Click Finish.
    • EXPECTED RESULT: A new TopComponent subclass is created in the package org.myorg.
  6. Generate Javadoc - No Public Packages
    1. In the projects view, right-click on the standalone module and choose Generate Javadoc.
    • EXPECTED RESULT: A warning is displayed indicating that the javadoc generation cannot be performed since there are no public packages in the module.
  7. Generate Javadoc - Setting the Public Packages
    1. On the warning dialog displayed in the previous test, click the Configure Public Packages... button.
    • EXPECTED RESULT: The project properties dialog is displayed with the API Versioning page selected.
  8. Generating Javadoc - Public Package Set
    1. In the Public Packages list, check the org.myorg package.
    2. Click OK.
    3. Right-click on the standalone module and choose Generate Javadoc.
    • EXPECTED RESULT: The javadoc files are generated in the build/javadoc folder and is displayed in the default web browser.
  9. Run Standalone Module
    1. Right-click on the standalone module and choose Run.
    • EXPECTED RESULT: The module is started in the selected platform. Check that the module appears in the plugin manager (Tools > Plugins), on the Installed tab under the Uncategorized category.
  10. Reload Standalone Module
    1. Leave the platform application running, and switch back to the IDE.
    2. In the Projects view, right-click on the standalone module and choose Properties.
    3. Choose the Display category.
    4. Change the Display Category property to TestCategory.
    5. Click OK.
    6. Right-click on the standalone module and choose Reload in Target Platform.
    7. Wait for the ant task to complete, and switch back to the still running platform application.
    • EXPECTED RESULT: The module is reloaded and now appears under the TestCategory category in the plugin manager (Tools > Plugins).
  11. Create NBM
    1. Right-click on the standalone module and choose Create NBM.
    2. Inspect the module in the Files view.
    • EXPECTED RESULT: The NBM file is created in the build folder.

Test suite: Debugging Ant-based Module Projects

Purpose: Verifying that the debugging actions available for Ant-based Module Projects work correctly. All tests in this suite are intended to be executed sequentially, following on the previous test suite.
Setup: The module created in the previous test suite will be reused here. Download the source code of the specific version of the platform that is used for this test suite. The platform only source package will be sufficient - there is no need to download the full IDE source code. Extract the source code and associate the folder with the platform (Tools > NetBeans Platforms > Sources tab).

  1. Debug Standalone Module
    1. In the projects view, right-click on the standalone module and choose Debug.
    • EXPECTED RESULT: The NetBeans platform application with the module is started in debug mode. The Debugger Console should be visible in the Output window.
  2. Stop on Breakpoint
    1. Close the platform application.
    2. Open the TopComponent class that was generated by the Window wizard earlier in this test specification.
    3. From the palette, add a button to the window.
    4. Double click on the button and add the following to the default event: javax.swing.JOptionPane.showMessageDialog(this, "Hello");
    5. Put a breakpoint on the first line of the constructor, which should contain "initComponents();" (click in left margin or press Ctrl+F8 to toggle).
    6. In the projects view, right-click on the standalone module and choose Debug.
    • EXPECTED RESULT: The platform application should be started in debug mode, and execution should pause at the inserted breakpoint.
  3. Step Into
    1. Click the Step Into button on the main toolbar or press F7.
    • EXPECTED RESULT: The first line in the initComponents() method should now be the current point of execution.
  4. Step Over
    1. Click the Step Over button on the main toolbar or press F8.
    • EXPECTED RESULT: The second line in the initComponents() method should now be the current point of execution.
  5. Step Out
    1. Click the Step Out button on the main toolbar or press Ctrl+F7.
    • EXPECTED RESULT: The current point of execution should now be the second line of code in the constructor.
  6. Watch
    1. Open the variables window (Window > Debugging > Variables to open if it is not visible).
    2. Add a new watch: getName()
    3. Step over the next line which should contain a call to setName().
    • EXPECTED RESULT: The value of the watch should change to the name of the window as picked in the creation wizard.
  7. Step into Platform Source Code
    1. Note: for this test case, the platform source needs to be set up as described in the setup procedure above.
    2. The next line of code should contain a call to setTooltipText(). Click the Step Into button on the toolbar or press F7.
    3. Click on the highlighted setTooltipText.
    • EXPECTED RESULT: The class org.openide.windows.TopComponent should be displayed in the IDE and the setTooltipText() method should be the current point of execution.
  8. Reload Module
    1. Continue execution by clicking on the Continue button on the main toolbar or by pressing F5.
    2. In the platform application, click the button that was added to the TopComponent earlier and verify that the message is displayed as expected. Click OK.
    3. Switch to the IDE and remove the breakpoint from the constructor.
    4. In the TopComponent source code, navigate to the ActionPerformed event of the button.
    5. Change the text displayed by the message dialog.
    6. Save the changes.
    7. In the projects view, right-click on the standalone module and choose Reload in Target Platform.
    8. Wait for the ant target execution to complete.
    9. In the platform application, click the button again.
    • EXPECTED RESULT: The changed message should be displayed, indicating that the module was successfully reloaded.
  9. Apply Code Changes
    1. Click OK on the message dialog if you haven't done so already.
    2. Switch to the IDE and change the message text yet again.
    3. From the Debug menu, choose Apply Code Changes.
    4. In the platform application, click the button again.
    5. Note the displayed message and quit the application.
    • EXPECTED RESULT: The TopComponent class should be automatically saved in the IDE. The changed message should be displayed by the application, indicating that the changes were successfully applied.

Test suite: Unit Testing Ant-based Module Projects

Purpose: Verifying that the unit testing actions available for Ant-based Module Projects work correctly. All tests in this suite are intended to be executed sequentially.
Setup: Ensure that JUnit is installed before continuing with the test suite. The standalone module created in a previous test suite will be reused here.

  1. Create Unit Test
    1. In the projects view, right-click on the TopComponent class and choose Tools > Create JUnit Tests.
    2. If prompted to select between JUnit 3 or 4, choose JUnit 4 and click Select.
    3. On the Create Tests dialog, make sure that the public method access level is checked and click OK.
    • EXPECTED RESULT: A test class is generated and opened in the editor.
  2. Run Unit Test
    1. In the projects view, right-click on the standalone module and choose Test.
    • EXPECTED RESULT: The unit tests should be executed and the results displayed.
  3. Debug Unit Test
    1. In the projects view, navigate to the generated unit test class.
    2. Add a breakpoint to one of the tests in the test class.
    3. In the projects view, right-click on the unit test class and choose Debug Test File.
    • EXPECTED RESULT: The unit test should be started in debug mode, and execution should pause at the break point.

Test suite: Operations on XML Layer

Purpose: Verifying that the actions available for the layer files in Ant-based Module Projects work correctly. All tests in this suite are intended to be executed sequentially.
Setup: No special steps are required to configure the IDE. The standalone module created earlier will be reused once more.

  1. Creating a Layer File
    1. In the projects view, right-click on the org.myorg package in the standalone module, and choose New > Other...
    2. Select the Module Development category and XML Layer file type.
    3. Click Next.
    4. Click Finish.
    • EXPECTED RESULT: The layer.xml file is created in the package. The node XML Layer should also appear under the Important Files node of the project.
  2. Open Layer File Action
    1. In the Projects view, right-click on the XML Layer node and choose Open.
    • EXPECTED RESULT: The almost empty layer.xml file is opened in editor.

Test suite: Operations on Module Suites

Purpose: Verifying that the actions available for Ant-based Module Suite Projects work correctly. All tests in this suite are intended to be executed sequentially.
Setup: This test suite does not follow on the test suites before it. Create a new NetBeans platform application (referred to as "the suite" in the following text) and add at least two new modules to it. Note the location of the suite - this information will be used later.

  1. Build All
    1. In the projects view, right-click on the suite and choose Build All.
    2. Inspect the suite's folder in the Files view.
    • EXPECTED RESULT: All modules in the suite are built. The modules' jars are created in the build/cluster/modules folder.
  2. Run
    1. In the projects view, right-click on the suite and choose Run.
    2. The NetBeans platform application should start up.
    3. In the application, choose Help > About from the main menu.
    • EXPECTED RESULT: The suite was executed. The user directory that appears on the About box is the build/testuserdir folder inside the suite's folder (location noted during setup).
  3. Debug
    1. In the projects view, right-click on the suite and choose Debug.
    2. The NetBeans platform application should start up.
    3. In the application, choose Help > About from the main menu.
    • EXPECTED RESULT: The suite was executed in debug mode (Debugger Console visible in Output window). The user directory that appears on the About box is the build/testuserdir folder inside the suite's folder (location noted during setup).
  4. Build NBMS
    1. In the projects view, right-click on the suite and choose Package As > NBMs.
    2. Inspect the suite in the Files view.
    • EXPECTED RESULT: The NBMs for all the modules are built to the build/updates folder.
  5. Build Installers
    1. In the projects view, right-click on the suite and choose Package As > Installers.
    2. Inspect the suite in the Files view.
    • EXPECTED RESULT: An installer is created in the dist folder.
  6. Viewing Modules in the Suite
    1. In the projects view, expand the modules node of the suite project.
    • EXPECTED RESULT: The modules created during the setup procedure are shown in the list of current modules.
  7. Adding a Module to the Suite
    1. In the projects view, right-click on the Modules node of the suite project and choose Add New...
    2. Follow the steps of the wizard (see TS_70_Appisupport_Sanity (Test_suite:_Module_Project_Wizard) for more information if needed).
    • EXPECTED RESULT: The new module is added to the Modules node in Projects view.
  8. Removing a Module from the Suite
    1. In the projects view, under the Modules node, right click on one of the modules.
    2. Choose Remove.
    • EXPECTED RESULT: The module is removed from the Modules node in Projects view.
  9. Opening a Module
    1. Pick one of the modules in the suite, and make sure that it is not currently open in the IDE (i.e. not visible in the Projects view as a separate project).
    2. Right-click on that project under the Modules node of the suite, and choose Open Project.
    • EXPECTED RESULT: The module project should be opened and should appear in the Projects view.
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