TS 65 HG ST

NetBeans Mercurial Support Sanity Test Specification

Author: Peter Pis
Version: 1.3.0
Last update: 24.11.2008
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 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 Versioning | 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 Versioning from 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. "Mercurial"
    tab
    1. Invoke Window | Versioning | Mercurial from main menu.
    • EXPECTED RESULT: Verify that in
      "Mercurial"
      tab is opened.
  2. Update action
    1. Switch to "Files" view.
    2. Delete "Main.java".
    3. Invoke Versioning | 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"
  3. 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.
  4. Files/Folders differences
    1. Switch off View | Show Diff Sidebar option from main menu.
    2. Switch on View | Show Diff Sidebar option from main menu. Diff column should be shown in the left of side of editor.
    3. Create new package "xx.yy" in this project.
    4. Create new "java class" "NewClass" in package "xx.yy".
    5. Select the root of the project and invoke Versioning | Status from main menu.
    6. Files should be listed in "Mercurial" tab - "Main.java" and "NewClass".
    7. 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. Mercurial tab action
    1. Select the root of the project and invoke Mercurial | Status popup menu action.
    2. There should be icons with tooltips
      "Refresh Status"
      , {"Diff All"}, "Update All" and "Commit All".
    • EXPECTED RESULT: Verify the functionality of
      "Mercurial"
      tab actions. {"Refresh Status"} - refreshes the status of the selected files and folders. Files displayed in the Versioning window can be refreshed to reflect any changes that may have been made externally. "Diff All" - opens the Diff Viewer providing you with a side-by-side comparison of your local copies and the versions maintained in the repository. "Update All" - updates all selected files from the repository. "Commit All" - enables to commit local changes to the repository.
  6. Commit files/folders
    1. Switch to "Mercurial" 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.
  7. 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 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.
  8. 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.
  9. Create conflict
    1. Modify
      "Main.java"
      file and save it.
    2. Invoke Versioning | Mercurial | Clone Other... from main menu and setup the same parameters "Repository URL" for the initial clone - used in test suite Creating new project - test case - "Project import".
    3. In the 2nd step of "Clone Other..." wizard leave all values. Push "Next" button.
    4. Choose "Parent Directory" and "Clone Name" as desired (Clone Name - should not exist).
    5. Open the same project, modify
      "Main.java"
      class at the same line as in previous test suite, and commit it and invoke Mercurial | Share | Push Other main menu action.
    6. In upcoming dialog specify "Repository URL" - for the original project location. (It can be found out by "Project Properties" popup menu action invoked on project root - "Project Folder" field)
    • EXPECTED RESULT:
      "Confirm Push with Local Modifications"
      dialog should be displayed. Answer "YES". Path to {"Main.java"} file should be indicated with red badges. This file should change its color to red too.
  10. Resolve conflict
    1. Invoke Mercurial | Resolve conflicts popup menu action on
      "Main.java"
      node.
    2. Merging tool must get opened in editor area highlighting the line with conflict. Left pane should read
      "Working File"
      , right pane {"Remote File"} and bottom should read "Merge Result".
    3. Select left modification (the working one) and push
      "Accept"
      button above its pane.
    4. Make sure that colors changed to blue or green and
      "Unresolved"
      in top of the component says {"0 conflicts"}. Push "OK" button and confirm your decision.
    • EXPECTED RESULT: The data node should change back to
      "Main.java"
      and should have appropriate badge (blue badges for path). In addition, the merge tool must be closed.
  11. Conflict Resolved
    1. Do all steps -
      "Create conflict"
      test case.
    2. Invoke Mercurial | Status on project root.
    3. From within editor resolve manually all conflict by editing the
      "Main.java"
      file and save the file.
    4. Invoke Mark as Resolved popup menu action on
      "Main.java"
      node from {"Mercurial"} tab.
    • EXPECTED RESULT: The data node should change back to
      "Main.java"
      and should have appropriate badge (blue badges for path).
  12. 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.
  13. 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.
    4. "Commit"
      button should be disabled.
    5. Invoke Mercurial | Status action on the project root.
    6. From within
      "Mercurial"
      tab select both files of newly created JFrame and invoke Exclude from commit popup menu action.
    • 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.
  14. 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
  15. 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.
  16. 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.
  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 | 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 Versioning | 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 Versioning | 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 Versioning | 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 Versioning | 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 Versioning | 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 Versioning | 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: 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 Close 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 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".
  3. Show History
    1. Switch to "Projects" view and select project root.
    2. Invoke Mercurial | Show History popup menu action.
    • EXPECTED RESULT: "Mercurial History" 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 (for "0" revision there is only "Backout...")- "Diff to Prevoious Revision" and "Backout...". Behavior of both actions was decribed already. Verify all actions provided.
  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. "View" action displays file into editor area in appropriate revision. Verify all actions provided.
  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.
  10. Diff Arrows
    1. There should be two: UP and DOWN arrows displayed next to
      "Summary"
      and {"Diff"} buttons - make sure that they are enabled for "Diff" section only.
    • EXPECTED RESULT: Verify the functionality of each arrow. Make sure that each time arrow button is pushed current difference is moved forwards (backwards) accordingly.



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.


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