TS 60 Java

Java Test Specification for

Author: Jiri Prox
Version: 6.0
Last update: 2007/02/14
Introduction: This document is test specification for Java infrastructure. It covers features related to parsing, analyzing and navigation through the java source files, such as code completion, fix import, Go To type, navigator window, members view, hierarchy view and javadoc view. The project prepared for this specification is here, but any project will do for going through this document.
Comments:JavaDoc and Editor Hints are described in their own testspecifications.

Contents


Test suite: Syntax Coloring

Purpose: This suite test syntax highlighting.
Setup: Open the test project. Wait till the sources are parsed and indexed (it can took a quite long time, it the IDE was started from the fresh userdir).

  1. Class Members
    1. Open class coloring.Colors from sample project
    2. Check coloring of class members
    • EXPECTED RESULT: Image:members_TS_60_Java.png
  1. Static Members
    1. Open class coloring.Colors2 from sample project
    2. Check coloring of static members
    3. Delete static keyword
    • EXPECTED RESULT: Static members are printed in italics. The the keyword static is removed it is repainted with regular font
  1. Private Unused Members
    1. Open class coloring.ColorsPrivateUnused from sample project
    2. Check colors
    3. Replace modifier private with other modifier and put the change back
    4. Write method which uses private members
    • EXPECTED RESULT: The private unused members are gray underlined. It the member is used or changed to non-private it gets its original color (as shown in previous two testcases)
  1. Method Parameters and Variables
    1. Open class coloring.ColorsParameters from sample project
    2. Check colors
    3. Try to make unused variables and parameters used and vice versa
    • EXPECTED RESULT: Image:parameters_TS_60_Java.png
  1. Unused Imports
    1. Open class coloring.Imports from sample project
    2. Check colors
    • EXPECTED RESULT: Unused imports are gray underlined
  1. Javadoc Colors
    1. Open class coloring.JavaDoc from sample project
    2. Check colors
    • EXPECTED RESULT: Image:javadoc_TS_60_Java.png
   

Test suite: Normal Code Completion

Purpose: This test suite focus normal code completion (ctrl-space). When completing class name it provides only classes which are imported in current source file. It does not respect expected type of completed element. The code completion is context aware, it means it can provide elements of requested kind (e.g exceptions, packages, interfaces or regular classes, but does not know anything about the type!)
The items of normal code completion are listed in the lower part of code completion popup (under the line) if there are also provided items from smart code completion (see the next test suite).
The shortcut CC widely used in this document stands for Code Completion

  1. Basic Case
    1. Open class completion.Normal from sample project
    2. Inside method test try type following and invoke CC (if not popup automatically):
      1. this.
      2. list.
      3. list.
      4. Thread.
      5. threads[0].
      6. String.
    3. Try several cases by your own.
    • {{result|EXPECTED RESULT:
                   Each time the list of proposed completions is provided. It has the right context and provides only items which are suitable in current position. Check return types of generic types (2nd point in list). Watch also the static and non-static context.
 
  1. Context Aware
    1. Open class completion.NormalContextAware from sample project
    2. add import to the proper place and open CC
    3. add extends to the proper place and open CC
    4. add implements to the proper place and open CC
    5. add throws to the constructor and call CC
    6. add
              try {
      
FileReader fr = new FileReader(new File("")); } catch ( fix imports and call CC behind the last opening brackets
    1. type throw new int method body call CC
    2. Repeat steps 2-7 but before invoking completion type several letters
    • EXPECTED RESULT:

The completion result contain only classes of expected kind, if any prefix was typed all items must match this prefix. Note the CC after implements keyword can contain also regular classes if there is inner interface inside them (example: class Thread contains UncaughExceptionHandler ). At the end of the list there are provided available packages as well.

  1. Anonymous Class
    1. Create new class
    2. In constructor write following code:
       
      
new Runnable() { public void run() { } public void method() { } public int field; }.
    1. Invoke CC after the dot
    • EXPECTED RESULT:
                   Code completion contains method  run() ,  method()  and filed  field , others item are from class  Object 
                
 
  1. Method Finishing
    1. Open class completion.NormalMethods from sample project
    2. Inside testMethod type method
    3. Call CC and select one of the provided items
    • EXPECTED RESULT:
                   The CC provides 4 possible completion, after confirming one of them the text is substituted, the parameter names are copied to code (no parameters matching takes part in this situation) and the parameter tooltip is opened.
                
 
  1. Constructor Finishing
    1. Open class completion.NormalMethods from sample project
    2. Inside testMethod type new NormalMethods
    3. Call CC and select one of the provided constructor
    • EXPECTED RESULT:
                   The CC window providing 5 possible ending is opened, 4 are the for the available constructors and the last one finishes the class name (will have no effect in this situation since the whole name is already entered and there is not other class with such prefix). After selecting item corresponding to constructor it behaves as common method call finishing as shown in previous test case
                
 
  1. Creating Anonymous Class Body
    1. Create new class
    2. It it's constructor type new Comparable
    3. Call code completion and select first item
    • EXPECTED RESULT:
                   The whole class body is added. Check if  compareTo  method has one parameter of type Object.
                
 
  1. Negative Test Cases
    1. Call completion inside string literal
    2. Call completion inside double literal (e.g. 3.3)
    • EXPECTED RESULT: No suggestion is returned
  1. Switch Controled By Enum
    1. Open class completion.NormalSwitch from sample project
    2. in the switch statement type case
    3. call code completion
    • EXPECTED RESULT: CC provides only constants from enum Type
   

Test suite: Smart Code Completion

Purpose: Smart code completion return only items with has (or return) the type suitable in current position. It's invoked by shortcut Ctrl-Space and takes the upper part of code completion popup. Setup:

  1. Assign Statement
    1. Open class completion.SmartAssign from sample project
    2. Type List l = at the end of test method and call smart CC
    3. Replace last entered line with List<String> l = and call smart CC
    4. Replace last entered line with List<String> l = new and call smart CC
    • EXPECTED RESULT: In step 2 the all methods returning List and all fields, parameters and local variables of type List (and assignable types) are returned.
      In step 3 only elements of type List<String> are returned.
      In step 4 all available classes expanding List<String> are provided, if something is selected import is added if necessary
      Note: The type of variable which is being assigned to must be resolved, it means the java.util.List must be imported in this case.
  1. Return Statement
    1. open class completion.SmartReturn from sample project
    2. Replace last line of method getName with return and call smart CC
    3. Replace last line of method getName with return "". and call smart CC
    4. Replace last line of method getName with return new and call smart CC
    • EXPECTED RESULT: In step 2 all elements of type (or returning type) String are listed together with all static methods from class java.lang.String returning String
      In step 3 all methods of java.lang.String returning String are listed
      In step 4 identifier String is inserted, since it was the only possible completion in this situation (String cannot have subclasses it's final)
                
 
  1. Method Parameter
    1. open class completion.SmartParams from sample project
    2. On line 39 call smart CC for each parameter
    • EXPECTED RESULT: Only right items are suggested by CC.
  1. Catch statement
    1. Open class completion.SmartCatch from sample project
    2. Delete Exception from the catch statement and call smart CC on its place
    3. In method of throwingMethod type throw new and call smart CC
    • EXPECTED RESULT: In both cases the exceptions (and their subtypes) which can by thrown by throwingMethod are listed.

  1. Loop
    1. Open class completion.SmartLoop from sample project
    2. Inside method test type following code: for(String s :
    3. Call smart CC
    • EXPECTED RESULT: The smart CC should provide only Collection whose element type is String
  1. Smart Switch
    1. Open class completion.SmartSwitch from sample project
    2. To the switch statement type: case and call smart CC
    3. Change the control variable of switch to i
    • EXPECTED RESULT: In first case the CC returns only enum constants. In the second case it returns all int fields in actual class and static methods from java.lang.Integer returning int.
                
   

Test suite: All Symbols Code Completion

Purpose: All Symbols Code Completion returns all classes with required prefix which are available (in JDK, in current project or additional libraries), even when they are not imported. After selecting item from list an import statement is added if necessary.

            

Setup:

  1. All Classes
    1. Open any class
    2. Add several places call All Symbols CC
    • EXPECTED RESULT: Check if CC provides all available classes matching entered prefix
  1. Switching From Normal to All-Symbols
    1. Create new class
    2. Inside class type JTab and call normal code completion
    • EXPECTED RESULT: The normal CC should not find any matching item so it should be automatically switched to all symbols CC which provide 3 items. Visual difference between normal and all-symbols CC is that the normal CC has footer in the popup window displaying information about others types of completions.
   

Test suite: Keyword Code Completion

Purpose:

               The normal code completion provides also keywords which can be used in current position
            

Setup:

  1. Within Class
    1. Create new class
    2. Delete all its content except package statement
    3. Try to enter whole class with several method, field and inner classes using CC to produce all keywords (only typing identifiers and symbols like brackets and operators by hand)
    • EXPECTED RESULT: The whole class can be written using only CC to insert keywords
  1. Within Annotation
    1. Repeat previous test case, but this time create annotation type
    • EXPECTED RESULT: Annotation type can be created w/o any limitations


Test suite: Code Completion Settings

Purpose: This suite focus on customizing code completion behavior. All options mentioned in following test cases can be found in Tools | Options | Editor | General | Code Completion

            

Setup:

  1. Defaut Values
    1. Open Tools | Options | Editor | General
    2. Check default values in Code Completion section
    • EXPECTED RESULT: Image:options_TS_60_Java.png
  1. Auto Popup
    1. Uncheck Auto Popup Completion Window
    2. In any class type this.
    3. Restore the default value and repeat previous step
    • EXPECTED RESULT: The completion window is not opened when pressing '.' if the option is turned off
  1. Automatic Substitution
    1. Uncheck Insert Single Proposals Automatically
    2. In editor type StringBuffe and call normal code completion
    3. In editor type Thread.curren and call normal code completion
    4. Restore the default value and repeat previous two steps
    • EXPECTED RESULT: The CC list provide one item but does not insert it if the options if switched off. Automatic substitution for class names is always turned off.
                
 
  1. Case Sensitive
    1. Check Case Sensitive Code Completion
    2. In editor type string and call normal code completion
    3. type String and call CC
    4. Revert changes in options and repeat step 2
    • EXPECTED RESULT: In step 2 the CC should return no suggestions since there is no such class. The step 3 and step 2 after returning changes should provide String* items

 
  1. Show Deprecated Item
    1. Uncheck Show Deprecated Members in Code Completion
    2. In editor type new Thread().
    3. Return changes and repeat previous step
    • EXPECTED RESULT: If turned off no deprecated members (as susspend() or resume() ) are shown
                
 
  1. Closing Brackets
    1. Uncheck Insert Closing Brackets Automatically
    2. In constructor type
       this( 
    3. In class body type
       int[ 
    4. In class body type
       void method( 
    5. Revert changes and repeat steps 2-4
    • EXPECTED RESULT: Closing bracket in not inserted if option is turned off. The closing bracket of correct type is inserted otherwise, the cursor is located between them.
                
   

Test suite: Parameter ToolTip

Purpose: Parameter tooltip shows expected parameter (types and names) of method call. It highlights actual parameter when moving cursor within method call.

            

Setup:

  1. Method Call
    1. Open class tooltip.ParamToolTip from sample project
    2. In method test type method(|) , the '|' stands for cursor position
    3. Press Ctrl-P
    4. Type 1,1.2
    5. Complete method call by providing all required arguments
    • EXPECTED RESULT: In step 3 the parameter tooltip is shown displaying 3 possible combination of parameters. The list if filtered as typing parameters (when ',' is entered) to contain only valid rows.
  1. Constructor Call
    1. Open class tooltip.ParamToolTip from sample project
    2. In method test type new ParamToolTip(</span>

Test suite: Javadoc

Purpose:
Setup:

  1. Single Window




    1. Open any file
    2. Put caret on any identifier
    3. Invoke Javadoc window (ctrl-shift-space)
    • EXPECTED RESULT: Window providing javadoc for current identifier is opened.
  1. Combined With Proper Completion
    1. Repeat several test cases form suites focused on code completion
    • EXPECTED RESULT: Javadoc window is opened each time CC window displays. It contains right part javadoc.
  1. Setting
    1. Goto <tt> Tools

Test suite: Matching Method Call Parameters

Purpose:
Setup:

  1. Matching Name
    1. Open <tt> matching.Matching from the sample project
    2. At the last line of test method type method
    3. Finish the method call from CC
    • EXPECTED RESULT: The code is finished with following code: method(name, lastName, aux); . There are variables or fields with the same name and type for the first two parameters, so they are used. For the last parameter there are not any int named number and nearest other int is used (aux in this case)
  1. Matching Name from Supertype
    1. Open matching.Matching from the sample project
    2. At the last line of test method type setSerial
    3. Finish the method call from CC
    • EXPECTED RESULT: The CC inserts setSerial(serial); while serial (field from supertype) is of type int and is close to the name of expected parameter (int SeRiAl)
                
   

Test suite: Go To Navigation

Purpose:
Setup:

  1. Go To Source
    1. Open navigation.GoToSource from the sample project
    2. Put caret on line 30 word String and from contex menu call Navigate | Go To Source
    3. Put caret on line 30 word string and from context menu call Navigate | Go To Source
    4. Put caret on line 31 word string and from main menu call Navigate | Go To Source
    5. Put caret on line 32 word string and from main menu call Navigate | Go To Source
    6. Put caret on line 32 word charAt and press Ctrl_Shift-B
    • EXPECTED RESULT: In steps 2-5 class java.lang.Sting is opened and cursor is placed at the class header. In step 6 the cursor is placed to the method char chatAt(int)
  1. Go To Source - Missing Source
    1. Create a java class with a class for which you don't have sources opened in projects. (e.g. open editor module, functional tests with jellytools).
    2. Try to click on one of the class names for which you don't have sources opened in projects (e.g. org.netbeans.jemmy.EventTool).
    • EXPECTED RESULT: The go to class action cannot be performed. Verify the error message in status bar. The IDE should beep as well.
  
 
  1. Go To Declaration
    1. Open navigation.GoToSource from the sample project
    2. Put caret on line 30 word String and from context menu call Navigate

Test suite: Navigator Window

Purpose: Navigator window, located below the project view, displays inner structure of the selected class. It can be filtered and sored. Double click on tree list will bring cursor to the source (Go To Source function)

            

Setup:

  1. Class Structure
    1. Open navigator.ClassStructure from sample project
    2. Check content of navigator
    • EXPECTED RESULT: Image:navigator-class_TS_60_Java.png
  1. Annotation Structure
    1. Open navigator.AnnotationStructure from sample project
    2. Check content of navigator
    • EXPECTED RESULT: Image:navigator-annotation_TS_60_Java.png
  1. Enum Structure
    1. Open navigator.EnumStructure from sample project
    2. Check content of navigator
    • EXPECTED RESULT: Image:navigator-enum_TS_60_Java.png
  1. Filters
    1. Open navigator.ClassStructure from sample project
    2. Change navigator filters - use buttons and context menu
    3. Each time check context of navigator
    • EXPECTED RESULT:
    • Show Inherited Members : Shows also members from all superclasses
    • Show Fields: hides/shows fields
    • Show Static Members: hides/shows static members (methods, fields, inner classes ....)
    • Show Non Public Members: if turned off, only public members are displayed
    • Sort By Name : members are sorted by their name
    • Sort By Source : members are sorted by their position in source file (the last two filters are mutaly exclusive)
  1. Context menu
    1. Open navigator.ClassStructure from sample project
    2. Right click on navigator
    • EXPECTED RESULT: The menu contains all functionality, which can be done be filters buttons
  1. Navigation To Source
    1. Open navigator.ClassStructure from sample project
    2. Double click on any item
    • EXPECTED RESULT: Cursor is located at the declaration of selected member
  1. Navigation To Source
    1. Open navigator.ClassStructure from sample project
    2. Hover mouse over some item
    • EXPECTED RESULT: Popup with javadoc is opened. Ctrl-F1 opens javadoc view for selected item
  1. Class file
    1. Add jar to the project classpath (right click on libraries node, Add Jar/Folder and select any jar)
    2. Unfold contents of the added jar and select any .class file
    • EXPECTED RESULT: Navigator shows members of the class file
  1. Class file - Go to source
    1. Create another project with at least one class
    2. Build the project
    3. Add jar created in dist folder to the classpath of original project
    4. Unfold jar and select any .class file
    5. Double click on any item in Navigator
    • EXPECTED RESULT: Related source file should be opened in editor if available. Caret should be placed over declaration of selected member. If sources are not available, there should be displayed warning in the status bar



Test suite: Mark Occurrences

Purpose:
Setup:

  1. Show Usages
    1. Open occurrences.MarkOccurrences from the sample project
    2. Put cursor on name of variable/field/method/parameter (eg. variable on line 40, field on line 31, method on line 33, param on line 33)
    • EXPECTED RESULT: All occurrences of selected element is highlighted in editor and error stripe.
  1. Return Points
    1. Open occurrences.MarkOccurrences from the sample project
    2. Put caret on return type of method at line 33
    3. Put caret on exception in throws clause statement at line 33
    • EXPECTED RESULT: In step 2 all exit point from method are highlighted (4 occurrences). In next step only places where the selected exception is thrown are highlighted (2 occurrences).
  1. Show Usages - Class
    1. Open occurrences.MarkOccurrences from the sample project
    2. Put caret on String at line 31
    • EXPECTED RESULT: All usages of java.lang.String in current class are highlighted
  1. Options - On/Off
    1. Open options and disable Mark Occurrences Of Symbol Under Caret
    2. Go back to editor, put caret on any identifier (method name, class name, field)
    3. Enable MarkOccurrences again
    • EXPECTED RESULT: While MO (Mark Occurrences) is disabled, no occurrences are highlighted.
  1. Mark Occurrences - Types, Methods
    1. Open options and disable Types and Methods
    2. Put caret on line 33 word method or line 31 word String
    3. Enable options again
    • EXPECTED RESULT: Occurrences on lines 31,33, 40 (for class) and 31,44 (for method) are not highlighted when options are disabled
  1. Mark Occurrences - Constant, Fields, Variables
    1. Open options and disable Constants , Fields and Local Variables
    2. Put caret on line 85 word KONST ,on line 31 word field or on line 40 word variable
    3. Enable options again
    • EXPECTED RESULT: No occurrences of actual element is highlighted in step 2
  1. Mark Occurrences - Exceptions, Exit Points
    1. Open options and disable Exceptions Throwing Points
    2. Put caret on line 33 word String
    3. Put caret on line 33 word IOException
    4. Enable the option again and disable Exit Point From Method
    5. Put caret on line 33 word String
    6. Put caret on line 33 word IOException
    7. Enable the option
    • EXPECTED RESULT: In step 2) the editor highlights both exit point from method (return and throw - 4 occurrences). In step 3) occurrences of class IOException are marked (3 occurrences, watch the Keep Marks option). In step 5) all occurrences of String are highlighted (3) and in step 6) 2 places where can be thrown selected exception are marked
  1. Mark Occurrences - Implementing/Overriding methods
    1. Open options and disable Implementing Metohod and Overriding Metohod
    2. Put caret on line 29 word DefaultTableModel or Runnable
    3. Enable the options again and repeat step 2
    • EXPECTED RESULT: When cursor is located over superclass name in extends statement or over implemented interface in implements statement the methods from selected superclass/interface are highlighted. In step 2) this feature is disabled.
  1. Mark Occurrences - Label
    1. Open options and disable Targets of Break and Continue statements
    2. Put caret on words break and continue on lines 63,64 and 65
    3. Enable the option again and repeat step 2)
    • EXPECTED RESULT: When option is ON the label and closing bracket of the related loop is highlighted, e.g. when caret is placed over break on line 74, the label L1 on line 66 and } on line 82 are marked.
  1. Mark Occurrences - Keep marks
    1. Open options and disable Keep Marks
    2. Select several elements, which can be highlighted
    3. Enable the option again and repeat step 2
    • EXPECTED RESULT: When option is disabled the actual mark occurrences marks are discarded when the location of caret is changed, regardless if another highlights are created or not. When enabled, the old marks are removed only in new set of marks is created.
  1. Browsing
    1. Select element which has more occurrences (e.g class String)
    2. Press Alt-Up, Alt-Down
    • EXPECTED RESULT: The caret jumps among the marks


Test suite: Fix Imports

Purpose:
Setup:

  1. Simple Fix Import
    1. Open fiximports.FixImports from the sample project
    2. Delete all import statements
    3. Call Fix Imports (context menu or Ctrl-Shift-I)
    4. Select right classes in comboboxes and confirm
    • EXPECTED RESULT: All imports are properly added
  1. Unresolved Class
    1. Open fiximports.FixImports from the sample project
    2. Add line LoremIpsumDolorSitAmet variable;
    3. Call Fix Import
    • EXPECTED RESULT: The dialog contains <cannot be resolved>
  1. Fast Import
    1. Open fiximports.FixImports from the sample project
    2. Delete all import statements
    3. Put caret on unresolved symbol and press Alt-Shift-I
    4. Select required class from list and confirm by Enter
    • EXPECTED RESULT: Selected class is imported
  1. Fast Import - package
    1. Open fiximports.FixImports from the sample project
    2. Delete all import statements
    3. Put caret on unresolved symbol and press Alt-Shift-I
    4. Select required class from list and confirm by Alt-Enter
    • EXPECTED RESULT: Whole package is imported
  1. Fast Import - FQN
    1. Open fiximports.FixImports from the sample project
    2. Delete all import statements
    3. Put caret on unresolved symbol and press Alt-Shift-I
    4. Select required class from list and confirm by Shift-Enter
    • EXPECTED RESULT: The identifier is replaced with FQN
  1. Fix Import Hint
    1. Open fiximports.FixImports from the sample project
    2. Delete all import statements
    3. At each line with unresolved symbol use hint to add import statement
    • EXPECTED RESULT: All imports are added


Test suite: J2SE Project

Purpose: This suite describes basic project customization. It is focused mainly on changing project classpath and switching source level and java platform
Setup:

  1. Creating
    1. Go to File | New Project
    2. Select General -> JavaApplication and click Next
    3. Specify the project name and location, keep both checkboxes checked and confirm by Finish
    4. Check basic functionality - code completion, fiximports, folding, syntax coloring
    • EXPECTED RESULT: Project is created in given location. It contains class Main and is set as default. All functionality is working fine
  1. Adding Libraries
    1. Open project properties (context menu or menu file)
    2. Select Libraries and Compile tab
    3. Click Add Library and add any library
    • EXPECTED RESULT: After adding the library jars are indexed. Check function as Fix Import, Code Completion, Go To Type (if sources are present) and Smart CC are working for library classes.
  1. Adding Jars
    1. Follow steps in previous test case, but add a simple jar instead of whole library.
    • EXPECTED RESULT: Check function as Fix Import, Code Completion, Go To Type (if sources are present) and Smart CC are working for classes contained in jar.
  1. Adding Folder With Classes
    1. Follow steps in previous test case, but add a folder containing compiled classes
    • EXPECTED RESULT: Check function as Fix Import, Code Completion, Go To Type (if sources are present) and Smart CC are working.
                
 
  1. Dependency on Others Project
    1. Follow steps in previous test case, but add another NB project to the dependencies
    • EXPECTED RESULT: Check if all functionality is working. The Go To source and Javadoc should work for the classes from different project. Test checkbox Compile Project on Classpath
                
 
  1. Building
    1. Build project
    • EXPECTED RESULT: Check if all library jars are copied to dist/libs folder. They can be added as library, NB project or single jar. The folder with classes is not copied to the lib (performance purposes)
                
 
  1. Switching Platform and Source Level
    1. In project properties, Sources tab select different source level and compile.
    2. In project properties, Libraries tab select different java platform and compile project
    • EXPECTED RESULT: In the first step the build will provide jar for desired java version. Test usages of 1.5 features when source level is set to 1.4. Try running jar, compiled for 1.5 to run with JDK1.4
      In the second step the new java platform is indexed (if not used yet) and the features like CC, fiximports etc... works ok. Check range of source levels for new platform.
                
   

Test suite: Members View

Purpose:
Setup:

  1. Members of actual class
    1. Put focus in editor and press ctrl-F12
    2. Inspect opened dialog
    • EXPECTED RESULT: The dialog Members is opened. In the left part there is tree reflecting class members. In the righr there is javadoc for selected element. Image:members-view_TS_60_Java.png


  1. Members of class under cursor
    1. Put caret over Integer identifier
    2. Press ctrl-shift-F12
    • EXPECTED RESULT: The Members view shows members of class Integer
  1. Filters - Button
    1. Open Members View for class SuperClass
    2. Try functionality for each filter button in the bottom part of dialog
    3. Check persistence of filter buttons state between dialog invocation
    • EXPECTED RESULT: Each button controls displaying specific types of elements. For more info check the button tooltip. State of each button is preserved between dialog invocation.
                
 
  1. Text Filter
    1. Invoke Members View dialog
    2. Type several character in the filter textfield (upper part of dialog)
    3. Repeat steps 2) while Case Sensitive checkbox is checked
    • EXPECTED RESULT: The elements in tree are filtered to containg only matching items and the nodes corresponding to classes and interfaces
                
 
  1. Members - navigation
    1. Open Members View dialog
    2. Double click on any item
    3. Repeat step 2) for several items of different type
    • EXPECTED RESULT: The source file is opened and caret is located on declaration of selected item
   

Test suite: Hierarchy View

Purpose:
Setup:

  1. Actual class hierarchy
    1. Put focus in editor and press alt-F12
    2. Inspect opened dialog
    • EXPECTED RESULT: The dialog Hierarchy is opened. In the left part there is tree reflecting the class hierarchy. In the right there is javadoc for selected element. Image:hierarchy-view_TS_60_Java.png
  1. Hierarchy of selected class
    1. open navigation.SuperClass
    2. Put caret over identifier Integer
    3. Press alt-shift-F12
    • EXPECTED RESULT: Hierarchy dialog is opened for class java.lang.Integer
  1. Hierarchy - filter buttons
    1. Open hierarchy view for for class SuperClass
    2. Try toggedle each filter button in the lower part of the dialog
    • EXPECTED RESULT: The buttons have following functions (from left to right):
    • Show super type hierarchy - the hierarchy tree contains only superclasses and implemented interfaces. For each of them its superclass/implemented interfaces are listed as well
    • Show subtype hierarchy - all subclasses are listed, plus the superclasses of curren class.
    • Show fully qualified names - the items in tree are identified by FQNs
    • Show inner classes and interfaces - the hierarchy tree shows ale the inner classes and intefaces
    • Expand All - expands whole tree
                
 
  1. Hierarchy filter
    1. Open Hierarchy View for any class
    2. Type several letters to filter textfield (upper part of the dialog)
    3. Repeat step 2) with enabled Case sensitive checkbox
    • EXPECTED RESULT: The first matching item is selected
  1. Hierarchy - navigation
    1. Open Hierarchy View for any class
    2. Double click on item from hierarchy tree
    3. Repeat step 2) from different items
    • EXPECTED RESULT: The related source file is opened and cartet is located over declaration of selected element
                
   

Test suite: Declaration View

Purpose:
Setup:

  1. Declaration - Basic Case
    1. Open navigation.Declaration
    2. Open Declaration Window (Window | Other | Declaration View)
    3. Put caret on each identified used in this class
    • EXPECTED RESULT: The right declaration is shown for each type of element
  1. Declaration - Library
    1. Add library containig classes and sources to the project
    2. Test Declaration View on classes and others elements from the library
    • EXPECTED RESULT: Declaration window show correct code


Test suite: Javadoc View

Purpose:
Setup:

  1. JavaDoc - Basic Case
    1. Open navigation.JavaDoc
    2. Open Declaration Window (Window | Other | Declaration View)
    3. Put caret on every identifier in method test()
    • EXPECTED RESULT: Javadoc Window shows javadoc for selected element if avaiable
  1. Javadoc - Library
    1. Add library contating classes and javadoc to the project
    2. Check javadoc for elements from library
    • EXPECTED RESULT: Javadoc window show correct text


Test suite: J2SE project

Purpose:
Setup:

  1. Creating project
    1. Create new J2se project from menu (File -> New Project)
    • EXPECTED RESULT: Project is created, main class is generated. Project is compilable and all features (goto type, code completion) works fine.
  1. Adding libraries
    1. Open project properties and select node Libraries
    2. In tab "Compile" press add Library and select some class library
    • EXPECTED RESULT: Library classes are added to project classpath (check by code completion and building project). If library has assigned sources Go To Declaration works for library classes. If the library contains javadoc Javadoc Index Search work as well. (Code completion javadoc depends on sources - it generated directly from comments)
  1. Adding libraries - another way
    1. Open project properties and select node Libraries
    2. In tab "Compile" use add Jar/Folder and and Project
    • EXPECTED RESULT: Classes from jar/folder and from project's output jar are added as in previous case
  1. Adding libraries - building
    1. Build project with added several types of libraries
    • EXPECTED RESULT: Required jars are moved to dist/lib (it have to be JavaApplication not Java Library project and whole folder should not be added in Libraries tab)
  1. Removing libraries
    1. Remove libraries added in previous cases, one by one
    2. Verify project class path after each remove
    • EXPECTED RESULT: The classes from removed libraries are not in classpath any more. It can be verified in code completion and by broken build is library class is used somewhere in the project
  1. Adding source root
    1. Open project properties and select node Sources
    2. Press Add folder in Source packages folder and select some folder with java files (it must not be owned by another project)
    3. Remove the source folder again
    • EXPECTED RESULT: When root is added the java files (and other files) are visible in the project view, the java files are added to classpath (can be verified by code completion). After remove, the java files are not in classpath anymore


Test suite: FreeForm project

Purpose:
Setup:

  1. Creating freeform project
    1. Unzip attached archive
    2. File -> New Project, select Java Free form project
    3. On next page enter the path to the extracted archive in the Location textfield, the others textfields should be filled automatically
    4. On next page the 3 ant targets should be prefilled in appropriate textfields (compile, clean, test), keep the defaults
    5. On next page add 'source' subfolder to Source Package Folders and 'test' subfolder as Test Package Folder, continue on next page
    6. Add CoreLib.jar from libs subfolder to source classpath, and JUnit from the same folder to the classpath for tests
    7. Press Finish
    • EXPECTED RESULT: Project is created, there are no compilations error, project can be build


Test suite: Sample java project

Purpose:
Setup:

  1. Sample project
    1. Create all java sample project
    • EXPECTED RESULT: All projects can be created and compiled w/o any problems


Generated: Thu May 31 17:59:11 CEST 2007


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