STS 70 Maven

Test Specification: Maven Support Test Specification

Author: Jaroslav Pospisil
Version: 7.24
Introduction: This document serves mostly as a test specification for Maven specific functionality in Netbeans IDE - it should cover all most important features of Maven functionality,however this test specification can't cover all scenarios with Maven,and it should be tested by specific components responsible engineers along with Ant scenarios.
Setup: To create and build Maven project, just use the Maven 3.x bundled with the IDE. Also, for J2EE projects, test in all cases both JavaEE5 and JavaEE6 projects.

Contents


Test suite: Maven projects

Purpose: Test creating different project archetypes
Setup: Test all J2EE project types for both JavaEE5 and JavaEE6.

  1. Create Quickstart archetype
    1. Go to main menu File > New Project
    2. In New Project wizard select Maven > Maven Project and push Next
    3. Select Maven Quickstart Archetype and push Next
    4. Type QuickstartPrj to the Project Name field and push Finish
    • EXPECTED RESULT:
      The project is created, the output contains message about "BUILD SUCCESSFUL".
  2. Create Web Application
    1. Go to main menu File | New Project
    2. In New Project wizard select Maven > Maven Web Application and push Next
    3. Type WebAppPrj to the Project Name field and push Finish
    • EXPECTED RESULT:
      The project is created, the output contains message about "BUILD SUCCESSFUL".
  3. Create EJB Module
    1. Go to main menu File > New Project
    2. In New Project wizard select Maven > Maven EJB Module and push Next
    3. Type EJBModPrj to the Project Name field and push Finish
    • EXPECTED RESULT:
      The project is created, the output contains message about "BUILD SUCCESSFUL".
  4. Create Enterprise Application
    1. Go to main menu File > New Project
    2. In New Project wizard select Maven > Maven Enterprise Application and push Next
    3. Type EntAppPrj to the Project Name field and push Next
    4. Push Finish
    • EXPECTED RESULT:
      Four projects are created (ear,ejb,pom and war), the output contains message about "BUILD SUCCESSFUL".There's missing dependencies warning icon in Projects tab. Do build with dependencies and this will disappear.
  5. Create NetBeans Module archetype
    1. Go to main menu File | New Project
    2. In New Project wizard select Maven > Maven Project and push Next
    3. Select Maven NetBeans Module Archetype and push Next
    4. Type NBModulePrj to the Project Name field and push Finish
    • EXPECTED RESULT:
      The project is created, the output contains message about "BUILD SUCCESSFUL".There's missing dependencies warning icon in Projects tab. Do build and this will disappear.
  6. Create NetBeans Platform Application archetype
    1. Go to main menu File | New Project
    2. In New Project wizard select Maven > Maven Project and push Next
    3. Select Maven NetBeans Platform Application Archetype and push Next
    4. Type NBAppPrj to the Project Name field and push Finish
    • EXPECTED RESULT:
      Both projects "NBAppPrj - NetBeans Platform Application (pom)" and "NBAppPrj - sample NetBeans Module (nbm)" are created, the output contains message about "BUILD SUCCESSFUL".There's missing dependencies warning icon in Projects tab. Do build with dependencies and this will disappear.


Test suite: Clean, Build, Run, Debug maven project

Purpose: Test basic operation on the maven specific projects

  1. Clean project
    1. Invoke popup menu on QuickstartPrj
    2. Select Clean action
    • EXPECTED RESULT:
      In Files view there is missing "target" folder now .
  1. Build project
    1. Invoke popup menu on QuickstartPrj
    2. Select Build action
    • EXPECTED RESULT:
      In Files view there appears "target" folder - contains QuickstartPrj-1.0-SNAPSHOT.jar file.
  1. Run project
    1. Invoke popup menu on QuickstartPrj
    2. Select Run action
    3. IDE asks for selecting main class for execution - push Select Main Class button to select offered one
    • EXPECTED RESULT:
      Project is executed - "Hello World!" string is printed in output .
  1. Debug project
    1. Set up breakpoint in main method's the only body line
    2. Type some other System.out.println on the next line
    3. Invoke popup menu on QuickstartPrj
    4. Select Debug action
    • EXPECTED RESULT:
      Debugger stops at the breakpoint and then continues when pushing F7. Finally there are printed proper lines in output .


Test suite: Run, Debug, Profile, Test single file

Purpose: Test basic operations on single files in the maven specific projects

  1. Run file
    1. Invoke popup menu on WebAppPrj
    2. Select New > Servlet and enter name and package (MavenPrjServlet, org.mavenprj)
    3. Click Finish
    4. Select Run action on MavenPrjServlet
    5. Confirm Servlet Execution URI by clicking OK
    6. Select Glassfish v3 server in next window and click OK
    • EXPECTED RESULT:
      Project is deployed and servlet displayed in browser .
  2. Debug file
    1. Select Debug action on MavenPrjServlet
    • EXPECTED RESULT:
      Project is deployed in debug mode,Debugger window opened in IDE and servlet displayed in browser .
  3. Profile file
    1. Go to Profile menu and select Advanced Commands > Run Profiler Calibration.
    2. After it's finished,click on OK.
    3. Select Profile action on MavenPrjServlet
    4. Click on Run button.
    • EXPECTED RESULT:
      Project is deployed in Profile mode,Profiler window opened in IDE and servlet displayed in browser .
  4. Test file
    1. Select Test action on MavenPrjServlet
    2. Create new JUnit test for MavenPrjServlet (New > JUnit > Test For Existing Class , browse for MavenPrjServlet) and invoke Test action on it.
    • EXPECTED RESULT:
      In case of servlet, no tests are executed. In case of JUnit test in fails, since we didn't entered any paramaters.

Test suite: Project properties

Purpose: Test properties of maven project

  1. Test General properties
    1. Select project properties for QuickstartPrj (by calling Properties from popup on project node)
    2. Select General
    3. Set up each of the field and check that these values are changed properly in pom.xml
    • EXPECTED RESULT:
      The pom.xml of the project synchronizes with the changes made in the project properties.
  1. Test Sources properties
    1. Select Sources node in project properties
    2. Check that the Source/Binary format is 1.3 by default
    3. Change Source/Binary format to 1.5
    • EXPECTED RESULT:
      The change is propagated in pom.xml .
  1. Test Configurations properties
    1. Select Configurations
    2. Push Add... button and set up fields "Configuration Id:" together with "Activate profiles", check "persist for others to reuse" checkbox
    3. Push OK button
    • EXPECTED RESULT:
      In Files view there is created nb-configuration.xml and contains proper values .
  1. Test Compile properties
    1. Set up "Compile On Save:" to Disable
    • EXPECTED RESULT:
      The nb-configuration.xml contains line with "<netbeans.compile.on.save>none</netbeans.compile.on.save>".
  1. Test Configurations
    1. Set up Configuration field in Run (select existing configuration)
    2. Check Configuration field in Actions and write test into Activate Profiles
    • EXPECTED RESULT:
      The file nbactions-<profilename>. xml is created at the same level as pom.xml - check it up in the Files view.
  1. Test Actions properties
    1. Select e.g 'Clean project' action in the list and change 'clean' goal and change it to 'install'
    2. Push OK button
    • EXPECTED RESULT:
      The change is written to the nbactions<profilename>.xml .
  1. Test Formatting properties
    1. Go to Formatting and select the radiobutton "Use project specific options"
    2. Set up different values for Tab Size, Right Margin and Indent spaces
    • EXPECTED RESULT:
      Values are stored in nb-configuration.xml and are used when editing pom.xml .

Test suite: Create templates in maven projects

Purpose: Test creating different templates in maven project

  1. Create package
    1. Create package in QuickstartPrj
    • EXPECTED RESULT:
      Package is created and is empty .
  1. Create JFrame form
    1. Create new JFrame form file in QuickstartPrj's newly crated package
    • EXPECTED RESULT:
      The JFrame is available and is properly generated and opened in editor window.
  1. Create XML document
    1. Create new XML Document file in QuickstartPrj's newly crated package
    2. Left everything set on default.
    • EXPECTED RESULT:
      The XML file is available and is properly generated and opened in editor window.
  1. Create new Java class
    1. Create new Java class file in QuickstartPrj's newly crated package
    • EXPECTED RESULT:
      The Java class file is available and is properly generated and opened in editor window.


Test suite: Refactoring

Purpose: Test main refactoring in maven project

  1. Rename package
    1. Rename java package created in previous test suite to sun.my.pack
    2. Select Refactor > Rename and click on Refactor.
    • EXPECTED RESULT:
      Rename succeeds, the code is compilable.
  1. Rename java class
    1. Rename java file created in previous test suite to MyClass
    2. Select Refactor > Rename and click on Refactor.
    • EXPECTED RESULT:
      The file is renamed and compilation/run works smoothly.
  1. Rename JFrame form
    1. Rename JFrame file created in previous test suite to MyFrame
    2. Select Refactor > Rename and click on Refactor.
    • EXPECTED RESULT:
      The file is renamed and compilation/run works smoothly.



Test suite: Project operations

Purpose: Test Delete, Move and Rename of Maven projects

  1. Rename project
    1. Rename WebAppPrj JEE5 Webapp (war) project to MavenWebAppPrj
    • EXPECTED RESULT:
      Rename succeeds, the project is compilable.
  1. Move project
    1. Move MavenWebAppPrj to another location
    • EXPECTED RESULT:
      The project is moved properly and compilation/run works smoothly.
  1. Delete project
    1. Delete MavenWebAppPrj
    • EXPECTED RESULT:
      The project is deleted but sources will remain.
  1. Delete project along with sources
    1. Do previous scenario with checkbox enabled
    • EXPECTED RESULT:
      The project is deleted along with its sources.



Test suite: Maven related options

Purpose: Test maven related optins

  1. Set up External Maven Home
    1. Go to Tools>Options>Miscellaneous>Maven
    2. Set up the Maven external home by Browse button
    • EXPECTED RESULT:
      The used maven version can be checked by building of a project - it is written in the output like following line:
      NetBeans: Executing '/space/maven/2.0.9/apache-maven-2.0.9/bin/mvn install'.
  2. Set up Skip Tests
    1. Go to Tools>Options>Miscellaneous>Maven
    2. Check Tests for any build executions not related to testing
    3. Build any project without tests
    • EXPECTED RESULT:
      No tests are run during project testing-check in Output tab.
  3. Set up Global Options
    1. Go to Tools>Options>Miscellaneous>Maven
    2. Find Global Execution Options and click on Add button to the right
    3. Select --debug option
    4. Build project
    • EXPECTED RESULT:
      Check Output tab,that there's more detailed output from building.
  4. Set up frequence of download
    1. Go to Tools>Options>Miscellaneous>Maven
    2. In On project Open section select First Open Only for all fields
    3. Create new Web App project
    • EXPECTED RESULT:
      There's now more actions done on project creation.
  5. Edit Custom Global Definitions
    1. Go to Tools>Options>Miscellaneous>Maven
    2. Click on Custom Global Definitions button.
    • EXPECTED RESULT:
      Goals window should open.
  6. Set up frequence of index updates
    1. Go to Tools>Options>Miscellaneous>Maven
    2. Set Index Update Frequency to On Every Startup
    3. Close IDE and reopen.
    • EXPECTED RESULT:
      Index shoud be updated on startup.Click on Index Now to invoke immediate index reload.
  7. Maven related editor hints
    1. Go to Tools>Options>Editor>Hints
    2. Set up the Language to "Apache Maven POM Files"
    3. Change the hints options - by managing this options,you can set the behaviour of editor for maven pom.xml files.
    • EXPECTED RESULT:
      Check all top-level checkboxes are set.

Test suite: Project libraries

Purpose: Test libraries in maven projects

  1. Add library
    1. Click on Libraries node in projects view and invoke popup menu
    2. Select Add Dependency
    3. Filter the library - e.g. jfreechart (if Local repository is being currently transferred, wait please until it ends)
    • EXPECTED RESULT:
      The library should be added properly to the project. Show and Resolve problems / Download Libraries,if necessary . If problem remains,resolve it manually.
  2. Show Dependency Graph
    1. Click on Libraries node in projects view and invoke popup menu (there should be at least one library under it)
    2. Select Show Dependency Graph
    • EXPECTED RESULT:
      Artifact Details / Graph is displayed in editor .
  3. Download Missing Dependencies
    1. Click on Libraries node in projects view and invoke popup menu
    2. Select Download Missing Dependencies
    • EXPECTED RESULT:
      All dependencies are checked and the missing ones downloaded - if there's any minus badge on dependency, it should disappear .
  4. Download Javadoc
    1. Click on Libraries node in projects view and invoke popup menu
    2. Select Download Javadoc
    • EXPECTED RESULT:
      All javadocs are reloaded .
  5. Download Sources
    1. Click on Libraries node in projects view and invoke popup menu
    2. Select Download Sources
    • EXPECTED RESULT:
      All sources are reloaded .
  6. Check Always Show Non-Classpath Dependencies
    1. Create new Maven Enterprise Application from template.
    2. Click on Libraries node in projects view (ear project) and invoke popup menu
    3. Select Always Show Non-Classpath Dependencies
    • EXPECTED RESULT:
      Non-classpath dependency should be displayed in the list as common one.
  7. Manually Install Artifact
    1. Click on any Library node in projects view and invoke popup menu
    2. Select Manually Install Artifact and select any library jar, you have available locally
    • EXPECTED RESULT:
      Library is added to the list . Show and Resolve problems / Download Libraries,if necessary . If problem remains,resolve it manually.
  8. Add Local Javadoc
    1. Click on any Library node in projects view and invoke popup menu
    2. Select Add Local Javadoc and select any javadoc, you have available locally
    • EXPECTED RESULT:
      javadoc is loaded .Show and Resolve problems / Download Libraries,if necessary .
  9. Remove Dependency
    1. Click on any Library node in projects view and invoke popup menu
    2. Select Remove Dependency
    • EXPECTED RESULT:
      Dependency should be removed.
  10. Exclude Dependency
    1. This option is available only for transitive dependencies
    2. Click on any Library node in projects view and invoke popup menu
    3. Select Exclude Dependency
    • EXPECTED RESULT:
      Dependency should be removed.
  11. View Artifact Details
    1. Click on any Library node in projects view and invoke popup menu
    2. Select View Artifact Details
    • EXPECTED RESULT:
      Artifact Details is opened in the editor .

Test suite: Maven repository browser

Purpose: Test Maven repository browser functionality

  1. Invoke repository browser
    1. Go to Window>Other>Maven Repository Browser
    • EXPECTED RESULT:
      The Maven Repository Browser appears and has has the proper content(Local, Central, Java.net and NetBeans repository by default).
  1. Update Indexes
    1. Push Update Indexes
    • EXPECTED RESULT:
      Repositories update.
  1. Add repository
    1. Push Add repository button
    2. Write TestingRepository for Name,TestRep for ID and select path to ~/TestRep folder (create it).
    3. Hit Add button.
    • EXPECTED RESULT:
      The repository is added.Try to add there any libraries and check it's visible in Repository Browser in IDE.
  1. Find in repository
    1. Push Find in repository button and type "jfreechart"
    • EXPECTED RESULT:
      Check that the searched tree is the same as when Adding library to a project.

Test suite: Edit pom.xml file

Purpose: Test pom.xml editor functionality

  1. Code Completion in pom.xml
    1. Invoke code completion in section <dependencies>
    2. Select <dependency> from the code completion
    • EXPECTED RESULT:
      The dependency tag is written to the editor.
  2. Code Generation in pom.xml
    1. Invoke code generation either by Alt+Insert keyboard shortcut or from context menu > Insert Code
    2. Select <dependency>
    • EXPECTED RESULT:
      Add library window is displayed.
  3. Hints in pom.xml
    1. Go to pom.xml and make selected <dependency> tag
    2. The hint indicator appears in gutter
    3. Push Alt + Enter
    4. Push Enter
    • EXPECTED RESULT:
      Move Unmanaged to Dependency Management hint causes adding <dependencyManagement> section.
  4. POM Model tab
    1. With opening of pom.xml file, POM Model tab is opened in Navigator window
    2. Select any tag in the Model window and double-click on it
    • EXPECTED RESULT:
      Corresponding tags should be marked also in the editor.
  5. POM Inheritance tab
    1. Go to the previously created Enterprise Application project and open pom.xml file from (ear)
    2. Select POM Inheritance from dropdownlist in Navigator window
    3. Select other project then current one in the list and double-click.
    • EXPECTED RESULT:
      Corresponding project's pom.xml is opened in editor.


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