TS 70 Projects Sanity

Projects Sanity Test Specification

Author: Tomas Musil
Last update: 02.12.2008
Introduction: Test basics of projects

Contents


Test suite: Project Libraries

Purpose: Tests project libraries
Setup: Start with fresh userdir.

  1. Add dependency on project
    1. Create new project A
    2. Create new project B
    3. Set in project A dependency on B (via Libraries panel of project properties, or by popup on Libraries node)
    4. Use some class from B in A, build project A
    • EXPECTED RESULT: Project is built,no compilation error, B is added to classpath of A.
  1. Remove dependency on project
    1. Remove dependency on B
    • EXPECTED RESULT: B dependency removed, project A is not compilable.
  1. Add dependency on JAR
    1. Create new project A
    2. Set in project A dependency on some external JAR file, (via Libraries panel of project properties, or by popup on Libraries node)
    3. Use some class from your JAR in A, build project A
    • EXPECTED RESULT: Project is built,no compilation error, JAR is added to classpath of A.
  1. Add sources and javadoc for dependant JAR
    1. On libraries panel of project properties, Edit your JAR dependendency - add javadoc + sources
    • EXPECTED RESULT: Show Javadoc and Navigate
  1. Remove dependency on JAR
    1. Remove dependency on JAR
    • EXPECTED RESULT: JAR dependency removed, project is not compilable.
  1. Create new library
    1. Tools|Libraries
    2. Add new library, use e.g. JFreechart, add JARs, sources and javadoc
    3. Create project
    4. Add dependency on this library, use some classes from library
    • EXPECTED RESULT: Project is compilable, library JARs are on classpath, associated sources and javadoc work.


Test suite: Sharable Libraries

Purpose: Tests sharable libraries
Setup: Start with fresh userdir.

  1. Making project sharable
    1. Create new project A, create some library, add dependency on this library, use some library class in your project
    2. In project properties, libraries tab, hit Browse for Libraries location.
    3. Go through the wizard, confirm copying resources to libraries folder
    • EXPECTED RESULT: Project can be built,no compilation error, all necessary libraries were imported.


  1. New project with libraries folder
    1. Create new project, check "Use dedicated folder for storing libraries"
    • EXPECTED RESULT: Project is created, is buildable. All operation with libraries on project are now tied to libraries in folder.
  1. Create new library for project
    1. Use project from previous testcase, invoke add library on libraries node.
    2. Create new library - choose library JAR (sources, javadoc) - try all three types of reference: absolute, relative and copy to libraries folder
    • EXPECTED RESULT: Library is added as dependency. Check that $LIB_FOLDER/nblibraries.properties contains appropriate library definition (absolute, relative, copy to lib.location). Check that classes from library can be used, and that associated javadoc/sources work.
  1. Add new JAR
    1. Use project from previous testcase, invoke add JAR/Folder on libraries node.
    2. Browse for some JAR, - try all three types of reference: absolute, relative and copy to libraries folder
    • EXPECTED RESULT: JAR is added as dependency. Check nbproject/project.properies that dependencies were added according to reference type.
  1. Edit JAR dependency
    1. In project customizer, libraries panel, invoke edit on JAR dependency
    2. Specify javadoc and sources for JAR
    • EXPECTED RESULT: Javadoc and sources are associated to JAR dependency. Check that it works.



Test suite: Variables

Purpose: Variables as path definition
Setup: Start with fresh userdir, invoke Tools|Variables.

  1. Add new Variable
    1. Add new variable A pointing at folder with some JAR
    • EXPECTED RESULT: variable A added OK
  1. Remove Variable
    1. Remove variable B
    • EXPECTED RESULT: variable B removed OK
  1. Variable usage
    1. Create new j2se project
    2. Add dependency on some JAR, reference it by variable A
    3. Use some code from JAR in project src
    • EXPECTED RESULT: Project can be compiled, referencing JAR using variable works.



Test suite: Java Project

Purpose: Tests creation of java project.
Setup: Start with fresh userdir.

  1. New J2SE Application (default settings)
    1. Invoke File | New Project...
    2. Select Java category and Java Application project type
    3. Enter project name
    4. Check that Project Folder field shows correct project folder location
    5. Leave other checkboxes with default values
    6. Finish wizard
    • EXPECTED RESULT: New Project must be created and Main.java must be selected in Projects view and opened in editor. Check project "Main Class" in Project Properties (in Run node panel) and that project is set as main project (name is bold in Projects view). Execute following project actions: Build Project. Run Project and Clean & Build from project context menu.


Test suite: Java Class library

Purpose: Tests creation of java class library project.
Setup: Start with fresh userdir.

  1. New Java class Library
    1. Invoke File | New Project...
    2. Select Java category and Java Class Library project type, click Next
    3. Enter project name and browse to project folder location
    4. Click Finish
    • {{result|EXPECTED RESULT: New project must be created, nothing is selected in Projects view (just root node of project) and nothing is opened in Editor.


Test suite: Java project with existing sources

Purpose: Tests creation of Java project with existing sources.
Setup: Start with fresh userdir. Prepare some source roots and test roots.Use e.g. JFreeChart


  1. New Java Project with existing sources
    1. Invoke File | New Project...
    2. Panel 1:Select Java category and Java Project with Existing Sources project type, click Next
    3. Panel 2:Enter Project Name and select Project Location folder. Leave other default settings, click Next
    4. Panel 3:Add sourceroot (use sources folder unzipped from jfreechart) and testroot (use test folder unzipped from jfreechart)
    5. Panel 4:Set up includes and excludes; check that includes/excludes are changing according to what you type. Leave default include all.
    6. Finish wizard.
    7. Error badging is shown, to fix this, set dependency on servlet.jar and jcommon-1.X.X.jar (can be found at lib folder of unzipped jfreechart) as a JAR files under Libraries node.
    • EXPECTED RESULT: Project is created and no error badging is shown. Project can be built.


Test suite: Java freeform project

Purpose: Tests creation of Java freeform project.
Setup: Start with fresh userdir. Prepare some source roots, test roots and corresponding ant build script. Use e.g. JFreeChart

  1. New Java freeform project
    1. Invoke File | New Project...
    2. Panel 1:Select Java category and Java freeform project project type, click Next
    3. Panel 2:Enter location (folder with unzipped jfreechart)
    4. Panel 2:Enter build script(sub folder ant of unzipped jfreechart)
    5. Panel 2:Check project name and project location,click Next
    6. Panel 3:Check that ant targets are matching with actions ,click Next
    7. Panel 4:Add sourceroot (use sources folder unzipped from jfreechart) and testroot (use test folder unzipped from jfreechart)
    8. Panel 4:Set up includes and excludes; check that includes/excludes are changing according to what you type. Exclude *.html.
    9. Panel 5:Set up classpath for source and testroot. (sourceroot needs servlet.jar and jcommon-1.X.X.jar, testroot needs servlet.jar, jcommon-1.X.X.jar, Jfreechart-X.jar, junit.jar)
    10. Finish wizard.
    • EXPECTED RESULT: Project is created and no error badging is shown.
  1. Invoking actions
    1. Invoke Build on freeform project
    2. Invoke Clean and Build on freeform project
    3. Invoke Test on freeform project
    • EXPECTED RESULT: Actions are calling matching target.


Test suite: Main Menu project concept

Purpose: Actions can be tied to main project, or to project which is in context.
Setup:

  1. Choosing main project
    1. Create two projects
    • EXPECTED RESULT: In Run
  1. Actions for main project
    1. Have two projects with main classes,set one of them as main project
    2. Invoke Run (F6) while focus is in each Main class. (Try this also for Build, Clean and Build, Debug)
    • EXPECTED RESULT: In both cases, main class of main project is ran
  1. Actions for non-main project
    1. Have two projects with main classes,none of them is main
    2. Invoke Run (F6) while focus is in each Main class. (Try this also for Build, Clean and Build, Debug)
    • EXPECTED RESULT: Run action is now context sensitive - which main class is ran depends now on context.


Test suite: Project actions

Purpose: Tests actions on project.
Setup: Start with fresh userdir. Create some sample project e.g. Anagrams game. Turn off compile on save feature in project properties!

  1. Project icon
    1. Look at the project icon in project view
    • EXPECTED RESULT: The project icon is different for project with compile on save feature OFF and ON.
  1. Build project
    1. Invoke Build on project
    • EXPECTED RESULT: Project is built, check JAR file in dist folder and *.class files in build folder .
  1. Clean and build project
    1. Invoke Clean and Build on project
    • EXPECTED RESULT: Project is cleaned and built, check JAR file in dist folder and *.class files in build folder.
  1. Clean project
    1. Invoke Clean on project
    • EXPECTED RESULT: Project is cleaned dist and build folders are deleted.
  1. Run project
    1. Invoke Run on project
    • EXPECTED RESULT: Project is ran.
  1. Debug project
    1. Put breakpoint into some source file
    2. Invoke Debug on project
    • EXPECTED RESULT: Project is ran in debug mode, debugger stops at breakpoint.
  1. Test project
    1. Invoke Test on project
    • EXPECTED RESULT: Tests of project are launched, output window with test results is opened.


  1. Rename project with project folder
    1. Invoke Rename on project
    2. Check to rename also project folder
    • EXPECTED RESULT: Both project display name and project folder are changed.
  1. Move project
    1. Invoke Move on project
    2. Select target location
    • EXPECTED RESULT: Project is successfully moved.
  1. Copy project
    1. Invoke Copy on project
    2. Select target location and project name
    • EXPECTED RESULT: Project is successfully copied to target location with new name.
  1. Delete project
    1. Invoke Delete on project
    2. Do not check to delete also soources
    • EXPECTED RESULT: Project is deleted, but under project folder remained sourceroot and testroot.
  1. Delete project with sources
    1. Invoke Delete on project
    2. Check to delete also sources
    • EXPECTED RESULT: Project folder is deleted with its content.


Test suite: Actions of files

Purpose: Tests other project related actions on files.
Setup: Create sample Anagram game project. Turn off compile on save feature in project properties!

  1. Run single file
    1. Select executable Java file under Project node (e.g. Anagrams.java)
    2. Invoke action Run File in its context menu
    • EXPECTED RESULT: Selected Java file must be successfully executed
  1. Debug single file
    1. Select executable Java file under Project node (e.g. Anagrams.java)
    2. Set breakpoint somewhere in reachable code in opened file
    3. Invoke action Debug File in its context menu
    • EXPECTED RESULT: Selected Java file must be successfully debugged
  1. Test single file
    1. Select Java file that has test - e.g. WordLibrary.java)
    2. Invoke action Run -> Test File
    • EXPECTED RESULT: Test for selected file must be executed (no matter result)



Test suite: Project properties

Purpose: Tests project properties panesl
Setup: Start with fresh userdir. Create some sample project e.g. Anagrams game

  1. Add sourceroot
    1. Add some sourceroot to project (folder with packages/classes)
    • EXPECTED RESULT: New node appears under project node, when you build project, JAR must contain classes from both sourceroots.
  1. Add new JDK platform
    1. Invoke Java platform manager by Manage platforms button in project properties
    2. Add new platform - browse for JDK folder
    3. Associate sources with platform (eventually add javadoc for JDK)
    4. Select newly added JDK in combobox, build project.
    • EXPECTED RESULT: Project is built by this JDK. Check that also Navigate
  1. Build projects on classpath
    1. Create project A, project B
    2. Add dependency A depens on B
    3. Use some class of B in sources of A
    4. Uncheck Build projects on classpath
    5. Clean both projects
    6. Build A -> compilation should fail
    7. Check Build projects on classpath
    8. Build A
    • EXPECTED RESULT: Compilation should succeed now.
  1. New configuration
    1. Create new configuration
    2. Change parameters (e.g. choose another main class, change the arguments, work dir,..)
    3. Run project
    • EXPECTED RESULT: Project is ran in your configuration
  1. Change configuration
    1. Check that configuration can be switched/customized from configuration combobox in toolbar
    2. Run project
    • EXPECTED RESULT: Project is ran in configuration that is selected in toolbar
  1. Delete configuration
    1. Delete configuation
    • EXPECTED RESULT: Configuration disappears from combobox in toolbar
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