TS 72 ProjectsLibraries

Projects Test Specification for Projects libraries

Author: Tomas Musil
Last update: 07.05.2012
Introduction: Test basics of project libraries and sharable libraries

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. Add dependency on JAR, associate sources and javadoc from Maven
    1. Add dependendy on JAR (choose some JAR which is expected to be also in Maven central repo)
    2. Navigate in projects view JAR file node, expand it, and try to view class file.
    3. In editor should appear button "attach sources", push it
    • EXPECTED RESULT: Sources are attached, complete source is shown in editor.
  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.
  1. Remove library
    1. Tools|Libraries
    2. Remove some library
    • EXPECTED RESULT: Library definition is removed.
  1. Remove dependency on library
    1. Remove dependency on library
    • EXPECTED RESULT: Library dependency removed, project is not compilable.
  1. Broken references
    1. Create project, add dependency on some library
    2. Remove this library from Tools|Libraries
    • EXPECTED RESULT: Project is marked with broken references. In popup on project invoke Resolve reference problem. dialog. Try to resolve by creating new library of exactly same name as removed one.


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. Libraries manager
    1. Tools|Libraries
    2. switch "global x from libraries folder" in combobox Libraries location.
    • EXPECTED RESULT: Both global libraries and libraries from libraries folder can be managed.
  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. Import global library into libraries folder
    1. Use project from previous testcase, invoke add library on libraries node.
    2. Choose Import library, select some global library
    • EXPECTED RESULT: Library JAR is copied into libraries folder. Definition is added in nblibraries.properties.
  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.
  1. Remove sharable library
    1. Create new java project with sharable libraries
    2. "Add library" on Libraries project node
    3. Create new library "NEW" and add it to the project
    4. Tools > Libraries
    5. Remove the "NEW" library
    • EXPECTED RESULT: Library is removed. Resolve dependency is available on the project. #151292



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. Edit Variable
    1. Create new variable B
    2. Invoke Edit on B
    • EXPECTED RESULT: variable B can be edited 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.




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