MercurialVersionControlTestScript

NetBeans Mercurial Support Test Specification

Author: Padraig O'Briain
Version: 1.1.0
Last update: 27.06.2007
Introduction: Mercurial open source tool is one of the supported version control systems in the IDE. This document describes how mercurial profile for NetBeans Mercurial Support module should be tested in order to know whether all of its functionality work correctly.
Comments:

Contents


Test suite: Creating new project

Purpose: The goal of this suite is to create new project and create its Mercurial repository.
Setup: No setup is necessary.

  1. Project import
    1. Invoke File | New Project... from main menu.
    2. "New Project" wizard shows up. Choose e.g "Java | Java Application" and push "Next" button.
    3. Setup name of the project, project location as desired and push "Finish" button.
    4. Switch to "Projects" view and select the root of the project.
    5. Invoke Versioning | Mercurial | Initialize Hg Repository... from main menu.
    6. The mercurial output tab should list the files to be added to the "Mercurial" tab.
    7. Switch to Files tab and confirm that private directory is excluded, i.e. grayed out.
    8. From the context menu of the project invoke Mercurial | Status. Seven files, build.xml, manifest.mf, build-impl.xml, genfiles.properties, project.properties, project.xml and Main.java should be listed as Locally New.
    9. Invoke Diff All icon from status window. The Diff window should be displayed with a table to allow you to inspect the differences for any of the files.
    10. From the context menu of the project invoke Mercurial | Commit.... Specify a commit message and press Commit button.
    • EXPECTED RESULT: In "Output" tab verify that "Initialize" and "Commit" command finished successfully. Now context commands on this project root in "Projects" view shouldn't contain "Initialize Repository..." action. Mercurial actions should be available.
  2. Clone project
    1. With some item in the project selected invoke Versioning | Clone <ProjectName>, where <ProjectName> is the name of the project.
    2. Make sure that "Set Cloned Project as Main" is checked and press Clone.
    • EXPECTED RESULT: In "Output" tab verify that "Clone" command finished successfully. The cloned project should be set as the main project.


Test suite: Standard development of project

Purpose: This suite tests the most often used commands of typical Mercurial user .
Setup: No setup is necessary except steps from previous test suite. This work should be done in the cloned project unless other specified.

  1. Update action
    1. Switch to "Files" view.
    2. Invoke Mercurial | Update popup menu action on project root.
    • EXPECTED RESULT: Verify that in "Output" tab there is message
      "0 files updated, 0 files merged, 0 files removed, 0 files unresolved"
  2. File modifying
    1. Select e.g. "Main.java" file, modify it.
    2. Insert brand-new line somewhere into the file.
    3. Delete some other line but not directly next to the new line.
    4. Modify another line but not directly next to the lines mentioned above and Save the file.
    • EXPECTED RESULT: The file "Main.java" must change its foreground color to blue.
  3. File differences
    1. Select this file.
    2. Invoke Versioning | Diff action from main menu.
    • EXPECTED RESULT: All three differences must be highlighted in a special window with both versions of the file. New line is green, removed line is red and modified one is blue.
  4. Files/Folders differences
    1. Create new package "xx.yy" in this project.
    2. Create new "java class" "NewClass" in package "xx.yy".
    3. Select the root of the project and invoke Versioning | Status from main menu.
    4. Files should be listed in "Mercurial" tab - "Main.java" and "NewClass".
    5. Select the root of the project and invoke Mercurial | Diff popup menu action.
    • EXPECTED RESULT: Special window is displayed. "Main.java, NewClass.java" should be contained in a table. Verify functionality of "UP" and "DOWN" arrows. Verify functionality of "Diff" icon in "Status" window - same result as for context command. "Diff all" component provides icons for "Refresh Status", "Update all" and "Commit all" action.
  5. Commit files/folders
    1. Switch to "Status" window.
    2. Push "Commit all" icon.
    3. "Commit dialog" shows up. It should contain two files: "Main.java", "NewClass.java". Enter some commit message and push "Commit" button.
    • EXPECTED RESULT: Verify that blue and green annotations of the files disappear. Files should disappear from "Mercurial" tab immediately too.
  6. Creation of patch
    1. Modify
      "Main.java"
      file and save it.
    2. Modify
      "NewClass.java"
      file and save it.
    3. Select project root and invoke Versioning | Export Diff... from main menu. Select 1 as the changeset for which diff should be made and desired output file for patch and confirm the dialog.
    • EXPECTED RESULT: Patch should be created in your chosen file.
  7. Applying patch
    1. Switch to original project
    2. Invoke Versioning | Import Patches... from main menu. Select patch file created in previous step and press OK.
    3. Invoke Versioning | Show History from main menu.
    • EXPECTED RESULT: The Mercurial History tab should show that changeset 1 has been applied to this project.
  8. Delete file
    1. Switch to "Projects" view and expand "xx.yy" package node.
    2. Invoke Delete popup menu action on "NewClass.java" file node.
    3. Confirm your decision by clicking OK in follow-up question dialog.
    4. File should disappear from all explorer views. It should appear in "Mercurial" tab with "Locally Removed" status.
    5. Select "NewClass.java" in "Status" window and invoke Commit...
    6. "Commit" dialog shows up. Fill commit message and push "Commit".
    • EXPECTED RESULT: File "NewClass.java" should disappear from all explorer views, and from "Mercurial" tab.
  9. Exclude file from commit
    1. Create new "XClass.java" class in "xx.yy" package.
    2. Create new "JFrame" in "xx.yy" package.
    3. Invoke Mercurial | Commit... on this JFrame in "Projects" view.
    4. "Commit" dialog should be displayed with these files. Change the "Commit" in "Commit Action" column to "Exclude from Commit" for both JFrame files. Push "Commit" button.
    • EXPECTED RESULT: Both files have to be excluded from commit with no change of their statuses. Include in Commit action should be accessible in popup menu actions in "Mercurial" tab and performing Include in Commit must return file to "committing" status. Note that if all files in "Commit" dialog are excluded from commit, the "Commit" button is disabled.
  10. Ignore file
    1. Create new
      "Java class"
      ("NewClass2") into {"xx.yy"} package.
    2. Select this java file and invoke Mercurial | Toggle Ignore popup menu action.
    • {{result|EXPECTED RESULT:
      "NewClass2.java"
      should change its color to gray with [[Ignored] annotations in all explorer views and it should not appear in {"Status"} output or "Commit" dialog. Verify externally that file has been added to .hgignore in project directory}}
  11. Unignore file
    1. Select
      "NewClass2.java"
      in {"Projects"} view and invoke Mercurial | Toggle Ignore popup menu action.
    2. "Status"
      output should contain {"NewClass2.java (Locally New)"} files. Path to this should be indicated with blue badges.
    3. Select project root and invoke Versioning | Commit... action from main menu.
    4. "Commit"
      dialog shows up, enter some commit message and push {"Commit"} button.
    • EXPECTED RESULT: File should disappear from
      "Status"
      output. Font color of {"NewClass2.java"} file is black now. Externally verify that the file is removed from .hgignore in project directory.
  12. Reverting modifications 1
    1. Open
      "NewClass2.java"
      to editor.
    2. Insert brand-new line somewhere into the file.
    3. Delete some other line but not directly next to the new line.
    4. Modify another line but not directly next to the lines mentioned above and Save the file. File name color should change to blue, verify the path indicating blue badges.
    5. Select
      "NewClass2.java"
      and invoke Mercurial | Revert Modifications
    6. "Revert Modifications"
      dialog should show up. Accept the latest revision in the combo box..
    7. Push the
      "Revert"
      button.
    • EXPECTED RESULT: All changes should be reverted. Indicating badges should disappear.
      "NewClass2.java"
      file should not be listed in {"Status"} window.
  13. Reverting modifications 2
    1. Open
      "NewClass2.java"
      to editor.
    2. Modify the file in some way and Save the file. File name color should change to blue, verify the path indicating blue badges.
    3. In Status window select
      "NewClass2.java"
      and invoke Revert Modifications from context menu.
    4. "Revert Modifications"
      dialog should show up. Accept the latest revision in the combo box..
    5. Push the
      "Revert"
      button.
    • EXPECTED RESULT: All changes should be reverted. Indicating badges should disappear.
      "NewClass2.java"
      file should not be listed in {"Status"} window.
  14. Reverting modifications 3
    1. Select "xx.yy" package and invoke Mercurial | Revert Modifications.
    2. "Revert Modifications"
      dialog should show up. Accept the first revision in the combo box.
    3. Push the
      "Revert"
      button.
    • EXPECTED RESULT: The file
      "NewClass2.java"
      should be Locally Removed and should disappear from Project view.
  15. Reverting modifications 4
    1. In Status window select
      "NewClass2.java"
      and invoke Revert Delete from context menu.
    2. "Revert Modifications"
      dialog should show up. Accept the latest revision in the combo box.
    3. Push the
      "Revert"
      button.
    • EXPECTED RESULT: The file
      "NewClass2.java"
      should disappear from {"Status Window"} and should appear in Project view.
  1. Actions in Projects view
    1. Add new package
      "aa"
      and new {"Interface.java"}
    2. Add new package
      "aa.bb"
      and new {"NewClass.java"}
    3. Invoke Mercurial | Commit... on
      "aa"
      package.
    4. Commit dialog shows up. There should be
      "Interface.java"
      listed in commit dialog. Push {"Commit"} button.
    5. Make sure that only
      "Interface.java"
      was added according to {"output"} window.
    • EXPECTED RESULT: Mercurial actions invoked on packages
      "Projects"
      view shouldn't be performed recursively. Make sure that Update, Diff, and Revert Modifications work correctly.


Test suite: Mercurial Properties

Purpose: This suite tests editing of Mercurial properties for projects.
Setup: Mercurial versioned project needs to be selected.

  1. Opening Mercurial Properties Editor
    1. Select any Mercurial versioned file in
      "Projects"
      view and invoke Mercurial | Properties from its popup menu.
    • EXPECTED RESULT: New window labeled
      "Hg Properties Editor"
      should open in the middle of your screen. Verify that {"Property Name"} combo box, "Property Value" text area, "Add", "Remove", "OK", "Cancel" and "Help" buttons, and a table with columns "Name" and "Value" are present.
  2. Adding properties
    • Setup: Steps from previous test case are required.
    1. The property names currently supported are those in the
      "Property Name"
      combobox. Choose username.
    2. Type something into the
      "Property Value"
      text area.
    3. Push the
      "Add"
      button.
    • EXPECTED RESULT: New Mercurial property should be present in the table. Verify that its name and value are those you entered in previous steps.When OK button is pressed the values should be written to .hg/hgrc of the mercurial repository. After changing username commit a change to a file and ensure that correct user is displayed in Show History output.
  3. Removing Mercurial property
    • Setup: Follow previous test case.
    1. Select the same project and invoke Mercurial | Properties from its popup menu.
    2. In the table select the property added in previous test case and push the
      "Remove"
      button.
    • EXPECTED RESULT: The selected property should disappear from the table. When OK button is pressed the property should be removed from the .hg/hgrc file of the repository.


Test suite: Miscellaneous Mercurial Tests

Purpose: This suite tests some aspects of Mercurial module which do not fit in other sections.
Setup: No setup is necessary.

  1. Disabled Initialize Repository
    1. Switch to Files view and ensure that nothing is selected
    2. Invoke Versioning from main menu.
    • EXPECTED RESULT: The menu option Initialize Repository should be disabled.
  2. Annotations
    1. Select
      "Main.java"
      node and invoke Mercurial | Show Annotations popup menu action.
    2. "Annotations" column and "Stripes" should be displayed around the editor area of this file.
    3. Select desired line (with revision e.g. "12").
    4. All lines with revision ("12") should be colored blue in "annotations" column. "Stripes" should show navigations to this revision too.
    5. Move mouse pointer over "Revision" column and invoke popup menu.
    • EXPECTED RESULT: There should be Diff 12 to 11, Revert Modifications... and Close Annotations actions listed in popup menu.
  3. Annotations actions
    1. Choose Diff... action.
    2. "Diff" tab should be opened into the editor for specified revisions.
    3. Choose Revert Modifications... action.
    4. This action should show
      "Revert Modifications"
      dialog.
    5. Choose Close Annotations action.
    6. This action should hide annotation column and stripes too.
    • EXPECTED RESULT: Verify functionality on various revisions and navigations with the use of "Stripes".



Test suite: Mercurial Options

Purpose: This suite tests some configurable options of Mercurial module.
Setup: No setup is necessary.

  1. Invoking Mercurial Options
    1. Invoke Tools | Options from main menu.
    2. Push
      "Miscellaneous"
      button.
    3. Select
      "Versioning"
      tab and then {"Mercurial"} list entry.
    • EXPECTED RESULT: There should be six configurable options:
      "Mercurial User Name:"
      , {"Mercurial executable path:"} with "Browse" button, Default Export Filename:" with "Browse" button, "Mercurial Status Labels" with "Add Variable.." button, "Manage Extensions" button, and "On Revert Modifications save Locally Modified files to <file>.orig" checkbox.
  2. Setting up Mercurial User Name
    • Comments: This test allows you to specify the committer of a changeset created when running commit.
    • Setup: Follow steps from "Invoking Mercurial Options" test case.
    1. Enter text into the field. It should be something like: Padraig O'Briain <padraig.obriain@sun.com>. Choose a name which is different from that currently reported as user in Show History output. Press OK button.
    2. Make a change in some project and commit it. Ensure that username is not specified in the Mercurial properties for that project.
    • {{result|EXPECTED RESULT: The text specified should be stored as username in ui section of ~/.hgrc. Check Show History output to ensure that newly specified user name is used.
  3. Setting up Mercurial executable path
    • Comments: This test case is needed only if the Mercurial executable is not in the PATH variable and NetBeans is unable to locate it.
    • Setup: Follow steps from "Invoking Mercurial Options" test case.
    1. Push the
      "Browse"
      button.
    2. "Browse for the Mercurial Executable"
      dialog appears. Use it to locate Mercurial executable and press {"OK"} button.
    • EXPECTED RESULT: After confirmation (using
      "OK"
      ) button, NetBeans should be able to work with Mercurial.
  4. Default Export FileName
    • Setup: Follow steps from "Invoking Mercurial Options" test case.
    1. Enter the name of your default export file. It is expected that some of the formatting characters specified in the output of the command
      "hg help export"
      or push the {"Browse"} button to help you specify the directory.
    • EXPECTED RESULT: The name specified should appear in the dialog displayed by Versioning
  5. Manage Labels
    • Setup: Follow steps from "Invoking Mercurial Options" test case.
    1. Push the
      "Add Variable..."
      button.
    2. New window labeled
      "Select Variables"
      appears. You can choose any from offered variables and press {"OK"} button.
    3. Every time you add a variable, it is added at the end of the
      "Status Label Format"
      text field. You can also edit it by yourself. Explanation of all variables is displayed in the {"Select Variables"} window.
    • EXPECTED RESULT: Verify that status labels are as defined in previous steps. (It is necessary to have View
  6. Mercurial Extensions
    • Comments: This test case allows one to specify Mercurial extensions to be loaded
    • Setup: Follow steps from "Invoking Mercurial Options" test case.
    1. Push the
      "Manage Extensions"
      button.
    2. In Mercurial Extensions Editor, specify the name of the extension to be loaded in Property Name field and the location from which it should be loaded if not from mercurial's path.
    • EXPECTED RESULT: The specified extensions should be specified in extensions section of ~/.hgrc.


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