System Tests

Automated System Tests

1. BlueJalopy Format Code

Requirement Traceability

2.1.1, 2.2.2, 2.2.3, 3.1, 3.2, 3.3, 3.4, 3.7

Purpose

Verify that BlueJalopy can format a file correctly.

Procedure

  1. Ensure that your system has Java 1.4.2 SE or higher and BlueJ version 2.0 or newer.
  2. Ensure that your system has a processor of 600MHz or faster and a minimum of 64 megabytes of RAM.
  3. Ensure that your system does not have any Jalopy settings set (Delete the .jalopy.15 folder from your home directory, import BlankSlate.xml as a coding convention, or start BlueJ from a fresh install on a new computer).
  4. Start BlueJ with a copy of the unformatted format code test file.
  5. Right click the class and navigate to the BlueJalopy submenu.
  6. Click "Compile and Format".
  7. Perform a diff between the formatted and oracle format code test files.

Test Data

ActionInputOutput
Perform diff on format code test filesdiff formatTest formatTestOracleNo differences

2. BlueJalopy Menus Changed Appropriately

Requirement Traceability

2.2.3

Purpose

This feature changes BlueJalopy menus so that they are disabled when the function that they correspond to is unavailable.

Procedure

  1. Start BlueJ with the default testing project.
  2. Right click the AaronSwitch class and navigate to the BlueJalopy submenu. The first menu item should read "Format" and the "Undo" item should be disabled.
  3. Click "Format".
  4. Right click the class and navigate to the BlueJalopy submenu. The "Undo" item should now be enabled.

Test Data

No data necessary for this test.

3. BlueJalopy Format Undo

Requirement Traceability

2.2.4

Purpose

Verify that the undo feature works.

Procedure

  1. Start BlueJ with a copy of the unformatted Java code test file.
  2. Compile the class.
  3. Right click the class and navigate to the BlueJalopy submenu.
  4. Click "Format".
  5. Right click the class and navigate to the BlueJalopy submenu.
  6. Click "Undo".
  7. Perform a diff between the original and copy of the Java code test file.

Test Data

ActionInputOutput
Perform diff on Java code test filesdiff JavaTest1 JavaTest2No differences

4. BlueJalopy Format Undo Consecutive Files

Requirement Traceability

2.2.4

Purpose

Verify that the undo feature works on consecutive files.

Procedure

  1. Start BlueJ with 2 copies of two different unformatted Java code test files.
  2. Compile both classes.
  3. Right click the first class and navigate to the BlueJalopy submenu.
  4. Click "Format".
  5. Right click the second class and navigate to the BlueJalopy submenu.
  6. Click "Format".
  7. Right click first class and navigate to the BlueJalopy submenu.
  8. Click "Undo".
  9. Right click second class and navigate to the BlueJalopy submenu.
  10. Click "Undo".
  11. Perform a diff between the original and copy of both Java code test files.

Test Data

ActionInputOutput
Perform diff on first Java code test filesdiff JavaTest1 JavaTest2No differences
Perform diff on second Java code test filesdiff JavaTestA JavaTestBNo differences

5. BlueJalopy Format Undo Disable

Requirement Traceability

2.2.4

Purpose

Verify that the undo feature is disabled appropriately.

Procedure

  1. Start BlueJ with an unformatted Java code test file.
  2. Compile the class.
  3. Right click the class and navigate to the BlueJalopy submenu.
  4. Click "Format".
  5. Open the class editor window.
  6. Add the text "//new line of code" at the bottom of the text.
  7. Right click the class and navigate to the BlueJalopy submenu. "Undo" should be disabled and "Format" should now read "Compile and Format".

Test Data

No data necessary for this test.

6. Export Convention File

Requirement Traceability

2.2.5

Purpose:

  • To export a conventions file which allows for saving formatting configurations.

Procedure:

Follow the steps below:

Test Data:

ActionInputExpected Output
1. Open BlueJ with the BlueJalopy extension installed.N/ABlueJ main screen is displayed
2. Go to the Tools-->BlueJalopy-->Set ConventionsN/ATwo new dialog windows appear; both the preview pane and JALOPY_OPTIONS pane are visible
3. Under the General tab, click the "Add Button"N/AThe Add Convention Dialog box appears
4. Type in "C Style" for the name and "C Coding Convention" for the description and hit "OK"N/A "Test1" and "First Test Convention" appear in the Name and Description boxes
5. Under the Braces tab, select "C Style"N/AThe "C Style" checkbox is selected
6. Under the General tab, use the drop down box to change Source compatibility to "JDK 1.4"N/ASource compatibility now shows JDK 1.4 instead of JDK 5.0
7. Click Export. N/AThe Export Dialog appears
8. Enter "./CStyle.xml" in the export dialog boxN/AExport dialog box now displays "./CStyle.xml"
9. Click OKN/A"CStyle.xml" exists in the current directory
10. Click RemoveN/A"default" appears in the name box and "JDK 5.0" appears in the source compatibility box


7. Import Convention File

Requirement Traceability

2.2.5

Purpose:

  • To import a conventions file to restore saved formatting configurations.

Procedure:

Follow the steps below: (Note: if you have not exported a configuration file to the Desktop, please follow the steps in the export configuration file System Test Case first)

Test Data:

ActionInputExpected Output
1. Perform the steps in system test 1: Export Convention FileN/A"CStyle.xml" should exists in the working directory
6. Under the General tab, click on the Import buttonN/AImport Code Convention dialog is now displayed
7. From this import dialog box, click browseN/AFile system navigation pane is now displayed
8. Navigate to the working directoryN/A"CStyle.xml" now shown
9. Choose "CStyle.xml" and click OK|IN/AN/AImport Code Convention dialog is now shown with "working_directory/CStyle.xml" as the file to be opened
10. Click OKN/AThe add dialog appears
In Progress
11. Verify that JDK 1.4 is now displayed as the source compatibilityN/ACustomized convention should now be loaded

8. Changing Formatting Preferences

Requirements Traceability

2.2.5

Purpose

To check if changes made to the Jalopy formatting preferences are reflected when a user reformats code after these preferences were changed.

Procedure

Format source code. Change the preferences of Jalopy. Reformat the source code. Examine the source code to see if it reflects the new formatting preferences.

Test Data

Action Input Expected Output
1. Start BlueJ N/A The BlueJ window appears.
2. Open a Project N/A The project appears in the BlueJ window.
3. Right click on class file and select "Compile and Format" N/A Class now is formatted.
4. Double click on formatted class file. N/A Class file appears in a text file.
5. Examine formatted class file. N/A The code should be formatted according to the original options.
6. Select BlueJ | Preferences N/A The BlueJ preferences dialog appears.
7. Click on the Extensions tab, and click "BlueJalopy Conventions". N/A The Jalopy preferences dialog appears.
8. Select formatting options, and click OK
Note that the formatted preview tab reflects these new options.
N/A The Jalopy preferences dialog disappears.
9. Right click on class file and select "Format" N/A Class now is reformatted.
10. Double click on formatted class file. N/A Class file appears in a text file.
11. Examine formatted class file. N/A The code should now be formatted according to the new options.

9. Getting Online Help

Requirements Traceability

4.2

Purpose

To check that help is available from the Jalopy preferences dialog.

Procedure

  1. Start BlueJ.
  2. Go to Tools, then Preferences.
  3. Go to the Extensions tab and click BlueJalopy Conventions.
  4. Perform steps 5-6 for each of the settings sections in the table under Test Data.
  5. Go to a settings section. Click the specified help link.
  6. Confirm that your browser is opened at the correct help URL.

Test Data

Settings Section Corresponding Help URL
General > Convention http://wiki.csc.calpoly.edu/Ostrich/wiki/UserManualRevision#Convention
General > Compliance http://wiki.csc.calpoly.edu/Ostrich/wiki/UserManualRevision#Compliance
Braces > General > Style http://jalopy.sourceforge.net/existing/printer.html#braces-style-styles
Braces > General > Wrapping http://jalopy.sourceforge.net/existing/printer.html#braces-wrapping
Braces > General > White Space http://jalopy.sourceforge.net/existing/printer.html#braces-whitespace
Braces > Misc > Insert braces http://jalopy.sourceforge.net/existing/printer.html#braces-insert
Braces > Misc > Remove braces http://jalopy.sourceforge.net/existing/printer.html#braces-remove
Braces > Misc > Empty braces http://jalopy.sourceforge.net/existing/printer.html#braces-empty
Header > General http://wiki.csc.calpoly.edu/Ostrich/wiki/UserManualRevision#General1
Header > Blank Lines http://wiki.csc.calpoly.edu/Ostrich/wiki/UserManualRevision#BlankLines
Header > Text http://wiki.csc.calpoly.edu/Ostrich/wiki/UserManualRevision#Text

10. Code Formatting Speed

Requirements Traceability

3.5

Purpose

To check that BlueJalopy is capable of formatting code at a rate of at least 200 lines per second.

Procedure

Format longCodeTest, check that the format takes 50 seconds or less.

Test Data

Action Input Expected Output
1. Start BlueJ N/A The BlueJ window appears.
2. Open a Project N/A The project appears in the BlueJ window.
3. Add the class longCodeTest.java to a BlueJ project Directory N/A N/A
4. Double click on the longCodeTest class in the package window N/A An editor for longCodeTest should appear.
5. Right click on the longCodeTest class in the package windo and select "Compile and Format" N/A Class should begin formatting.
6. Time the format process (from clicking "Compile and Format" to when the editor window updates with formatted code). N/A Format should take 50 seconds or less

11. Format Multiple Files

Requirements Traceability

2.2.2

Purpose

To check that BlueJalopy's "Format Selected", "Format Package", and "Format Project" options operate successfully.

Procedure

Remove all non-default conventions from BlueJalopy. Note: formatted class files for ClovasFormat contain this format:

Test Data

Action Input Expected Output
1. Open the BlueJ project ClovasFormat with BlueJalopy installed N/A The BlueJalopy project should appear
2. Select Both Class1 and Class2 and click on Tools|BlueJalopy|Format Selected N/A N/A
3. Verify that the Class1 and Class2 are formatted N/A Class1 and Class2 are formatted
4. Right click on Class1 and select Undo N/A Class1 is unformatted
6. Right click on Class2 and select Undo N/A Class2 is unformatted
7. Click on Tools|BlueJalopy|Format Project N/A N/A
8. Verify that Class1, Class2, and Class 3 are formatted N/A Class1, Class2, and Class3 are formatted
9. Right click on Class1 and select Undo N/A Class1 is unformatted
10. Right click on Class2 and select Undo N/A Class2 is unformatted
11. Right click on Class3 and select Undo N/A Class3 is unformatted
12. Open the package pkg N/A Package window for pkg appears
13. Verify that ClassA and ClassB are formatted N/A ClassA and ClassB are formatted
14. Right click on ClassA and select Undo N/A ClassA is unformatted
15. Right click on ClassB and select Undo N/A ClassB is unformatted
16. Click on Tools|BlueJalopy|Format Package N/A N/A
17. Verify that ClassA and ClassB are formatted N/A ClassA and ClassB are formatted
18. Right click on ClassA and select Undo N/A ClassA is unformatted
19. Right click on ClassB and select Undo N/A ClassB is unformatted

12. Adding/Removing Conventions

Requirements Traceability

2.2.5

Purpose

To check that adding new conventions to BlueJalopy work properly.

Procedure

Remove all non-default conventions from BlueJalopy.

Test Data

Action Input Expected Output
1. Open BlueJ with the BlueJalopy extension installed.N/ABlueJ main screen is displayed
2. Go to the Tools-->BlueJalopy-->Set ConventionsN/ATwo new dialog windows appear; both the preview pane and JALOPY_OPTIONS pane are visible
3. Under the General tab, click the "Add Button"N/AThe Add Convention Dialog box appears
4. Type in "Test1" for the name and "First Test Convention" for the description and hit "OK"N/A "Test1" and "First Test Convention" appear in the Name and Description boxes
5. Under the Braces tab, select "C Style" and click "Apply"N/AThe "C Style" checkbox is selected
6. Under the General tab, select "default" from the name boxN/A"default" in the Name box
7. Under the Braces tab, check if "Sun Style" is selectedN/AThe "Sun Style checkbox" is selected
8. Under the General tab, select "Test1" from the name boxN/AThe drop down box should display "Test1"
9. Click the "Remove" buttonN/A"default" should now be displayed in the drop down box

13. Insert Header

Requirement Traceability

2.3.6.6

Purpose

Verify that BlueJalopy can correctly insert a header into a source code file.

Procedure

  1. Start BlueJ
  2. Open a project containing an unformatted source code file
  3. Click on Tools-->Preferences....
  4. In the Preferences dialog box, click on the Extensions tab, and then click on the BlueJalopy Conventions dialog box.
  5. In the dialog box titled "JALOPY_OPTIONS," click on the Header section on the left hand portion of the dialog box.
  6. Click on "Use Header"
  7. Set "Blank lines after:" to 1
  8. Type the following text in the text box located in the Text section:
    /*
     * This is a test of the header feature.  This is only a test.
     */
    
  9. Click "OK"
  10. Compile the class
  11. Right click on the class and select BlueJalopy->Format
  12. Perform a diff between the expected output and the actual output.

Test Data

ActionInputOutput
Perform diff on Java code test filesdiff JavaTest1 JavaTest2No differences

Attachments