TS 61 HG

NetBeans Mercurial Support Test Specification

Author: Padraig O'Briain
Version: 1.2.0
Last update: 30.10.2009
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: At NetBeans 6.7 all commands listed are accessible through Team menu instead of Versioning. The rest of the structure of menus should be the same.

Contents

Important

Since 6.8. the scanning of project takes place after a Hg task is finished. It is important to watch for the occurence of "Scanning in progress" in the bottom status bar. Please, follow these rules during testing:

  • Use repository with large amount of data. Also use actions that affect more files, so the scanning takes longer time and is easily noticeable
  • Always make sure, that the scanning is performed *after* a Hg task is finished

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 Team | 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 combo box 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 Team | Clone <ProjectName>, where <ProjectName> is the name of the project.
    • EXPECTED RESULT: In "Output" tab verify that "Clone" command finished successfully. The cloned project should be set as the main project.
  3. Disabled Initialize Repository
    1. Switch to Files view and ensure that nothing is selected
    2. Invoke Team | Mercurialfrom main menu.
    • EXPECTED RESULT: The menu option Initialize Repository should be disabled.


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. Delete "Main.java".
    3. Invoke Mercurial | Update... main menu action on project root and press Update in following dialog.
    • EXPECTED RESULT: Verify that "Main.java" is in "Projects" view again and in "Output" tab there is following message
      "1 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 Mercurial | 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 Mercurial | 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 combobox field. 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. Commit the changes. Select project root and invoke Mercurial | 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 Mercurial | Import Patches... from main menu. Select patch file created in previous step and press OK.
    3. Invoke Mercurial | 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 Yes 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 "JFrame" in "xx.yy" package.
    2. Invoke Mercurial | Commit... on this JFrame in "Projects" view.
    3. "Commit" dialog should be displayed with these JFrame files. Change the "Commit Action" to "Exclude from Commit" for both files.
    • EXPECTED RESULT: "Commit" button should be disabled. Close this dialog.
  10. Ignore file
    1. Create new "Java class" ("NewClass2") into "xx.yy" package.
    2. Select this java file and invoke Mercurial | Toggle Ignore .
    • EXPECTED RESULT: "NewClass2.java" should change its color to gray with [[[Ignored | [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 Mercurial | 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.
  16. 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.
    • EXPECTED RESULT: Mercurial actions invoked on packages "Projects" view shouldn't be performed recursively. Make sure that Diff, and Revert Modifications work correctly.
  17. Refactoring
    1. Select "Main.java" node and invoke Refactor | Rename... popup menu action on it.
    2. Enter new name for it and push "Next" button. Special window shows up, push Refactor.
    3. File with new name should be listed in "Mercuial" view as {"[Copied]"} and old one "[Locally Deleted]".
    4. Commit both files and verify whether new file inherited history by refactoring.
    5. Switch to "Files" view, select package {"xx"} and invoke Refactor | Rename... popup menu action on it.
    6. Enter new name "yz" for it and push {"Next"} button. Special window shows up, push "Refactor".
    7. Make sure that all refactored nodes with new name are marked as " Copied" (for directories only {"[New]"</nowiki>.
    • EXPECTED RESULT: Push Commit make sure that file nodes disappear. And all files/directories were committed as well.
    • }}teardown rename everything back as it was before}}


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 <tt>"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 there is a table with columns "Name" and "Value" and a text area with label "Property Value:" are present. The table should have three rows labeled "default-pull", "default-push" and "username"
  2. Changing properties
    • Setup: Steps from previous test case are required.
    1. Select the "username" row.
    2. Type something into the "Property Value" text area.
    3. Select any other row in the table.
    • EXPECTED RESULT: Verify that "Value" column of the "username" row was changed to the text you typed in step 2. Verify also externally that there is file <project_home>/.hg/.hgrc and three properties from previous dialog are there.


Test suite: Work on shared project

Purpose: This suite tests actions in standard workflow on shared project.
Setup: Initialize a new mercurial project (referred to as 'original') and create its clone (referred to as 'clone').

  1. Show Out
    1. Add a new "NewClass.java" to the clone and modify "Main.java".
    2. Commit both files to the clone.
    3. Select the clone root and invoke Mercurial | Show Out popup menu action.
    4. New tab labeled "Mercurial Out - <project_name>" is opened in editor. Push the "Search" button.
    • EXPECTED RESULT: Verify that both files are listed (in fact "NewClass.java" is present twice as it was added).
  2. Push to Default
    1. Select the clone root and invoke Team | Mercurial | Share | Push to - default main menu action.
    • EXPECTED RESULT: Verify that the "NewClass.java" file was added to the original project and "Main.java" reflects changes made to the same file in clone.
  3. Show Incomming
    1. In original project, delete the "NewClass.java", make changes to "Main.java" and commit it.
    2. Select root of clone and invoke Mercurial | Show Incomming popup menu action.
    3. New tab labeled "Mercurial Incomming - <project_name>" is opened in editor. Push the "Search" button.
    • EXPECTED RESULT: Verify that both files are listed (in fact "NewClass.java" is present twice as it was removed).
  4. Pull from Default
    1. Select the clone root and invoke Team | Mercurial | Share | Pull from - default main menu action.
    • EXPECTED RESULT: Verify that the "NewClass.java" file was removed from the clone and "Main.java" reflects changes made to the same file in original.
  5. Merge
    1. Add a new Original.java" file to the original and commit it.
    2. Add a new Clone.java" file to the clone and commit it.
    3. Select clone root and invoke Team | Mercurial | Share | Push to - default main menu action.
    4. A warning dialog appears reading that you have to perform Pull and Merge to be able to commit.
    5. Select clone root and invoke Team | Mercurial | Share | Pull from - default main menu action.
    6. Dialog asking whether you want to merge changes appears. Push "No" button.
    7. Select clone root and invoke Team | Mercurial | Merge | Merge Changes main menu action and proceed merging the changes using merge tool defined in hgrc. Note that the tool would be executed if you had pressed "Yes" in preceding dialog.
    • EXPECTED RESULT: Verify that in Output tab there is
      "1 files updated, 0 files merged, 0 files removed, 0 files unresolved"
      and that the Original.java" is now present in the clone as well. Verify that you are able to commit and push changes to the original now.
  6. Fetch
    1. Modify some line in Original.java" in original and commit it.
    2. Modify the same line in Original.java" in clone differently and commit it.
    3. Select clone root and invoke Team | Mercurial | Fetch main menu action and proceed merging the changes using merge tool defined in hgrc.
    • EXPECTED RESULT: The Fetch command should do the same as Pull, Update and Merge, ie. the result should be the same as in previous test case but using only one step.


Test suite: Recover from erroneous commits

Purpose: This suite tests actions that can be used to recover from erroneous commits.
Setup: Initialize a new mercurial project.

  1. Backout
    1. Do some changes to the project (eg. modify "Main.java" somewhere) and commit it.
    2. Repeat previous step three times.
    3. Select "Main.java" and invoke Team | Mercurial | Recover | Backout... main menu action.
    4. Select the third revision from the "Choose from Revisions:" Combobox and push "Backout" button.
    5. Dialog informing that backout was proceeded and now merge is required appears. Push "Yes" button.
    6. "Main.java" should be marked as modified after the merge, commit the changes.
    • EXPECTED RESULT: Verify that "Main.java" does not contain changes made in revision 3 and that it is recorded in history.
  2. Rollback
    1. Select project root and invoke Mercurial | Show History popup menu action and push "Search" button. Remember the last revision number.
    2. Select "Main.java" and invoke Team | Mercurial | Recover | Rollback main menu action.
    3. A warning dialog appears and asks whether you are sure you want to rollback last revision in repository as there is no way to recover it afterwards. Push "Yes" button.
    4. After performing the rollback, another dialog appears asking whether you want to update your working copy. Push "No" button.
    5. Select project root and invoke Mercurial | Show History popup menu action and push "Search" button again.
    • EXPECTED RESULT: Verify that the last revision is no longer in history as it was rolled back. Verify also that invoking rollback on the same project won't do anything until there is new revision in your repository.
  3. Strip
    1. Select project root and invoke Mercurial | Show History popup menu action and push "Search" button. Remember the number of revisions.
    2. Select project root and invoke Team | Mercurial | Recover | Strip... main menu action.
    3. In "Choose from Revision:" combobox select the last but one revision and then push "Strip" button.
    4. Switch to "Mercurial History - <project_name>" tab and push the "Search" button again.
    • EXPECTED RESULT: Verify that last two revisions that were present in step 1 of this scenario are no longer there as they were stripped from repository.


Test suite: Archeology

Purpose: This suite tests "archeology" searching with various criteria.
Setup: No setup is necessary.
Note: Annotations will disappear after any action is invoked through them.

  1. 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 Hide Annotations actions listed in popup menu.
  2. 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 Hide 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".
  3. Show History
    1. Switch to "Projects" view and select project root.
    2. Invoke Mercurial | Show History popup menu action.
    • EXPECTED RESULT: "MercurialHistory" tab for this project should be displayed in editor area. Verify that there are text fields labeled "Message, "username", "From:" and "To:" and a "Search" button in upper part of this tab and "Summary" / "Diff" togglebutton, two difference navigating arrows and "Show merges" checkbox.
  4. Summary Functionality
    1. Make sure that "Summary" toggle button is pushed.
    2. Push Search button.
    • EXPECTED RESULT: Verify that all revisions are listed in "Summary" output area. Every revision should contain "revision number", "changeset", "username", "date" and "commit message" and "Diff", "Revert" and "Export Diff" links. Besides this, every file entry should have a letter at the beginning of its row meaning what happened with it and should have its location there.
  5. Summary Revision entry actions
    1. Select any revision and invoke popup menu.
    • EXPECTED RESULT: Verify that menu has two entries - "Diff to Prevoious Revision" and "Backout...". Behavior of both actions was decribed already.
  6. Summary File entry actions
    1. Select any file entry and invoke popup menu.
    • EXPECTED RESULT: Verify that menu has four entries - "Diff to Prevoious Revision", "Revert to <previous_revision>", "View" and "Export file Diff...". Behavior of all actions was decribed already.
  7. Diff Functionality
    1. Push "Diff" togglebutton.
    • EXPECTED RESULT: Table with columns "File Revision", "Time", "User" and Message should be displayed. You should be able to expand the first column nodes to see a list of all affected files in that revision.
  8. Diff revision actions
    1. Select any revision entry and invoke popup menu.
    • EXPECTED RESULT: "Backout..." and "List Options" actions should be available.
  9. Diff file actions
    1. Select any file entry and invoke popup menu.
    • EXPECTED RESULT: "Revert to <previous_revision>" and "List Options" actions should be available.



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" in Versioning Systems list.
    • 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 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.
  6. Manage Labels
    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
  7. Creating .orig files after Revert Modifications
    • Setup: Follow steps from "Invoking Mercurial Options" test case.
    1. Uncheck the "On Revert Modifications save Locally Modified files to <file>.orig" checkbox and press "OK".
    2. Modify some file, save it and revert it following Reverting modifications 1 test case.
    • EXPECTED RESULT: Verify that no .orig file was created for that file. Verify that it is created, if you check mentioned checkbox in options again.


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