TS 72 Diff

Diff Test Specification for NetBeans 7.2

Author: Štěpán Žebra
Version: 1.0
Last update: 2.5.2012
Introduction: Diff module provides ability to find and highlight differences between two files. This document describes how this module should be tested in order to verify all of its functionality.
Comments: This document is heavily based on TS_61_Diff which is now obsolete.

Contents


Test suite: Diff sidebar (Inline diff)

Purpose: This suite tests functionality of inline diff in editor.
Setup: Open a project versioned in any version control system supported by NetBeans (Git, Mercurial, Subversion) and open some .java file into the editor.

  1. Diff sidebar
    1. Invoke View from main menu and make sure that Show Diff Sidebar is checked.
    2. Insert several brand-new lines somewhere into the file.
    3. Delete some other lines, but not directly next to those new lines.
    4. Modify another line but not directly next to the lines mentioned above.
    • EXPECTED RESULT: All differences must be highlighted in a sidebar located before beginning of each line. New lines are marked green, line where are missing removed lines is marked with red triangle and modified lines are marked blue.
  2. Differences
    1. Move the mouse cursor to those colored marks and don't move it for a while. A hint should appear with message how many lines were added, deleted or changed.
    2. Click on any of those colored marks. Floating toolbar with four icons should appear.
    3. If the clicked mark was blue or red, there will be also blue or red area below the toolbar with original text before the change.
    4. Try using the up and down arrows. Every time you use either of them, you should jump to previous or next difference in that file.
    5. Click on the revert arrow (the third one in floating toolbar). The mark should disappear and the change should be reverted. Note that you can use undo action to redo the change.
    6. Click the diff icon (the fourth one) on the floating toolbar.
    • EXPECTED RESULT: New tab in editor should be opened. It will be described in detail in next suite.


Test suite: Editable diff

Purpose: This suite tests functionality of diff view in editor.
Setup: Open the diff tab as described in previous suite.

  1. Diff view
    1. The newly opened editor tab should contain a toolbar with arrows for navigating among differences and a split pane. It should have base revision of that file in the left pane and locally version of that file in the right pane. The left pane shouldn't be editable while the right one should be.
    2. It should have base revision of that file in the left pane and locally version of that file in the right pane.
    3. There should be also a label with two numbers divided by slash in above of the middle of the pane screen. The first number is currently displayed difference and the second is the total number of differences.
    • EXPECTED RESULT: The left pane shouldn't be editable while the right one should be. Verify that the right diff pane is a fully functional editor with semantic coloring, code completion, undo / redo, etc.
  2. Using the Diff view
    1. The differences are again marked with three colors - new lines are marked green, deleted lines are marked red and modified lines are marked blue. If there are only some changes on lines and no new lines were added, only the changed words are marked blue on those lines.
    2. There is an arrow next to the first line of each difference with deleted or modified (blue or red) lines in the left diff pane. Similarly there is a red cross next to the first line of each difference with new (green) lines in the right diff pane. There is also a different arrow below the label with difference count.
    3. Use described arrow and cross for each type of difference.
    • EXPECTED RESULT: Verify that the marked lines in the right diff pane were reverted to the state they were before the change. Push the arrow below below the label with difference count. The result should be as if you would push all arrows and crosses to revert the whole file to the state it was before those changes.
  3. Navigating among differences
    1. Use arrows in the toolbar to navigate among the differences. They should be enabled only if there is more than one difference.
    2. Currently selected difference can be distinguished from the others by the bold boundary lines. You can also see the sequence number of the difference on the previously mentioned label.
    • EXPECTED RESULT: Verify that the "DOWN" arrow is disabled if you are on the last difference in file. Similarly the "UP" arrow should be disabled if you are on the first difference.


Test suite: Diffing common files

Purpose: This suite tests functionality of diff used on two files not versioned by any versioning system.
Setup: No special setup is needed.

  1. Diff two files
    1. Select two files at once from the Projects view (Hold CTRL key while clicking on these two files).
    2. Invoke Tools | Diff either from context or main menu.
    • EXPECTED RESULT: Verify that the diff view appeared. It should be the same diff view as described in one of previous suites with all its functionality.


Test suite: Diff Options

Purpose: This suite tests functionality of Diff Options.
Setup: Open the diff tab as described in Diff sidebar suite.

  1. Invoking Options
    1. Invoke Tools | Options from main menu.
    2. Push "Miscellaneous" button.
    3. Expand "Diff" node.
    • EXPECTED RESULT: There should be "Internal Diff" and "External Diff" radio buttons, "Ignore Whitespaces" checkbox and a textfield with "Browse" button on the same line.
  2. External Diff
    1. Select the "External Diff" radiobutton. This should result in enabling "Command" textfield and "Browse" button.
    2. If you don't have path to external diff tool in your PATH variable, you can use the "Browse" button to specify its location.
    3. Confirm your choice by pressing "OK" button.
    • EXPECTED RESULT: Verify that the diff view you have opened doesn't change at all. It should mark the differences in the same way as the internal diff.
  3. Ignore Whitespaces
    1. Open Diff Options again.
    2. Check the "Ignore Whitespaces" checkbox.
    3. Confirm your choice by pressing "OK" button.
    4. Make some spaces on some line and save the file.
    • EXPECTED RESULT: The line shouldn't be marked as different. Should you uncheck the "Ignore Whitespaces" and make some spaces again, it should be marked as modified line.
  4. Color Options
    1. Invoke Tools | Options from main menu.
    2. Push "Fonts & Colors" button.
    3. Select the "Diff" tab.
    • EXPECTED RESULT: There should be table with colors for different types of differences on the second one. Verify that the changes have proper effect in "Diff view". Changes of colors don't affect colors of the "Diff sidebar"!
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