- System Tests
- 1. BlueJalopy Format Code
- 2. BlueJalopy Menus Changed Appropriately
- 3. BlueJalopy Format Undo
- 4. BlueJalopy Format Undo Consecutive Files
- 5. BlueJalopy Format Undo Disable
- 6. Export Convention File
- 7. Import Convention File
- 8. Changing Formatting Preferences
- 9. Getting Online Help
- 10. Code Formatting Speed
- 11. Format Multiple Files
- 12. Adding/Removing Conventions
- 13. Insert Header
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
- Ensure that your system has Java 1.4.2 SE or higher and BlueJ version 2.0 or newer.
- Ensure that your system has a processor of 600MHz or faster and a minimum of 64 megabytes of RAM.
- 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).
- Start BlueJ with a copy of the unformatted format code test file.
- Right click the class and navigate to the BlueJalopy submenu.
- Click "Compile and Format".
- Perform a diff between the formatted and oracle format code test files.
Test Data
| Action | Input | Output |
| Perform diff on format code test files | diff formatTest formatTestOracle | No 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
- Start BlueJ with the default testing project.
- 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.
- Click "Format".
- 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
- Start BlueJ with a copy of the unformatted Java code test file.
- Compile the class.
- Right click the class and navigate to the BlueJalopy submenu.
- Click "Format".
- Right click the class and navigate to the BlueJalopy submenu.
- Click "Undo".
- Perform a diff between the original and copy of the Java code test file.
Test Data
| Action | Input | Output |
| Perform diff on Java code test files | diff JavaTest1 JavaTest2 | No differences |
4. BlueJalopy Format Undo Consecutive Files
Requirement Traceability
2.2.4
Purpose
Verify that the undo feature works on consecutive files.
Procedure
- Start BlueJ with 2 copies of two different unformatted Java code test files.
- Compile both classes.
- Right click the first class and navigate to the BlueJalopy submenu.
- Click "Format".
- Right click the second class and navigate to the BlueJalopy submenu.
- Click "Format".
- Right click first class and navigate to the BlueJalopy submenu.
- Click "Undo".
- Right click second class and navigate to the BlueJalopy submenu.
- Click "Undo".
- Perform a diff between the original and copy of both Java code test files.
Test Data
| Action | Input | Output |
| Perform diff on first Java code test files | diff JavaTest1 JavaTest2 | No differences |
| Perform diff on second Java code test files | diff JavaTestA JavaTestB | No differences |
5. BlueJalopy Format Undo Disable
Requirement Traceability
2.2.4
Purpose
Verify that the undo feature is disabled appropriately.
Procedure
- Start BlueJ with an unformatted Java code test file.
- Compile the class.
- Right click the class and navigate to the BlueJalopy submenu.
- Click "Format".
- Open the class editor window.
- Add the text "//new line of code" at the bottom of the text.
- 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:
| Action | Input | Expected Output |
| 1. Open BlueJ with the BlueJalopy extension installed. | N/A | BlueJ main screen is displayed |
| 2. Go to the Tools-->BlueJalopy-->Set Conventions | N/A | Two new dialog windows appear; both the preview pane and JALOPY_OPTIONS pane are visible |
| 3. Under the General tab, click the "Add Button" | N/A | The 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/A | The "C Style" checkbox is selected |
| 6. Under the General tab, use the drop down box to change Source compatibility to "JDK 1.4" | N/A | Source compatibility now shows JDK 1.4 instead of JDK 5.0 |
| 7. Click Export. | N/A | The Export Dialog appears |
| 8. Enter "./CStyle.xml" in the export dialog box | N/A | Export dialog box now displays "./CStyle.xml" |
| 9. Click OK | N/A | "CStyle.xml" exists in the current directory |
| 10. Click Remove | N/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:
| Action | Input | Expected Output |
| 1. Perform the steps in system test 1: Export Convention File | N/A | "CStyle.xml" should exists in the working directory |
| 6. Under the General tab, click on the Import button | N/A | Import Code Convention dialog is now displayed |
| 7. From this import dialog box, click browse | N/A | File system navigation pane is now displayed |
| 8. Navigate to the working directory | N/A | "CStyle.xml" now shown |
| 9. Choose "CStyle.xml" and click OK|IN/A | N/A | Import Code Convention dialog is now shown with "working_directory/CStyle.xml" as the file to be opened |
| 10. Click OK | N/A | The add dialog appears |
| In Progress | ||
| 11. Verify that JDK 1.4 is now displayed as the source compatibility | N/A | Customized 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
- Start BlueJ.
- Go to Tools, then Preferences.
- Go to the Extensions tab and click BlueJalopy Conventions.
- Perform steps 5-6 for each of the settings sections in the table under Test Data.
- Go to a settings section. Click the specified help link.
- Confirm that your browser is opened at the correct help URL.
Test Data
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/A | BlueJ main screen is displayed |
| 2. Go to the Tools-->BlueJalopy-->Set Conventions | N/A | Two new dialog windows appear; both the preview pane and JALOPY_OPTIONS pane are visible |
| 3. Under the General tab, click the "Add Button" | N/A | The 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/A | The "C Style" checkbox is selected |
| 6. Under the General tab, select "default" from the name box | N/A | "default" in the Name box |
| 7. Under the Braces tab, check if "Sun Style" is selected | N/A | The "Sun Style checkbox" is selected |
| 8. Under the General tab, select "Test1" from the name box | N/A | The drop down box should display "Test1" |
| 9. Click the "Remove" button | N/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
- Start BlueJ
- Open a project containing an unformatted source code file
- Click on Tools-->Preferences....
- In the Preferences dialog box, click on the Extensions tab, and then click on the BlueJalopy Conventions dialog box.
- In the dialog box titled "JALOPY_OPTIONS," click on the Header section on the left hand portion of the dialog box.
- Click on "Use Header"
- Set "Blank lines after:" to 1
- 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. */
- Click "OK"
- Compile the class
- Right click on the class and select BlueJalopy->Format
- Perform a diff between the expected output and the actual output.
Test Data
| Action | Input | Output |
| Perform diff on Java code test files | diff JavaTest1 JavaTest2 | No differences |
Attachments
- JavaTest1.java (0.7 kB) -
Java Code Test File
, added by bblonski on 04/17/08 02:05:51. - JavaTestA.java (400 bytes) -
Java Code Test File
, added by bblonski on 04/17/08 02:06:29. - testFormat.java (119 bytes) -
Starting file for test formatting.
, added by cehansen on 04/30/08 22:46:28. - longCodeTest.java (48.9 kB) -
Changed contents of longCodeTest to contain the correct class name.
, added by cehansen on 05/01/08 11:20:08. - BlankSlate.xml (118 bytes) -
Simulates a fresh install's options.
, added by cehansen on 05/01/08 11:47:32. - testFormatOracle.java (161 bytes) -
Updated version of the file that represents a format with no preferences set.
, added by cehansen on 05/01/08 11:51:38. - MultipleFileTest.zip (5.2 kB) -
.zip file containing project for Test 11.
, added by cehansen on 05/22/08 08:00:14. - MultipleFileTestSwitch.zip (8.1 kB) -
Added MultipleFileTest zipped project with a switch statement in Package0Class1.java
, added by awaechte on 05/27/08 21:13:15. - ClovasFormattedFile.java (102 bytes) -
Example formatted file for System Test 11.
, added by cehansen on 06/02/08 13:16:55.
