FeaturesPluginsDocs & SupportCommunityPartners

Refactoring Test Specification

Author: Marek Grummich, Emanuel Hucka
Version: 1.4
Last update: 2005/03/23
Introduction: This document contains usual/typical scenarios that can be encountered by user which want to test a refactoring functionality included in the NetBeans IDE (promotion_e). It is mostly build on automatic tests in nbcvs:/refactoring/test/qa-functional (command: cvs -d:pserver:anoncvs@cvs.netbeans.org:/cvs checkout refactoring/test).
Comment:

Table of Contents

Test suite 1: Find Usages

Purpose: To verify if this part of refactoring functionality corresponds with design and works right.
Setup: These steps are required to be possible to go through following part of the test specification.

  • Unzip a project default from default.zip to some work directory.
  • Start IDE with a clean userdir
  • Invoke File | Open Project... action
  • Select unzipped projects default
  • Scanning structure of project should be performed (It takes a while)

#Test caseDescription
1Class - Usages
  1. Select org.netbeans.tests.examples.packa.Bean class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Find Usages choice and Search in Comments checkbox in the Find Usages ... dialog and confirm it by the Next button.
RESULT:Usages of org.netbeans.tests.examples.packa.Bean [35 occurances]
should be displayed in the first line of Usages window
2Class - All Subtypes
  1. Select org.netbeans.tests.examples.packa.Bean class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Find All Subtypes choice and Search in Comments checkbox in the Find Usages ... dialog and confirm it by the Next button.
RESULT:Usages of org.netbeans.tests.examples.packa.Bean [7 occurences]
should be displayed in the first line of Usages window
3Class - Direct Subtypes
  1. Select org.netbeans.tests.examples.packa.Bean class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Find Direct Subtypes Only choice and Search in Comments checkbox in the Find Usages ... dialog and confirm it by the Next button.
RESULT:Usages of org.netbeans.tests.examples.packa.Bean [2 occurences]
should be displayed in the first line of Usages window
4Interface - Usages
  1. Select org.netbeans.tests.examples.packc.Makable class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Find Usages choice and Search in Comments checkbox in the Find Usages ... dialog and confirm it by the Next button.
RESULT:Usages of org.netbeans.tests.examples.packc.Makable [18 occurances]
should be displayed in the first line of Usages window
5Interface - All Subtypes
  1. Select org.netbeans.tests.examples.packc.Makable class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Find All Subtypes choice and Search in Comments checkbox in the Find Usages ... dialog and confirm it by the Next button.
RESULT:Usages of org.netbeans.tests.examples.packc.Makable [6 occurences]
should be displayed in the first line of Usages window
6Interface - Direct Subtypes
  1. Select org.netbeans.tests.examples.packc.Makable class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Find Direct Subtypes Only choice and Search in Comments checkbox in the Find Usages ... dialog and confirm it by the Next button.
RESULT:Usages of org.netbeans.tests.examples.packc.Makable [3 occurences]
should be displayed in the first line of Usages window
7Constructor
  1. Select node BeanB() from the org.netbeans.tests.examples.packb.BeanB class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Search in Comments check box in Find Usages dialog and press Next button.
RESULT:<Usages of org.netbeans.tests.examples.packb.BeanB [6 occurences]
should be displayed in the first line of Usages window
8Method - Usages
  1. Select node make(int, String, Bean) from the org.netbeans.tests.examples.packc.Makable class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select only Find Usages checkbox and Search in Comments checkbox in the Find Usages... dialog and confirm it by Next button.
RESULT:Usages of Makable.make [4 occurences]
should be displayed in the first line of Usages window.
9Method - Overriding Methods
  1. Select node make(int, String, Bean) from the org.netbeans.tests.examples.packc.Makable class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select only Find Overriding Methods checkbox and Search in Comments checkbox in the Find Usages... dialog and confirm it by Next button.
RESULT:Overriding Methods of Makable.make [5 occurences]
should be displayed in the first line of Usages window.
10Method - Search from Base Class
  1. Select node make(int, String, Bean) from the org.netbeans.tests.examples.packb.BeanB class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select only Find Usages, Search from Base Class and Search in Comments checkboxies in the Find Usages... dialog and confirm it by Next button.
RESULT:Usages of Makable.make [4 occurences]
should be displayed in the first line of Usages window.
11Field
  1. Select node refID from the org.netbeans.tests.examples.packa.Bean class in the Project view
  2. Invoke Find Usages action from the popup menu
  3. Select Search In comments checkbox and confirm dialog by Next button.
RESULT:Usages of refID [16 occurences]
should be displayed in the first line of Usages window.
12Java Class - String
  1. Invoke action Go To Class (Alt+Shift+O), select Show Non-Project Classes, write "String" into Class Name field, select java.lang.String and press Open button.
  2. Select String string on the public class definition line and invoke Find Usages action from the popup menu.
  3. Invoke Find Usages action from the popup menu
  4. Select Find Usages radio button and check Search in Comments checkbox in the Find Usages ... dialog and confirm it by Next button.
RESULT:Usages of java.lang.String [40 occurences]
should be displayed in the first line of Usages window.
After each Find usages action should be opened a new tab in Usages window.

Test suite 2: Rename

Purpose: To verify if this part of refactoring functionality corresponds with design and works right.
Setup: These steps are required to be possible to go through following part of the test specification.

  • Unzip a project default from default.zip to some work directory.
  • Start IDE with a clean userdir
  • Invoke File | Open Project... action
  • Select unzipped projects default
  • Scanning structure of project should be performed (It takes a while)

#Test caseDescription
1Package
  1. Select org.netbeans.tests.examples.packa package node in the Project view
  2. Invoke Refactoring | Rename action from the popup menu
  3. Fill a new package name org.netbeans.tests.examples.packarenamed in the Rename dialog, check Apply Rename on comments, Preview All Changes checkboxies and confirm this dialog by Next button.
  4. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename org.netbeans.tests.examples.packa to org.netbeans.tests.examples.packarenamed [23 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
2Package in Files view
  1. Switch to the Files tab
  2. Select default/src/org package node in the Files view
  3. Click to the node to activate its inplace rename
  4. Fill a new package name com and confirm by enter key
  5. The Refactor Code for Moved Classes dialog should be displayed. Select Preview All Changes checkbox and confirm it by Next button.
  6. Press Do Refactoring button and changes will be performed.
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Move Classes [48 occurances]
should be displayed in Refactoring | Move Classes window. After Do Refactoring action should be project compilable.
3Class
  1. Select org.netbeans.tests.examples.packa.Bean class node in the Project view
  2. Invoke Refactoring | Rename action from the popup menu
  3. Fill a new class name BeanRenamed and select Preview All Changes, Apply Rename on Comments checkboxies in the Rename dialog and confirm it by Next button
  4. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename Bean to BeanRenamed [36 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
4Class - non-primary top level
  1. Select org.netbeans.tests.examples.packb.BeansDBeanD class node in the Project view
  2. Invoke Refactoring | Rename action from the popup menu
  3. Fill a new class name BeanDRenamed and select Preview All Changes, Apply Rename on Comments checkboxies in the Rename dialog and confirm it by Next button
  4. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename BeanD to BeanDRenamed [3 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
5Class - inplace rename
  1. Select org.netbeans.tests.examples.packa.Bean class node in the Project view
  2. Click to the node to activate its inplace rename
  3. Fill a new class name BeanRenamed and confirm by enter key
  4. The Refactor Code for Renamed File(s) dialog should be displayed. Select Apply Rename on Comments checkbox and confirm dialog
  5. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename Bean to BeanRenamed [36 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
6Interface
  1. Select org.netbeans.tests.examples.packc.Makable interface node in the Project view
  2. Invoke Refactoring | Rename action from the popup menu
  3. Fill a new interface name MakableRenamed and select Preview All Changes, Apply Rename on Comments checkboxies in the Rename dialog and confirm this dialog
  4. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename Makable to MakableRenamed [19 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
7Rename Method
  1. Select node getProtectedProperty() of the org.netbeans.tests.examples.packb.BeanA class in the Project view
  2. Invoke Refactoring | Rename action from the popup menu
  3. There should be displayed warning: There are methods in subclasses/implementors of org.netbeans.tests.examples.packb.BeanA that override or implement this method. They will also be renamed.
  4. Press Next button
  5. Fill a new method name getProtectedPropertyRenamed and select Preview All Changes, Apply Rename on Comments checkboxies in the Rename dialog and confirm this dialog
  6. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename getProtectedProperty to getProtectedPropertyRenamed [14 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
8Rename Field
  1. Select field node protectedProperty of the org.netbeans.tests.examples.packb.BeanA class in the Project view
  2. Invoke Refactoring | Rename action from the popup menu
  3. Fill a new field name protectedPropertyRenamed and select Preview All Changes, Apply Rename on Comments checkboxies in the Rename dialog and confirm this dialog
  4. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename protectedProperty to protectedPropertyRenamed [24 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
9Rename Local Field
  1. Open class org.netbeans.tests.examples.packc.BeanE in the source editor.
  2. Move cursor to attribute v1 of the method public double count(double[] v1, double[] v2).
  3. Invoke Refactoring | Rename action from the popup menu
  4. Fill a new field name vector1 and select Preview All Changes, Apply Rename on Comments checkboxies in the Rename dialog and confirm this dialog
  5. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Rename v1 to vector1 [9 occurances]
should be displayed in Refactoring | Rename window. After Do Refactoring action should be project compilable.
Teardown: These steps are needed so that this test suite doesn't affect next.
  • Exit IDE
  • Clear current or use another userdir for the next test suite


Test suite 3: Move Class

Purpose: To verify if this part of refactoring functionality corresponds to design and works right.
Setup: These steps are required to be possible to go through following part of the test specification.

  • Unzip a project default from default.zip to some work directory.
  • Start IDE with a clean userdir
  • Invoke File | Open Project... action
  • Select unzipped projects default
  • Scanning structure of project should be performed (It takes a while)

#Test caseDescription
1Move class
  1. Select org.netbeans.tests.examples.packa.Bean class in the Project view
  2. Invoke Refactoring | Move Class ... action from the popup menu
  3. Select org.netbeans.tests.examples.packb in To Package combobox and select Preview All Changes checkbox in the Move Class dialog and confirm it by Next button.
  4. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Move class org.netbeans.tests.examples.packa.Bean to org/netbeans/tests/examples/packb package [16 occurances]
should be displayed in Refactoring | Move Class window. After Do Refactoring project will be compilable.
2Package private field
  1. Select org.netbeans.tests.examples.packb.BeanA class in the Project view
  2. Invoke Refactoring | Move Class ... action from the popup menu
  3. Problem: Class "BeanB" within the same package is using protected field "protectedProperty" of class you want to move ("BeanA"). should be displayed. Continue by Next button.
  4. Select org.netbeans.tests.examples.packa in To Package combobox and select Preview All Changes checkbox in the Move Class dialog and confirm it by Next button.
  5. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Move class org.netbeans.tests.examples.packb.BeanA to org/netbeans/tests/examples/packa package [6 occurances]
should be displayed in Refactoring | Move Class window. After Do Refactoring project will not be compilable because of using of package private field protectedProperty by classes in org.netbeans.tests.examples.packb.
3Default package
  1. Select org.netbeans.tests.examples.packb.BeanB class in the Project view
  2. Invoke Refactoring | Move Class ... action from the popup menu
  3. Problem: Class you want to move ("BeanB") is using protected field "protectedProperty" of class "BeanA" within the same package. should be displayed. Continue by Next button.
  4. Select <default package> in To Package combobox and select Preview All Changes checkbox in the Move Class dialog and confirm it by Next button.
  5. Problem: If the class is moved to the default package, classes in other packages will not be able to import the moved class. should be displayed. Continue by Next button.
  6. If you agree with these changes press Do Refactoring button and changes will be performed
Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
RESULT:Move class org.netbeans.tests.examples.packb.BeanB to <default> package [3 occurances]
should be displayed in Refactoring | Move Class window. After Do Refactoring project will not be compilable because of using of package private field protectedProperty by classes in org.netbeans.tests.examples.packb.
4Drag and Drop and items. Select Preview All Changes checkbox and confirm it by the Next button.
  • If you agree with these changes press Do Refactoring button and changes will be performed
    1. Select AbstractBean and Makable in the org.netbaens.tests.examples.packc, drag them (by Ctrl key) and drop into org.netbeans.tests.examples.packa.
    2. Refactor Code for Moved Classes dialog will be displayed. List of Classes list contains
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Move Classes [15 occurances]
    should be displayed in Refactoring | Move Classes window. After Do Refactoring project will be compilable.
    5To Test Packages
    1. Switch to Files view and add test/org/netbeans/tests folder into root folder of default project.
    2. Select org.netbeans.tests.examples.packc.BeanE class in Source Packages in Projects view.
    3. Invoke Refactoring | Move Class ... action from the popup menu
    4. Select "Test Packages" in Location combobox, select org.netbeans.tests in To Package combobox and select Preview All Changes checkbox in the Move Class dialog and confirm it by Next button.
    5. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Move class org.netbeans.tests.examples.packc.BeanE to org/netbeans/tests package [1 occurances]
    should be displayed in Refactoring | Move Class window. After Do Refactoring project will be compilable.
    Teardown: These steps are needed so that this test suite doesn't affect next.
    • Exit IDE
    • Clear current or use another userdir for the next test suite


    Test suite 4: Change Method Parameters

    Purpose: To verify if this part of refactoring functionality corresponds to design and works right
    Setup: These steps are required to be possible to go through following part of the test specification.

    • Unzip a project default from default.zip to some work directory.
    • Start IDE with a clean userdir
    • Invoke File | Open Project... action
    • Select unzipped projects default
    • Scanning structure of project should be performed (It takes a while)

    #Test caseDescription
    1Constructor
    1. Select constructor node BeanA() from the org.netbeans.tests.examples.packb.BeanA class in the Project view.
    2. Invoke Refactoring | Change Method Parameters action from the popup menu
    3. In the Change Method Parameters dialog press the Add button and filfull Name, Type and Default Value for new created parameter as "name", "java.lang.String" and """".
    4. Select Preview All Changes checkbox and press Next button.
    5. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Change parameters of BeanA constructor to public BeanA(String name) [4 occurances]
    should be displayed on the first line of Refactoring | Change Method Parameters window. All occurances of this constructor should be changed to BeanA("").
    2Add parameter
    1. Select method abc() from the org.netbeans.tests.examples.packa.Bean class in the Project view.
    2. Invoke Refactoring | Change Method Parameters action from the popup menu
    3. There should be displayed three warnings like: "There are methods in subclasses or implementors of org.netbeans.tests.examples.packb.BeanDD that override or implement the method." Press Next button.
    4. In the Change Method Parameters dialog press the Add button and filfull Name and Type for the new created parameter as "id" and "int". Leave Default Value field empty.
    5. There should be displayed an error notice "Error: You have to provide default values for all new parameters." Filfull Default Value as "0".
    6. Select Preview All Changes checkbox and press Next button.
    7. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Change parameters of abc method to public org.netbeans.tests.examples.packa.Bean abc(int id) [12 occurances]
    should be displayed on the first line of Refactoring | Change Method Parameters window. All occurances of this method should be changed to abc(0).
    3Remove parameter
    1. Select method make(int index, String s, Bean bean) from the org.netbeans.tests.examples.packc.Makable class in the Project view.
    2. Invoke Refactoring | Change Method Parameters action from the popup menu
    3. There should be displayed three warnings like: "There are methods in subclasses or implementors of org.netbeans.tests.examples.packb.BeanDD that override or implement the method." Press Next button.
    4. In the Change Method Parameters dialog select "bean" parameter and press the Remove button.
    5. Notice that Access Modifier combobox is disabled for interfaces.
    6. Select Preview All Changes checkbox and press Next button.
    7. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Change parameters of make method to public abstract void make(int index, java.lang.String s) [10 occurances]
    should be displayed on the first line of Refactoring | Change Method Parameters window.
    4Visibility Modifier
    1. Select method abc() from the org.netbeans.tests.examples.packa.Bean class in the Project view.
    2. Invoke Refactoring | Change Method Parameters action from the popup menu
    3. There should be displayed three warnings like: "There are methods in subclasses or implementors of org.netbeans.tests.examples.packb.BeanDD that override or implement the method." Press Next button.
    4. In the Change Method Parameters dialog select "protected" in the Access Modifier checkbox.
    5. Select Preview All Changes checkbox and press Next button.
    6. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Change parameters of abc method to protected org.netbeans.tests.examples.packa.Bean abc() [12 occurances]
    should be displayed on the first line of Refactoring | Change Method Parameters window.
    5Parameter position
    1. Select method make(int index, String s, Bean bean) from the org.netbeans.tests.examples.packc.Makable class in the Project view.
    2. Invoke Refactoring | Change Method Parameters action from the popup menu
    3. There should be displayed three warnings like: "There are methods in subclasses or implementors of org.netbeans.tests.examples.packb.BeanDD that override or implement the method." Press Next button.
    4. In the Change Method Parameters dialog select "s" parameter and press the Move Up button.
    5. Select Preview All Changes checkbox and press Next button.
    6. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Change parameters of make method to public abstract void make(int index, java.lang.String s) [10 occurances]
    should be displayed on the first line of Refactoring | Change Method Parameters window.
    Teardown: These steps are needed so that this test suite doesn't affect next.
    • Exit IDE
    • Clear current or use another userdir for the next test suite


    Test suite 5: Encapsulate Fields

    Purpose: To verify if this part of refactoring functionality corresponds to design and works right
    Setup: These steps are required to be possible to go through following part of the test specification.

    • Unzip a project default from default.zip to some work directory.
    • Start IDE with a clean userdir
    • Invoke File | Open Project... action
    • Select unzipped projects default
    • Scanning structure of project should be performed (It takes a while)

    #Test caseDescription
    1Encapsulate field
    1. Select field protectedProperty from the org.netbeans.tests.examples.packb.BeanA class in the Project view.
    2. Invoke Refactoring | Encapsulate Fields action from the popup menu
    3. Select Preview All Changes checkbox and press Next button.
    4. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Encapsulate fields in class org.netbeans.tests.examples.packb.BeanA [17 occurances]
    should be displayed on first line of Refactoring | Encapsulate Fields window. After the refactoring is done the project should be compilable, the field modifier is changed into private.
    2Change getter, setter name
    1. Select field refID from the org.netbeans.tests.examples.packa.Bean class in the Project view.
    2. Invoke Refactoring | Encapsulate Fields action from the popup menu.
    3. Edit field's Getter column to "getRID" and Setter column to "setRID" in the List of Fields To Ecapsulate table.
    4. Select Preview All Changes checkbox and press Next button.
    5. If you agree with these changes press Do Refactoring button and changes will be performed
    Teardown: It is neccessary to use Refactoring | Undo functionality to revert changes back to the initial state!
    RESULT:Encapsulate fields in class org.netbeans.tests.examples.packa.Bean [16 occurances]
    should be displayed on first line of Refactoring | Encapsulate Fields window. After the refactoring is done the project should be compilable, the field modifier is changed into private.
    3Use Accessors if needed
    1. Select field publicProperty from the org.netbeans.tests.examples.packb.BeanA class in the Project view.
    2. Invoke Refactoring | Encapsulate Fields action from the popup menu
    3. Select public field's visibility by appropriate combobox and uncheck checkbox Use Accessors Even When Field is Accessible
    4. Select Preview All Changes checkbox and press Next button.
    5. If you agree with these changes press Do Refactoring button and changes will be performed
    RESULT:Encapsulate fields in class org.netbeans.tests.examples.packb.BeanA [8 occurances]
    should be displayed on first line of Refactoring | Encapsulate Fields window. All usage checkboxes in the refactoring tree should be unchecked.
    Teardown: These steps are needed so that this test suite doesn't affect next.
    • Exit IDE
    • Clear current or use another userdir for the next test suite


    Test suite 6: Miscellaneous

    Purpose: To verify if this part of refactoring functionality corresponds to design and works right
    Setup: These steps are required to be possible to go through following part of the test specification.

    • Unzip a project default from default.zip to some work directory.
    • Start IDE with a clean userdir
    • Invoke File | Open Project... action
    • Select unzipped projects default
    • Scanning structure of project should be performed (It takes a while)

    #Test caseDescription
    1Undo/Redo
    1. Perform some previous testcase (rename, ...) and invoke Undo action
    2. Verify if changes were reverted to the initial state
    3. Invoke Redo action
    4. Verify if changes were same like after refactoring
    RESULT:Verification was performed during testcase
    2Same name in two projects
    1. Create a new General | Java Application project called JavaApplication1; with a main class Main in the package abc.
    2. Create a another new General | Java Application project called JavaApplication2; with a main class Main in the package abc.
    3. Create a new class Alfa in the package abc for JavaApplication1 project
    4. Create a new class Beta in the package abc for JavaApplication2 project
    5. Invoke Refactoring | Rename action from the popup menu for the abc.Beta in the JavaApplication2 project
    6. Fill a new class name Alfa in the Rename dialog, uncheck Preview all changes checkbox and confirm this dialog
    RESULT:Class Beta from JavaApplication2 project should be renamed to Alfa.
    Teardown: These steps are needed so that this test suite doesn't affect next.
    • Exit IDE
    • Clear current or use another userdir for the next test suite


    Test suite 7: JDK 1.5 Refactoring

    Purpose: This test suite tests overall refactoring on JDK1.5 sources.
    Setup: These steps are required to be possible to go through following part of the test specification.

    • Unzip a project default2 from default15.zip to some work directory.
    • Start IDE with a clean userdir and JDK1.5
    • Invoke File | Open Project... action
    • Select unzipped projects default2
    • Scanning structure of project should be performed (It takes a while)

    #Test caseDescription
    1Refactoring 1.5 - Find Usages
    1. Open package "abc".
    2. Find usages of class "abc.A".
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Usages of the "A" should be found.
    2Refactoring 1.5 - Find Usages - Context
    1. Open annotation "abc.def.DAnnotType" in the editor and select X of En in default value of member coord in source text.
    2. Invoke the context menu and choose "Find Usages".
    3. Find Usages dialog should contain title: "Finx X of class En":.
    4. Select Search in Comments checkbox.
    5. Invoke dialog by Next button.
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:It should find 4 occurances of En.X constant.
    3Refactoring 1.5 - Rename Class
    1. Open class "abc.A" in the editor.
    2. Find node correspoding to class "abc.A" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Rename...".
    4. Change name to "TestClassName".
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Verify that the result is correct (the project is compilable and the class was renamed).
    4Refactoring 1.5 - Rename Enumeration
    1. Open enumeration "abc.En" in the editor.
    2. Find node correspoding to enumeration "abc.En" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Rename...".
    4. Change name to "TestEnumeration".
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Verify that the result is correct (the project is compilable and the enumeration was renamed).
    5Refactoring 1.5 - Rename Enumeration Constant
    1. Open enumeration "abc.En" in the editor.
    2. Find node correspoding to enumeration constant "X" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Rename...".
    4. Change name to "W" and select Preview All Changes and Apply Rename in Comments checkboxes.
    5. Confirm dialog by Next button.
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:It should find 5 occurances of the constant.
    6Refactoring 1.5 - Rename Field
    1. Open class "abc.A" in the editor.
    2. Find node correspoding to field "abc.A.list" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Rename...".
    4. Change name to "testFieldName".
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Verify that the result is correct (the project is compilable and the field was renamed).
    7Refactoring 1.5 - Rename Annotation Type
    1. Open annotation "abc.def.DAnnotType" in the editor and select DAnnotType in source text.
    2. Invoke the context menu and choose "Refactor/Rename...".
    3. Change name to "AnnotType" and check Preview All Changes checkbox.
    4. Invoke dialog by Next button.
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:It should find 16 occurances of the annotation type.
    8Refactoring 1.5 - Rename Annotation Type Member
    1. Open annotation "abc.def.DAnnotType" in the editor and select coord member in source text.
    2. Invoke the context menu and choose "Refactor/Rename...".
    3. Change name to "dcoord" and check Preview All Changes checkbox.
    4. Invoke dialog by Next button.
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:It should find 2 occurances of the member of annotation type.
    9Refactoring 1.5 - Move Class I
    1. Open class "abc.A" in the editor.
    2. Find node correspoding to class "abc.A" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Move Class...".
    4. Set destination package to "abc.def".
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Verify that the result is correct (the project is compilable and the class was moved).
    10Refactoring 1.5 - Move Class II
    1. Open enumeration "abc.En" in the editor.
    2. Find node correspoding to enumeration "abc.En" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Move Class...".
    4. Set destination package to "abc.def".
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Verify that the result is correct (the project is compilable and the enumeration was moved).
    11Refactoring 1.5 - Encapsulate Fields
    1. Open class "abc.A" in the editor.
    2. Find node correspoding to field "abc.A.list" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Encapsulate Fields...".
    4. Leave the default values in the dialog untouched (encapsulate only "list", field visibility "private", accessor visibility "public", use accesors even if field is visible "true".
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Verify that the result is correct (all occurrences of "list" in "abc.A" and "abc.B" should be replaced, the generated methods should have generics types).
    12Refactoring 1.5 - Change Signature
    1. Open class "abc.A" in the editor.
    2. Find node correspoding to "abc.A.methodA(T, String, boolean, String...)" in the explorer (projects view).
    3. Invoke the context menu and choose "Refactor/Change Method Parameters...".
    4. Make some changes.
    Teardown: Use Refactor/Undo functionality to get the sources into the original state. Check that it succeeded.
    RESULT:Verify that the result is correct.
    During performing this test suite take ideas from the rest of the refactoring test suite.


    Generated: 2005 03 23 02:36
    Companion
    Projects:
    MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by