STS 72 Maven

(Difference between revisions)
(Created page with '==Test Specification: Maven Support Test Specification== '''Author:''' [mailto:Jaroslav.Pospisil@Sun.Com Jaroslav Pospisil] <br> '''Version:''' 7.24<br> '''Introduction:''' This …')
(Test suite: Clean, Build, Run, Debug maven project)
 
(2 intermediate revisions not shown)
Line 1: Line 1:
==Test Specification: Maven Support Test Specification==
==Test Specification: Maven Support Test Specification==
-
'''Author:''' [mailto:Jaroslav.Pospisil@Sun.Com Jaroslav Pospisil] <br>
+
'''Author:''' [mailto:musilt2@netbeans.org Tomas Musil] <br>
-
'''Version:''' 7.24<br>
+
'''Version:''' 7.26<br>
'''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. <br>   
'''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. <br>   
'''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.
'''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.
Line 10: Line 10:
Purpose: Test creating different project archetypes <br>
Purpose: Test creating different project archetypes <br>
Setup: Test all J2EE project types for both JavaEE5 and JavaEE6.<br>   
Setup: Test all J2EE project types for both JavaEE5 and JavaEE6.<br>   
-
# {{testcase|Create Quickstart archetype }}
+
# {{testcase|Create Java application }}
## Go to main menu File > New Project
## Go to main menu File > New Project
-
## In New Project wizard select Maven > Maven Project and push Next
+
## In New Project wizard select Maven
-
## Select Maven Quickstart Archetype and push Next
+
## Select Java Application and push Next
## Type QuickstartPrj to the Project Name field and push Finish
## Type QuickstartPrj to the Project Name field and push Finish
-
#* {{result|EXPECTED RESULT:<br>The project is created, the output contains message about "BUILD SUCCESSFUL".}}
+
#* {{result|EXPECTED RESULT:<br>The project is created, the output contains message about "BUILD SUCCESS".}}
# {{testcase|Create Web Application }}
# {{testcase|Create Web Application }}
## Go to main menu File | New Project
## Go to main menu File | New Project
## In New Project wizard select Maven > Maven Web Application and push Next
## In New Project wizard select Maven > Maven Web Application and push Next
## Type WebAppPrj to the Project Name field and push Finish
## Type WebAppPrj to the Project Name field and push Finish
-
#* {{result|EXPECTED RESULT:<br>The project is created, the output contains message about "BUILD SUCCESSFUL".}}
+
#* {{result|EXPECTED RESULT:<br>The project is created, the output contains message about "BUILD SUCCESS".}}
# {{testcase|Create EJB Module}}
# {{testcase|Create EJB Module}}
## Go to main menu File > New Project
## Go to main menu File > New Project
Line 31: Line 31:
## Type EntAppPrj to the Project Name field and push Next
## Type EntAppPrj to the Project Name field and push Next
## Push Finish
## Push Finish
-
#* {{result|EXPECTED RESULT:<br>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.}}     
+
#* {{result|EXPECTED RESULT:<br>Four projects are created (ear,ejb,pom and war), the output contains message about "BUILD SUCCESS".There's missing dependencies warning icon in Projects tab. Check that it can be resolved using "Show and resolve problem" action from context menu.}}     
# {{testcase|Create NetBeans Module archetype }}
# {{testcase|Create NetBeans Module archetype }}
## Go to main menu File | New Project
## Go to main menu File | New Project
Line 40: Line 40:
# {{testcase|Create NetBeans Platform Application archetype }}
# {{testcase|Create NetBeans Platform Application archetype }}
## Go to main menu File | New Project
## Go to main menu File | New Project
-
## In New Project wizard select Maven > Maven Project and push Next
+
## In New Project wizard select Maven | NetBeans Platform Application and push Next
-
## Select Maven NetBeans Platform Application Archetype and push Next
+
## Type NBAppPrj to the Project Name field, check to create sample module and push Finish
-
## Type NBAppPrj to the Project Name field and push Finish
+
#* {{result|EXPECTED RESULT:<br>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. Check that it can be resolved using "Show and resolve problem" action from context menu.}} 
-
#* {{result|EXPECTED RESULT:<br>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.}}   
+
# {{testcase|New Archetype wizard}}
 +
## Go to main menu File | New Project
 +
## In New Project wizard select Maven > Project from archetype and push Next
 +
## Type archetype name (or part) into search field (e.g. "hudson")
 +
## Select appropriate archetype and proceed with creating new project
 +
#* {{result|EXPECTED RESULT:<br>Project from archetype is succesfully created.}}   
<br>
<br>
====Test suite: Clean, Build, Run, Debug maven project====
====Test suite: Clean, Build, Run, Debug maven project====
Purpose: Test basic operation on the maven specific projects <br>
Purpose: Test basic operation on the maven specific projects <br>
-
 
# {{testcase|Clean project }}
# {{testcase|Clean project }}
## Invoke popup menu on QuickstartPrj
## Invoke popup menu on QuickstartPrj
## Select Clean action
## Select Clean action
-
#* {{result|EXPECTED RESULT:<br>In Files view there is missing "target" folder now .}}
+
#* {{result|EXPECTED RESULT:<br>In Files view there is missing "target" folder now .}}
-
 
+
# {{testcase|Build project }}
# {{testcase|Build project }}
## Invoke popup menu on QuickstartPrj
## Invoke popup menu on QuickstartPrj
## Select Build action
## Select Build action
-
#* {{result|EXPECTED RESULT:<br>In Files view there appears "target" folder - contains QuickstartPrj-1.0-SNAPSHOT.jar file.}}
+
#* {{result|EXPECTED RESULT:<br>In Files view there appears "target" folder - contains QuickstartPrj-1.0-SNAPSHOT.jar file.}}
-
 
+
# {{testcase|Run project }}
# {{testcase|Run project }}
## Invoke popup menu on QuickstartPrj
## Invoke popup menu on QuickstartPrj
## Select Run action
## Select Run action
## IDE asks for selecting main class for execution  - push Select Main Class button to select offered one
## IDE asks for selecting main class for execution  - push Select Main Class button to select offered one
-
#* {{result|EXPECTED RESULT:<br>Project is executed - "Hello World!" string is printed in output .}}
+
#* {{result|EXPECTED RESULT:<br>Project is executed - "Hello World!" string is printed in output .}}
-
 
+
# {{testcase|Debug project }}
# {{testcase|Debug project }}
## Set up breakpoint in main method's the only body line
## Set up breakpoint in main method's the only body line
Line 70: Line 71:
## Invoke popup menu on QuickstartPrj
## Invoke popup menu on QuickstartPrj
## Select Debug action
## Select Debug action
-
#* {{result|EXPECTED RESULT:<br>Debugger stops at the breakpoint and then continues when pushing F7. Finally there are printed proper lines in output .}}
+
#* {{result|EXPECTED RESULT:<br>Debugger stops at the breakpoint and then continues when pushing F8. Finally there are printed proper lines in output .}}
-
 
+
-
 
+
====Test suite: Run, Debug, Profile, Test single file====
====Test suite: Run, Debug, Profile, Test single file====
Line 101: Line 100:
====Test suite: Project properties====
====Test suite: Project properties====
Purpose: Test properties of maven project <br>
Purpose: Test properties of maven project <br>
-
 
# {{testcase|Test General properties }}
# {{testcase|Test General properties }}
## Select project properties for QuickstartPrj (by calling Properties from popup on project node)
## Select project properties for QuickstartPrj (by calling Properties from popup on project node)
Line 107: Line 105:
## Set up each of the field and check that these values are changed properly in pom.xml
## Set up each of the field and check that these values are changed properly in pom.xml
#* {{result|EXPECTED RESULT:<br>The pom.xml of the project synchronizes with the changes made in the project properties.}}   
#* {{result|EXPECTED RESULT:<br>The pom.xml of the project synchronizes with the changes made in the project properties.}}   
-
 
+
# {{testcase|Test Compile on Save for app execution}}
-
# {{testcase|Test Sources properties }}
+
## By default, CoS should be "For application execution only"
-
## Select Sources node in project properties
+
## Test by running (multiple times) Maven project containing class with main method.
-
## Check that the Source/Binary format is 1.3 by default
+
#* {{result|EXPECTED RESULT:<br>Code is run directly, without Maven.}}   
-
## Change Source/Binary format to 1.5
+
-
#* {{result|EXPECTED RESULT:<br>The change is propagated in pom.xml .}} 
+
-
 
+
-
# {{testcase|Test Configurations properties }}
+
-
## Select Configurations
+
-
## Push Add... button and set up fields "Configuration Id:" together with "Activate profiles", check "persist for others to reuse" checkbox
+
-
## Push OK button
+
-
#* {{result|EXPECTED RESULT:<br>In Files view there is created nb-configuration.xml and contains proper values .}} 
+
-
 
+
-
# {{testcase|Test Compile properties }}
+
-
## Set up "Compile On Save:" to Disable
+
-
#* {{result|EXPECTED RESULT:<br>The nb-configuration.xml contains line with "<netbeans.compile.on.save>none</netbeans.compile.on.save>".}} 
+
-
 
+
-
# {{testcase|Test Configurations }}
+
-
## Set up Configuration field in Run (select existing configuration)
+
-
## Check Configuration field in Actions and write test into Activate Profiles
+
-
#* {{result|EXPECTED RESULT:<br>The file nbactions-<profilename>. xml is created at the same level as pom.xml - check it up in the Files view.}} 
+
-
 
+
-
# {{testcase|Test Actions properties }}
+
-
## Select e.g 'Clean project' action in the list and change 'clean'  goal and change it to 'install'
+
-
## Push OK button
+
-
#* {{result|EXPECTED RESULT:<br>The change is written to the nbactions<profilename>.xml .}}   
+
-
 
+
-
# {{testcase|Test Formatting properties }}
+
-
## Go to Formatting and select the radiobutton "Use project specific options"
+
-
## Set up different values for Tab Size, Right Margin and Indent spaces
+
-
#* {{result|EXPECTED RESULT:<br>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 <br>
 
-
 
-
# {{testcase|Create package }}
 
-
## Create package in QuickstartPrj
 
-
#* {{result|EXPECTED RESULT:<br>Package is created and is empty .}} 
 
-
 
 
-
# {{testcase|Create JFrame form }}
 
-
## Create new JFrame form file in QuickstartPrj's newly crated package
 
-
#* {{result|EXPECTED RESULT:<br>The JFrame is available and is properly generated and opened in editor window.}} 
 
-
 
 
-
# {{testcase|Create XML document}}
 
-
## Create new XML Document file in QuickstartPrj's newly crated package
 
-
## Left everything set on default.
 
-
#* {{result|EXPECTED RESULT:<br>The XML file is available and is properly generated and opened in editor window.}} 
 
-
 
 
-
# {{testcase|Create new Java class }}
 
-
## Create new Java class file in QuickstartPrj's newly crated package
 
-
#* {{result|EXPECTED RESULT:<br>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 <br>
 
-
 
-
# {{testcase|Rename package }}
 
-
## Rename java package created in previous test suite to sun.my.pack
 
-
## Select Refactor > Rename and click on Refactor.
 
-
#* {{result|EXPECTED RESULT:<br>Rename succeeds, the code is compilable.}} 
 
-
 
 
-
# {{testcase|Rename java class}}
 
-
## Rename java file created in previous test suite to MyClass
 
-
## Select Refactor > Rename and click on Refactor.
 
-
#* {{result|EXPECTED RESULT:<br>The file is renamed and compilation/run works smoothly.}} 
 
-
 
 
-
# {{testcase|Rename JFrame form}}
 
-
## Rename JFrame file created in previous test suite to MyFrame
 
-
## Select Refactor > Rename and click on Refactor.
 
-
#* {{result|EXPECTED RESULT:<br>The file is renamed and compilation/run works smoothly.}} 
 
-
 
 
-
   
 
-
 
-
 
-
====Test suite: Project operations====
 
-
Purpose: Test Delete, Move and Rename of Maven projects <br>
 
-
 
-
# {{testcase|Rename project }}
 
-
## Rename '''WebAppPrj JEE5 Webapp (war)''' project to '''MavenWebAppPrj'''
 
-
#* {{result|EXPECTED RESULT:<br>Rename succeeds, the project is compilable.}} 
 
-
 
 
-
# {{testcase|Move project}}
 
-
## Move '''MavenWebAppPrj''' to another location
 
-
#* {{result|EXPECTED RESULT:<br>The project is moved properly and compilation/run works smoothly.}} 
 
-
 
 
-
# {{testcase|Delete project}}
 
-
## Delete '''MavenWebAppPrj'''
 
-
#* {{result|EXPECTED RESULT:<br>The project is deleted but sources will remain.}} 
 
-
 
 
-
# {{testcase|Delete project along with sources}}
 
-
## Do previous scenario with checkbox enabled
 
-
#* {{result|EXPECTED RESULT:<br>The project is deleted along with its sources.}} 
 
          
          
Line 207: Line 117:
Purpose: Test maven related optins  <br>
Purpose: Test maven related optins  <br>
-
# {{testcase|Set up External Maven Home }}
 
-
## Go to Tools>Options>Miscellaneous>Maven
 
-
## Set up the Maven external home by Browse button
 
-
#* {{result|EXPECTED RESULT:<br>The used maven version can be checked by building of a project - it is written in the output like following line:<br>NetBeans: Executing '/space/maven/2.0.9/apache-maven-2.0.9/bin/mvn install'.}} 
 
# {{testcase|Set up Skip Tests}}
# {{testcase|Set up Skip Tests}}
## Go to Tools>Options>Miscellaneous>Maven
## Go to Tools>Options>Miscellaneous>Maven
Line 222: Line 128:
## Build project
## Build project
#* {{result|EXPECTED RESULT:<br>Check Output tab,that there's more detailed output from building.}}  
#* {{result|EXPECTED RESULT:<br>Check Output tab,that there's more detailed output from building.}}  
-
# {{testcase|Set up frequence of download}}
 
-
## Go to Tools>Options>Miscellaneous>Maven
 
-
## In On project Open section select First Open Only for all fields
 
-
## Create new Web App project
 
-
#* {{result|EXPECTED RESULT:<br>There's now more actions done on project creation.}} 
 
-
# {{testcase|Edit Custom Global Definitions}}
 
-
## Go to Tools>Options>Miscellaneous>Maven
 
-
## Click on Custom Global Definitions button.
 
-
#* {{result|EXPECTED RESULT:<br>Goals window should open.}} 
 
-
# {{testcase|Set up frequence of index updates}}
 
-
## Go to Tools>Options>Miscellaneous>Maven
 
-
## Set Index Update Frequency to On Every Startup
 
-
## Close IDE and reopen.
 
-
#* {{result|EXPECTED RESULT:<br>Index shoud be updated on startup.Click on Index Now to invoke immediate index reload.}}     
 
-
# {{testcase|Maven related editor hints }}
 
-
## Go to Tools>Options>Editor>Hints
 
-
## Set up the Language to "Apache Maven POM Files"
 
-
## Change the hints options - by managing this options,you can set the behaviour of editor for maven pom.xml files.
 
-
#* {{result|EXPECTED RESULT:<br>Check all top-level checkboxes are set.}}
 
-
 
====Test suite: Project libraries====
====Test suite: Project libraries====
Purpose: Test libraries in maven projects <br>
Purpose: Test libraries in maven projects <br>
# {{testcase|Add library }}
# {{testcase|Add library }}
-
## Click on Libraries node in projects view and invoke popup menu
+
## Click on Dependencies node in projects view and invoke popup menu
## Select Add Dependency
## Select Add Dependency
-
## Filter the library - e.g. jfreechart (if Local repository is being currently transferred, wait please until it ends)
+
## Filter the library - e.g. jfreechart (if central repository index is being currently transferred, wait please until it ends)
#* {{result|EXPECTED RESULT:<br>The library should be added properly to the project. Show and Resolve problems / Download Libraries,if necessary . If problem remains,resolve it manually.  
#* {{result|EXPECTED RESULT:<br>The library should be added properly to the project. Show and Resolve problems / Download Libraries,if necessary . If problem remains,resolve it manually.  
-
# {{testcase|Show Dependency Graph }}
 
-
## Click on Libraries node in projects view and invoke popup menu (there should be at least one library under it)
 
-
## Select Show Dependency Graph
 
-
#* {{result|EXPECTED RESULT:<br>Artifact Details / Graph is displayed in editor .  }}   
 
-
# {{testcase|Download Missing Dependencies }}
 
-
## Click on Libraries node in projects view and invoke popup menu
 
-
## Select Download Missing Dependencies
 
-
#* {{result|EXPECTED RESULT:<br>All dependencies are checked and the missing ones downloaded - if there's any minus badge on dependency, it should disappear . }}   
 
-
# {{testcase|Download Javadoc }}
 
-
## Click on Libraries node in projects view and invoke popup menu
 
-
## Select Download Javadoc
 
-
#* {{result|EXPECTED RESULT:<br>All javadocs are reloaded .}} 
 
-
# {{testcase|Download Sources }}
 
-
## Click on Libraries node in projects view and invoke popup menu
 
-
## Select Download Sources
 
-
#* {{result|EXPECTED RESULT:<br>All sources are reloaded .}} 
 
-
# {{testcase|Check Always Show Non-Classpath Dependencies }}
 
-
## Create new '''Maven Enterprise Application''' from template.
 
-
## Click on Libraries node in projects view (ear project) and invoke popup menu
 
-
## Select Always Show Non-Classpath Dependencies
 
-
#* {{result|EXPECTED RESULT:<br>Non-classpath dependency should be displayed in the list as common one.}} 
 
-
# {{testcase|Manually Install Artifact }}
 
-
## Click on any Library node in projects view and invoke popup menu
 
-
## Select Manually Install Artifact and select any library jar, you have available locally
 
-
#* {{result|EXPECTED RESULT:<br>Library is added to the list . Show and Resolve problems / Download Libraries,if necessary . If problem remains,resolve it manually. }} 
 
-
# {{testcase|Add Local Javadoc }}
 
-
## Click on any Library node in projects view and invoke popup menu
 
-
## Select Add Local Javadoc and select any javadoc, you have available locally
 
-
#* {{result|EXPECTED RESULT:<br>javadoc is loaded .Show and Resolve problems / Download Libraries,if necessary .}}     
 
# {{testcase|Remove Dependency }}
# {{testcase|Remove Dependency }}
## Click on any Library node in projects view and invoke popup menu  
## Click on any Library node in projects view and invoke popup menu  
## Select Remove Dependency
## Select Remove Dependency
-
#* {{result|EXPECTED RESULT:<br>Dependency should be removed. }}   
 
-
# {{testcase|Exclude Dependency }}
 
-
## This option is available only for transitive dependencies
 
-
## Click on any Library node in projects view and invoke popup menu
 
-
## Select Exclude Dependency
 
#* {{result|EXPECTED RESULT:<br>Dependency should be removed. }}     
#* {{result|EXPECTED RESULT:<br>Dependency should be removed. }}     
# {{testcase|View Artifact Details }}
# {{testcase|View Artifact Details }}
Line 297: Line 149:
====Test suite: Maven repository browser====
====Test suite: Maven repository browser====
Purpose: Test Maven repository browser functionality <br>
Purpose: Test Maven repository browser functionality <br>
-
 
# {{testcase|Invoke repository browser }}
# {{testcase|Invoke repository browser }}
-
## Go to Window>Other>Maven Repository Browser
+
## Start IDE with fresh userdir
-
#* {{result|EXPECTED RESULT:<br>The Maven Repository Browser appears and has has the proper content(Local, Central, Java.net and NetBeans repository by default).}}
+
## Go to Services window, expand Maven Repositories node
-
 
+
#* {{result|EXPECTED RESULT:<br>The Maven Repository Browser node and has only local repo).}}
-
# {{testcase|Update Indexes }}
+
# {{testcase|Repository browser with remote repo }}
-
## Push Update Indexes
+
## Create new Maven java project
-
#* {{result|EXPECTED RESULT:<br>Repositories update.}}   
+
## Go to Services window, expand Maven Repositories node
-
 
+
#* {{result|EXPECTED RESULT:<br>The Maven Repository Browser appears and has local repo as well as central repo registered).}}
 +
# {{testcase|Update Indexes on local/remore repo }}
 +
## Invoke Update Index on repo node popup
 +
#* {{result|EXPECTED RESULT:<br>Index gets updated.}}   
# {{testcase|Add repository }}
# {{testcase|Add repository }}
-
## Push Add repository button
+
## Invoke Add repository from popup on Maven repositories node
## Write TestingRepository for Name,TestRep for ID and select path to ~/TestRep folder (create it).
## Write TestingRepository for Name,TestRep for ID and select path to ~/TestRep folder (create it).
## Hit Add button.
## Hit Add button.
#* {{result|EXPECTED RESULT:<br>The repository is added.Try to add there any libraries and check it's visible in Repository Browser in IDE.}}   
#* {{result|EXPECTED RESULT:<br>The repository is added.Try to add there any libraries and check it's visible in Repository Browser in IDE.}}   
-
 
 
# {{testcase|Find in repository }}
# {{testcase|Find in repository }}
-
## Push Find in repository button and type "jfreechart"
+
## Invoke Find from popup on Maven repositories node, type "jfreechart"
#* {{result|EXPECTED RESULT:<br>Check that the searched tree is the same as when Adding library to a project.}}
#* {{result|EXPECTED RESULT:<br>Check that the searched tree is the same as when Adding library to a project.}}
 +
# {{testcase|Artifact details }}
 +
##  Doubleclick on some artifact from Cental repository (e.g. jfree.jfreechart v 1.0.13)
 +
#* {{result|EXPECTED RESULT:<br>Details of artifact are displayed in editor area, POM can be viewed.}}
 +
# {{testcase|Download artifact }}
 +
##  Invoke Download action from popup on some artifact node from central repo
 +
#* {{result|EXPECTED RESULT:<br>Artifact is downloaded into local repo.}}
 +
# {{testcase|Download sources/javadoc }}
 +
##  Find some artifact in central repo that has javadoc and sources available, download it
 +
## From it's popup invoke Download Javadoc (Download Sources)
 +
#* {{result|EXPECTED RESULT:<br>Javadoc and sources can be downloaded.}}
====Test suite: Edit pom.xml file====
====Test suite: Edit pom.xml file====
Purpose: Test pom.xml editor functionality <br>
Purpose: Test pom.xml editor functionality <br>
-
 
+
# {{testcase|Dependency graph}}
 +
## Select "Graph" tab in editor multiview of opened POM file
 +
#* {{result|EXPECTED RESULT:<br>Dependency graph is displayed. }}
# {{testcase|Code Completion in pom.xml }}
# {{testcase|Code Completion in pom.xml }}
 +
## Switch to source tab
## Invoke code completion in section <dependencies>
## Invoke code completion in section <dependencies>
## Select <dependency> from the code completion
## Select <dependency> from the code completion
Line 326: Line 192:
## Invoke code generation either by Alt+Insert keyboard shortcut or from context menu > Insert Code
## Invoke code generation either by Alt+Insert keyboard shortcut or from context menu > Insert Code
## Select <dependency>  
## Select <dependency>  
-
#* {{result|EXPECTED RESULT:<br>Add library window is displayed.}}
+
#* {{result|EXPECTED RESULT:<br>Add library window is displayed.}}  
# {{testcase|Hints in pom.xml }}
# {{testcase|Hints in pom.xml }}
## Go to pom.xml and make selected <dependency> tag
## Go to pom.xml and make selected <dependency> tag
Line 342: Line 208:
## Select other project then current one in the list and double-click.  
## Select other project then current one in the list and double-click.  
#* {{result|EXPECTED RESULT:<br>Corresponding project's '''pom.xml''' is opened in editor.}}     
#* {{result|EXPECTED RESULT:<br>Corresponding project's '''pom.xml''' is opened in editor.}}     
-
 
+
# {{testcase| Code completion based on index of local repo}}
 +
## Start IDE with empty userdir
 +
## Open some simple j2se maven project
 +
## If Netbeans start downloading index of central repo, cancel it
 +
## Open pom.xml
 +
## Put carret inside <version> tag of JUnit dependency and invoke code completion
 +
#* {{result|EXPECTED RESULT:<br> Only JUnit version that are present in local repository should be offered in code completion. Check content of your local repo in Maven repository browser window. }}
 +
# {{testcase| Hyperlinks in POM}}
 +
## Open POM file that contains hyperlink (e.g. you can use pom.xml in webapp project) 
 +
## Navigate to some hyperlink, CTRL+click it
 +
#* {{result|EXPECTED RESULT:<br> You can jump to definition by CTRL+clicking on hyperlink. Otherwise you are shown in baloon popup value if you dot not perform click }}
-
 
+
====Test suite: Functional tests====
-
}}
+
Purpose: Test scenarios for Maven usage <br>
 +
Setup: Test all J2EE project types for both JavaEE5 and JavaEE6.<br> 
 +
# {{testcase| Two depending Java applications }}
 +
## Create new Maven java application project (m1)
 +
## Build it to install JAR into local repo
 +
## Create another new Maven java application project (m2)
 +
## Build it to install JAR into local repo
 +
## Add to dependencies in (m2) dependency on (m1)
 +
## Open predefined App.java in (m2) and try to use in code predefined App.java from (m1)
 +
## Check also that Go to source works and opens App.java from (m1)
 +
#* {{result|EXPECTED RESULT:<br> Class from (m2) can be used and Go to source works. ".}}
 +
# {{testcase| Find usages in local repo }}
 +
## Build again (m2)
 +
## Close (m2)
 +
## Invoke Find usagas on App.java in (m1)
 +
#* {{result|EXPECTED RESULT:<br> Find usagas should find reference from (m2) jar in local repo.}}
 +
# {{testcase| Classes from another testroot }}
 +
## In (m1) create new empty JUnit test
 +
## Create manually in (m1) <tt>target</tt> folder subfolders <tt>target/generated-test-sources/foo</tt> and move there generated JUnit class from step 1.
 +
## Build (m1)
 +
## Invoke Test on (m1)
 +
#* {{result|EXPECTED RESULT:<br> Also all JUnit test from <tt>target/target/generated-test-sources</tt> should be executed as well as test from standard testroot.}}
 +
# {{testcase| Build installers for NB application }}
 +
## Create new Maven NetBeans Platform application project (Nbapp)
 +
## Clean and build (on Nbapp-app)
 +
## Switch to deployment profile
 +
## Clean and build; installers are generated
 +
#* {{result|EXPECTED RESULT:<br> Installers are generated in deployment profile; all work fine. ".}}

Current revision as of 14:29, 25 September 2012

Test Specification: Maven Support Test Specification

Author: Tomas Musil
Version: 7.26
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 Java application
    1. Go to main menu File > New Project
    2. In New Project wizard select Maven
    3. Select Java Application 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 SUCCESS".
  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 SUCCESS".
  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 SUCCESS".There's missing dependencies warning icon in Projects tab. Check that it can be resolved using "Show and resolve problem" action from context menu.
  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 | NetBeans Platform Application and push Next
    3. Type NBAppPrj to the Project Name field, check to create sample module 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. Check that it can be resolved using "Show and resolve problem" action from context menu.
  7. New Archetype wizard
    1. Go to main menu File | New Project
    2. In New Project wizard select Maven > Project from archetype and push Next
    3. Type archetype name (or part) into search field (e.g. "hudson")
    4. Select appropriate archetype and proceed with creating new project
    • EXPECTED RESULT:
      Project from archetype is succesfully created.


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 .
  2. 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.
  3. 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 .
  4. 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 F8. 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.
  2. Test Compile on Save for app execution
    1. By default, CoS should be "For application execution only"
    2. Test by running (multiple times) Maven project containing class with main method.
    • EXPECTED RESULT:
      Code is run directly, without Maven.



Test suite: Maven related options

Purpose: Test maven related optins

  1. 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.
  2. 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.

Test suite: Project libraries

Purpose: Test libraries in maven projects

  1. Add library
    1. Click on Dependencies node in projects view and invoke popup menu
    2. Select Add Dependency
    3. Filter the library - e.g. jfreechart (if central repository index 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. 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.
  3. 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. Start IDE with fresh userdir
    2. Go to Services window, expand Maven Repositories node
    • EXPECTED RESULT:
      The Maven Repository Browser node and has only local repo).
  2. Repository browser with remote repo
    1. Create new Maven java project
    2. Go to Services window, expand Maven Repositories node
    • EXPECTED RESULT:
      The Maven Repository Browser appears and has local repo as well as central repo registered).
  3. Update Indexes on local/remore repo
    1. Invoke Update Index on repo node popup
    • EXPECTED RESULT:
      Index gets updated.
  4. Add repository
    1. Invoke Add repository from popup on Maven repositories node
    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.
  5. Find in repository
    1. Invoke Find from popup on Maven repositories node, type "jfreechart"
    • EXPECTED RESULT:
      Check that the searched tree is the same as when Adding library to a project.
  6. Artifact details
    1. Doubleclick on some artifact from Cental repository (e.g. jfree.jfreechart v 1.0.13)
    • EXPECTED RESULT:
      Details of artifact are displayed in editor area, POM can be viewed.
  7. Download artifact
    1. Invoke Download action from popup on some artifact node from central repo
    • EXPECTED RESULT:
      Artifact is downloaded into local repo.
  8. Download sources/javadoc
    1. Find some artifact in central repo that has javadoc and sources available, download it
    2. From it's popup invoke Download Javadoc (Download Sources)
    • EXPECTED RESULT:
      Javadoc and sources can be downloaded.

Test suite: Edit pom.xml file

Purpose: Test pom.xml editor functionality

  1. Dependency graph
    1. Select "Graph" tab in editor multiview of opened POM file
    • EXPECTED RESULT:
      Dependency graph is displayed.
  2. Code Completion in pom.xml
    1. Switch to source tab
    2. Invoke code completion in section <dependencies>
    3. Select <dependency> from the code completion
    • {{result|EXPECTED RESULT:
      The dependency tag is written to the editor.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. Code completion based on index of local repo
    1. Start IDE with empty userdir
    2. Open some simple j2se maven project
    3. If Netbeans start downloading index of central repo, cancel it
    4. Open pom.xml
    5. Put carret inside <version> tag of JUnit dependency and invoke code completion
    • EXPECTED RESULT:
      Only JUnit version that are present in local repository should be offered in code completion. Check content of your local repo in Maven repository browser window.
  8. Hyperlinks in POM
    1. Open POM file that contains hyperlink (e.g. you can use pom.xml in webapp project)
    2. Navigate to some hyperlink, CTRL+click it
    • EXPECTED RESULT:
      You can jump to definition by CTRL+clicking on hyperlink. Otherwise you are shown in baloon popup value if you dot not perform click

Test suite: Functional tests

Purpose: Test scenarios for Maven usage
Setup: Test all J2EE project types for both JavaEE5 and JavaEE6.

  1. Two depending Java applications
    1. Create new Maven java application project (m1)
    2. Build it to install JAR into local repo
    3. Create another new Maven java application project (m2)
    4. Build it to install JAR into local repo
    5. Add to dependencies in (m2) dependency on (m1)
    6. Open predefined App.java in (m2) and try to use in code predefined App.java from (m1)
    7. Check also that Go to source works and opens App.java from (m1)
    • EXPECTED RESULT:
      Class from (m2) can be used and Go to source works. ".
  2. Find usages in local repo
    1. Build again (m2)
    2. Close (m2)
    3. Invoke Find usagas on App.java in (m1)
    • EXPECTED RESULT:
      Find usagas should find reference from (m2) jar in local repo.
  3. Classes from another testroot
    1. In (m1) create new empty JUnit test
    2. Create manually in (m1) target folder subfolders target/generated-test-sources/foo and move there generated JUnit class from step 1.
    3. Build (m1)
    4. Invoke Test on (m1)
    • EXPECTED RESULT:
      Also all JUnit test from target/target/generated-test-sources should be executed as well as test from standard testroot.
  4. Build installers for NB application
    1. Create new Maven NetBeans Platform application project (Nbapp)
    2. Clean and build (on Nbapp-app)
    3. Switch to deployment profile
    4. Clean and build; installers are generated
    • EXPECTED RESULT:
      Installers are generated in deployment profile; all work fine. ".
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