TS 71 JavaNavigation

Java Navigation

Author:Jiri Prox
Version:7.1
Last update:2011/09/27
Introduction:

Contents

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
    7. 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).
    8. 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 | Go To Declaration
    3. Put caret on line 31 word string and press Ctrl-B
    • EXPECTED RESULT: In the firs case the class String is opened and cursor is moved to the class declaration. In the second case the cursor is moved to the line 30, where variable string is declared. Try it also with fields, parameters and inner classes.
   
  1. Go To Type - Basic Case
    1. Open Go To type dialog (Ctrl-O)
    2. Type several first letters
    3. When searching is done, browse through the list
    4. Select one item from list
    • EXPECTED RESULT: All listed classes fulfill entered criterion. When browsing through list, each item has correct value in Location field. When confirmed the desired source file is opened in editor
 
  1. Go To Type - Wildcard
    1. Open Go To Type dialog
    2. Enter criterion containing wildcards (*, ?)
    • EXPECTED RESULT: Check that all found classes match the criterion
  2. Go To Type - Case Sensitivity
    1. Open Go To Type dialog
    2. Check Case Sensitive checkbox
    3. Type few letters as searching criterion
    • EXPECTED RESULT: Check that all found classes match the criterion respecting case
  3. Go To Type - Negative Case
    1. Open Go To Type dialog
    2. Enter name of non-existing class
    • EXPECTED RESULT: Nothing is found
  4. Go To Type - Capital Letters
    1. Open Go To Type dialog
    2. Enter only capital letters from name of some class (e.g. ATM for AbstractTableModel)
    • EXPECTED RESULT: Desired classes are found
  5. Go To File - basic case
    1. Open Go To File dialog (alt-shift-O)
    2. enter some name of file
    3. use wildcards in the name
    • EXPECTED RESULT: Files matching the pattern are found, project from main project are at the beginning of the list and have different color. After confirmation, the selected file is opened
  6. Go To File - options
    1. Open Go To File dialog (alt-shift-O)
    2. try functionality of each checkbox
    • EXPECTED RESULT: Each checkbox works as expected - the names are selfexplaining
  7. Go To Super Implementation
    1. Create new class and override method toString
    2. put caret in method toString
    3. class Navigate -> Go To Super Implementation from context menu
    • EXPECTED RESULT: Cursor is moved to implementation of the current method in the superclass
  8. Go To Implementation
    1. Create 3 java classes: A, B, C. B extends A, C extends B.
    2. Each of the classes declares "a" method.
    3. Switch to "B" class and click "o" icon in gutter in the line where method "a" is declared (or popup menu - "Navigate | Go To Implementation")
    4. "Overrides/Is Overriden" popup menu is displayed with two items
    • EXPECTED RESULT: Choosing first item, the cursor is set to "a" method in "C" class, and choosing second one, the cursor is set to "a" method in "A" class. In a case of "a" method declared in "A" class, "Is Overriden" popup menu is displayed with "B", "C" classes listed


  }}

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_70_Java.png
  2. Annotation Structure
    1. Open navigator.AnnotationStructure from sample project
    2. Check content of navigator
    • EXPECTED RESULT: Image:navigator-annotation_TS_70_Java.png
  3. Enum Structure
    1. Open navigator.EnumStructure from sample project
    2. Check content of navigator
    • EXPECTED RESULT: Image:navigator-enum_TS_70_Java.png
  4. 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
  2. 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
  3. 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
  4. 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
  5. 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: Members View

Purpose:

Setup:

  1. Members of actual class
    1. Put focus in editor and press ctrl-F12
    2. Inspect opened dialog
    3. Put caret over Integer identifier
    4. Press ctrl-shift-F12
    • EXPECTED RESULT: The Members view shows members of class Integer
  2. 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
    3. open navigation.SuperClass
    4. Put caret over identifier Integer
    5. Press alt-shift-F12
    • EXPECTED RESULT: Hierarchy dialog is opened for class java.lang.Integer
  2. 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
  2. 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
  2. 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
  2. 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: Analyze Stack Window

Purpose: Analyze Stack window, If you want to quickly jump from a stack trace to the corresponding line in the editor.
Setup:

  1. Show Analyze Stack Window
    1. Invoke Window | Other | Analyze Stack from main menu.
    • EXPECTED RESULT: Analyze Stack Window is opened next to editor area
  2. Jump to line
    1. Open "coloring.Colors2" file and following code into its "main" method:
    2. Run the file (code fails with NPE)
    3. Copy NPE from "Output" tab and push "Insert StackTrace From Clipboard" button.
    4. Close the tab containing Colors2 source and double click the line where NPE was thrown.
    • EXPECTED RESULT: "Colors2" tab is opened and cursor is moved to the line where NPE is thrown.
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