System Test Cases
Test Case #1
Requirement Traceability:
2.1.1. Format source code in the BlueJ editor window on demand
2.1.5. Give the user the ability to undo/restore file immediately after a format is executed
Purpose:
Test that a format action properly updates the editor of a BClass and enables/disables the undo menu item properly.
Procedure:
- Download the test project directory from SVN.
- Open BlueJ with ChangeStyle installed.
- Open the test project.
- Reset ChangeStyle to DalbeyStyle through the Extensions Tab in BlueJ’s Preferences dialog.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| Double-click on Test1 | The BlueJ editor window appears with Undo button disabled | |
| Click back to main BlueJ window | BlueJ main window gains focus | |
| Right-click Test1 | Class context menu appears with ChangeStyle as an option | |
| Click on ChangeStyle | Sub-menu appears with Format enabled and Undo disabled | |
| Click on Format | Text in editor window is formatted (to match Test1.txt)and the Undo button is enabled. May take effect on next step | |
| Click on editor window | Editor gains focus | |
| Open a command window or terminal | ||
| Enter the command | (UNIX) diff <TestDir>/Test1.java <TestDir>/Test1.txt (Windows) fc <TestDir>/Test1.java <TestDir>/Test1.txt | No output or differences should be detected if the format action was performed correctly. |
Test Case #2
Requirement Traceability:
2.1.2. The user can edit the Style Preferences through the Style Preference Configuration File or GUI interface.
2.1.3. The user may specify Style Preferences or use default Style Preferences.
2.1.4. Presents the user the option to choose from preset Style Preferences (such as the GNU or JAVA styles) as well as user's Style Preferences.
Purpose:
To show how the user can change between different Style Preferences as well as user’s Style Preferences.
Procedure:
- Open BlueJ with ChangeStyle installed.
- Create a new project.
- Create a new Class
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| In main BlueJ window, click the ’Tools’ located in the menu across the top of the screen | A pull-down menu appears | |
| Select and click ‘Preferences…’ | A pop up window appears giving information about preferences | |
| Find and click on the ‘Extensions’ tab | The tab should change and you should see different detail sections for each extentsion | |
| Under the ChangeStyle detatil section, click the button labeled ‘Edit...’ | A ‘Custom Settings’ pop-up window and a ‘Preview’ pop-up window should appear | |
| Looking over the ‘Custom Settings’ pane, you can find under the ‘Braces’ default option, ‘Styles’ option, different preset styles to choose from or you can go through each option and create your own style preferences | After selecting ‘Ok’ when a format is invoked, the code should be formatted according to the chosen style |
Test Case #3
Requirement Traceability:
2.1.6. Support all standard BlueJ class types {Class, Abstract Class, Interface, Applet, Unit Test, Enum}.
2.1.13. ChangeStyle only formats files ending in '.java'.
Purpose:
Test that format works on each BlueJ class type.
Procedure:
- Download the test project directory from SVN.
- Open BlueJ with ChangeStyle installed.
- Open the test project.
- Use the Tools/Preferences menu to select the Sun Style convention.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| Click on the Compile button | All classes are compiled | |
| Using the Tools menu click on ChangeSyle | Sub-menu appears with Format Entire Project enabled | |
| Click on Format Entire Project | The classes are formatted | |
| Now try to right click on the paper icon in the environment. | You will notice that a menu doesn’t pop up offering the formatting option, since the file is a .txt file | |
| Use diff or fc to confirm the format from a terminal or command prompt | diff <testProject>/*.java <testProject>/*.txt | No differences should appear |
Test Case #4
Requirement Traceability:
2.1.7. Available External Documentation (user manual).
Purpose:
Show where to locate available external documentation.
Procedure:
- Open BlueJ with ChangeStyle installed.
- Create a new project.
- Reset Jalopy to its default settings through the Extensions Tab in BlueJ's Preferences dialog.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| In main BlueJ window, click the help tab at the top of the screen | A pull-down menu appears | |
| Select and click ‘Installed Extensions’ | A pop up window appears giving information about all the installed extensions | |
| Click on the bubble with the question mark inside of it (next to the status column of the ChangeStyle installed extension) | A pop up window should occur giving Extension Details | |
| Click on the link provided next to the ‘More Information At:’ label | A web browser should pop up, open to Luna’s Home Page | |
| Find and click on the ‘User Manual’ link pertaining to your version of the ChangeStyle extension | Webpage opened to the User Manual |
Test Case #5
Requirement Traceability:
2.1.12. The formatter can only be run on compilable code.
Purpose:
Tests the formatter for safety when handling uncompiled code.
Procedure:
- Download the test project directory from SVN.
- Open BlueJ with ChangeStyle installed.
- Open the test project.
- Reset ChangeStyle to DalbeyStyle through the Extensions Tab in BlueJ’s Preferences dialog.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Double-click on Test1 | The editor window appears for Test1. | |
| 2. Click anywhere in the text area of the editor | A blinking vertical curser appears where you clicked. | |
| 3. Press the Space Bar on the keyboard | A space is inserted | |
| 4. Press the Backspace key on the keyboard | The added space is deleted | |
| 5. Click on the main BlueJ window | BlueJ main window gains focus and Test1 appears shaded (uncompiled) | |
| 6. Right-click on Test1 | Class context menu appears | |
| 7. Click on ChangeStyle | Sub-menu appears | |
| 8. Verify that Format is disabled | The Format option should appear grey with the text (not compiled) | |
| 9. Click on the Format option | Nothing should happen and the menu should stay visible | |
| 10. Click on the Compile button | Test1 is compiled | |
| 11. Repeat steps 6 & 7 | Format should be enabled now | |
| 12. Click on Format | the class is formatted | |
| 12. Use diff or fc to confirm the format from a terminal or command prompt | diff <testProject>/*.java <testProject>/*.txt | No differences should appear |
Test Case #6
Requirement Traceability:
3.0.1. Minimum: 64MB main memory, Pentium II processor or equivalent Recommended: 128MB main memory, 400MHz Pentium III processor or above
Purpose:
Verify that ChangeStyle will operate on a computer meeting the system specifications.
Procedure:
- Look up the computers memory and the processor information.
- Follow the steps below:
Test Data:
| Action | Input | Expected Output |
| Look up main memory | Minium 64MB of memory | |
| Look up processor | Pentium II or equivalent | |
| Verify both processor and main memory meet or exceed minimum requirements | Pentium II or equivalent, 64MB of memory | |
| Run BlueJ | BlueJ opens. | |
| Verify ChangeStyle is installed: Help->Installed Extensions | ChangeStyle should be displayed under Installed Extensions. |
Test Case #7
Requirement Traceability:
3.0.2. Does not take more than 10 seconds to format 1000 lines of code.
Purpose:
Verify that ChangeStyle takes 1 seconds or less to format 100 lines of code.
Procedure:
- Format a class that has about than 100 lines of code. Since comments can be formatted as well they are included.
- Follow the steps below:
Test Data:
| Action | Input | Expected Output |
| Start BlueJ | BlueJ window open | |
| Open testcase07.java | Class should appear in BlueJ window | |
| Open Timer | Timer should be at 00:00:00 | |
| Start Timer and Format testCase07.java | Confirm button should appear | |
| Stop Timer when comfirm button apears | Timer should disply less than 00:00:01.00 or 1 second. |
Test Case #8
Requirement Traceability:
3.0.3. J2SE 1.5.0 (Java 2 SDK version 1.5.0) or newer must be installed.
3.0.4. Works on BlueJ 2.2 or newer
Purpose:
- Verify that the computer has J2SE 1.5.0 (Java 2 SDK version 1.5.0) or newer must be installed.
- Verify that the computer has BlueJ 2.2 or newer.
- Verify that ChangeStyle operates when requirements are met.
- Follow the steps below:
Test Data:
| Action | Input | Expected Output |
| Verify Java Runtime Environment meets requirements. | J2SE 1.5.0 {Java 2 SDK version 1.5.0) or newer | |
| Verify BlueJ version number meets requirements | BlueJ 2.2 or newer | |
| Run BlueJ | BlueJ UI opens. | |
| Verify ChangeStyle is installed: Help->Installed Extensions | ChangeStyle should be displayed in Installed Extensions |
Test Case #9
Requirement Traceability:
3.0.5. Only tested on Windows XP (SP2) and Mac OSX and Red Hat Linux
Purpose:
- Checks to see if ChangeStyle was downloaded and works for Windows XP (SP2), Mac OSX and Red Hat Linux.
Procedure:
Follow the steps below:
Test Data:
| Action | Input | Expected Output |
| Download ChangeStyle as a BlueJ extension | ||
| Open BlueJ | Class should appear in BlueJ window | |
| Open Help | Help window will open | |
| Click on Installed Extensions | BlueJ:Installed Extensions windo will open | |
| Window will say loaded ChangeStyle | ||
| Format testCase09.java | Confirm window will open, saying class has been formatted. | |
| Do this for all System, Windows XP (SP2), Mac OSX and Red Hat Linux |
Test Case #10
Requirement Traceability:
3.0.10
Purpose:
To verify that ChangeStyle requires that a Java Runtime Environment be installed to run.
Procedure:
- Verify that the computer you are working on does not have a Java Runtime Environment installed. If there is one installed, then uninstall it.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| Attempt to download and install BlueJ using the instructions here: http://www.bluej.org/download/download.html | BlueJ should not be able to install. |
Test Case #11
Requirement Traceability:
3.0.11
Purpose:
To verify that ChangeStyle’s mean time between defects is greater than 30 formats.
Procedure:
- Open BlueJ. If BlueJ is not installed follow the instructions here: http://www.bluej.org/download/download.html to download and install it.
- Check if ChangeStyle is installed by clicking “Help->Installed Extensions” on the menu panel and verifying that “ChangeStyle” is on the list of extensions and is “loaded”. If ChangeStyle is not installed follow the instructions here: http://wiki.csc.calpoly.edu/Luna/wiki/download to download and install it.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| Start BlueJ by clicking on its executable file. | A BlueJ Project Window should appear. | |
| Click “Project->New Project” in the BlueJ menu panel. | A Create Project Window should appear. | |
| Name the Project “DefectTest” and click “Create”. | DefectTest | A new Project Window with no Class boxes in it should appear. |
| Click on “New Class” on BlueJ’s left side panel. | A Create New Class Window should appear. | |
| Name the class “DefectTestClass” and click “OK”. | A “box” with the name “DefectTestClass” in the Project Window should appear. | |
| Right-Click the “DefectTestClass” box and click “Compile”. | The box should appear plain, not having diagonal lines through it. | |
| Right-Click the “DefectTestClass” box, scroll down to “ChangeStyle”, and click “Format” | If BlueJ freezes or closes prematurely record that a defect occurred and the time. | |
| Click on “Tools->ChangeStyle-> Format” in the BlueJ menu panel. | If BlueJ freezes or closes prematurely record that a defect occurred and the time. | |
| Repeat the previous two steps 30 more times. (Formatting the code) | ||
| After 30 or more formats record how many total defects occurred. | Defects <= 1 |
Test Case #12
Requirement Traceability:
3.0.12
Purpose:
To verify that ChangeStyle does not format on uncompilable .java files.
Procedure:
- Open BlueJ. If BlueJ is not installed follow the instructions here: http://www.bluej.org/download/download.html to download and install it.
- Check if ChangeStyle is installed by clicking “Help->Installed Extensions” on the menu panel and verifying that “ChangeStyle” is on the list of extensions and is “loaded”. If ChangeStyle is not installed follow the instructions here: http://wiki.csc.calpoly.edu/Luna/wiki/download to download and install it.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| Start BlueJ by clicking on its executable file. | A BlueJ Project Window should appear. | |
| Click “Project->New Project” in the BlueJ menu panel. | A Create Project Window should appear. | |
| Name the Project “FormatTest” and click “Create”. | FormatTest | A new Project Window with no Class boxes in it should appear. |
| Click on “New Class” on BlueJ’s left side panel. | A Create New Class Window should appear. | |
| Name the class “FormatTestClass” and click “OK”. | A “box” with the name “FormatTestClass” in the Project Window should appear. | |
| Double click on the “FormatTestClass” box. | A Class Editor Window should appear. | |
| Type “not valid code” as the first line of the Class and close the Editor Window. | not valid code | The Class Editor Window should disappear. |
| Right-Click the “FormatTestClass” box and scroll down to “ChangeStyle”. | A grayed-out button that says “Format (not compiled)” should appear. | |
| Click on “Tools->ChangeStyle” in the BlueJ menu panel. | A grayed-out button that says “Format (not compiled)” should appear. |
Test Case #13
Requirement Traceability:
3.0.14. ChangeStyle does not add any new expressions to the formatted code.
Purpose:
- Verify the formatting function will not change the source code in a functional way.
Procedure:
- Open BlueJ.
- Create a new project containing the following class:
TestCase3014.java
- Follow the steps below:
Test Data:
| Action | Input | Expected Output |
| Start BlueJ. | The BlueJ main window appears. | |
| Open the project containing TestCase3014.java. | The new project window is displayed. | |
| Run the class. | "Hello World! 1 2 3 4 5 6 7 8 9 10" | |
| Change the brace style to GNU. | ||
| Right click on the class TestCase3014 and select ChangeStyle | Format. | The class should now be displayed as uncompiled. | |
| Compile and run the class. | "Hello World! 1 2 3 4 5 6 7 8 9 10" | |
| Open the Editor window and verify no new expressions were added to the code. | The formatting should have only changed, no new expressions displayed. |
File: TestCase3014.java
public class TestCase3014 {
public static void main(String[] args) {
System.out.println("Hello World!");
for(int i=1; i<=10; i++) {
System.out.println(i);
}
}
}
Test Case #14
Requirement Traceability:
3.0.16. A Computer Science student can download and install ChangeStyle in less than 30 minutes on a computer that has BlueJ already installed.
Purpose:
- Verify the the user can install ChangeStyle in less than 30 minutes.
Procedure:
- Open the ChangeStyle website.
- Download the most recent ChangeStyle jar file.
- Follow the installation instructions found on the Luna website.
- Verify ChangeStyle is installed and detected by BlueJ.
Test Data:
| Action | Input | Expected Output |
| Open Luna Software's website. http://wiki.csc.calpoly.edu/Luna/wiki | The main wiki page for Luna Software is displayed. | |
| Click on the link "Download ChangeStyle". | The download page is displayed. | |
| Download the latest version and follow the installation instructions listed on the bottom of the page | ChangeStyle should now be installed. | |
| Run BlueJ. | The main BlueJ window is displayed. | |
| Click on Help -> Installed Extensions. | The Installed Extensions window is displayed. | |
| Verify ChangeStyle is listed and the status displays "loaded." | ||
| Calculate the time spent installing. | The install time should be less than 30 minutes. |
Test Case #15
Requirement Traceability:
3.0.17. A Computer Science student can format a .java file in BlueJ that has ChangeStyle already installed in less than five minutes.
3.0.18. Formatting a file using the currently set Style Convention takes less than 3 clicks.
Purpose:
- Verify the user can format the code in under 5 minutes.
- Verify the user can format in as little as two clicks.
Procedure:
- Open BlueJ.
- Create a new project containing the following class:
TestCase3017.java
- Follow the steps below:
Test Data:
| Action | Input | Expected Output |
| Start BlueJ. | The BlueJ main window appears. | |
| Open the project containing TestCase3017.java. | The new project window is displayed. | |
| Right click on the class TestCase3017 and select ChangeStyle | Format. | The class is now formatted and should be displayed as uncompiled. | |
| Verify the procedure took less than 5 minutes. |
File: TestCase3017.java
public class !TestCase3014 {
public static void main(String[] args)
{
System.out.println("Hello World!");
for(int i=0; i<=10; i++) {
System.out.println(i);
}
}
}
Test Case #16
Requirement Traceability:
4 (Staged Delivery Plan) 3 (Staged Delivery Plan)
Purpose:
- Verify that Style Conventions can be imported/exported
- Also Verifies that pre-defined conventions can be loaded from the ‘preferences panel’.
Procedure:
- Download and install “changestyle.jar” from the LUNA Wiki Page.
- Create a new file called “JDalbeyConvention.xml” containing the source code below.
- Run BlueJ.
- Create a new BlueJ Project called “Test Case MARK”.
- Create a new Class called “TestClass”.
- Edit “TestClass” (see case #18) containing the source code below.
- Go to Tools > Preferences….
- Go to the [Extensions] tab.
- Click [Edit...].
- Navigate to the General section.
- Click [Import…].
- Click [Browse…].
- Find the file “JDalbeyConvention.xml”, click on it and then click [OK].
- Click [OK].
- Navigate to the General section.
- Type “New Convention” in the “Name:” field.
- Type “New (Test) Convention” in the “Description:” field.
- Click [Apply].
- Click [OK].
- Click [Edit...].
- Navigate to the General section.
- Click [Export…].
- Click [Browse…].
- Type “NewConvention” in the “File name:” field.
- Click [OK].
- Click [OK].
- Select "SunConvention" from the drop-down “Predefined Conventions” menu.
- -- compare expected output #1 below –
- Click [OK].
- Click [Edit...]
- -- compare expected output #2 below –
- Click [Import…].
- Click [Browse…].
- Find the file “NewConvention.xml”, click on it and then click [OK].
- -- compare expected output #3 below –
- Click [OK].
- Click [OK].
- Close BlueJ.
Test Data:
Expected Output #1
A Dialog box asks you to confirm the change
Expected Output #2
Name: Sun Convention
Description: Sun Java Coding Convention
Expected Output #3
Name: New Convention
Description: New (Test) Convention
JDalbeyConvention.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <jalopy> <general> <compliance> <version>15</version> </compliance> <style> <description>JDalbey 305/308/309 Coding Convention</description> <name>JDalbey Convention</name> </style> </general> <inspector> <enable>false</enable> <naming> <classes> <abstract>[A-Z][a-zA-Z0-9]+</abstract> <general>[A-Z][a-zA-Z0-9]+</general> </classes> <fields> <default>[a-z][\w]+</default> <defaultStatic>[a-z][\w]+</defaultStatic> <defaultStaticFinal>[a-zA-Z][\w]+</defaultStaticFinal> <private>[a-z][\w]+</private> <privateStatic>[a-z][\w]+</privateStatic> <privateStaticFinal>[a-zA-Z][\w]+</privateStaticFinal> <protected>[a-z][\w]+</protected> <protectedStatic>[a-z][\w]+</protectedStatic> <protectedStaticFinal>[a-zA-Z][\w]+</protectedStaticFinal> <public>[a-z][\w]+</public> <publicStatic>[a-z][\w]+</publicStatic> <publicStaticFinal>k[a-zA-Z][\w]+</publicStaticFinal> </fields> <interfaces>[A-Z][a-zA-Z0-9]+</interfaces> <labels>\w+</labels> <methods> <default>[a-z][\w]+</default> <defaultStatic>[a-z][\w]+</defaultStatic> <defaultStaticFinal>[a-z][\w]+</defaultStaticFinal> <private>[a-z][\w]+</private> <privateStatic>[a-z][\w]+</privateStatic> <privateStaticFinal>[a-z][\w]+</privateStaticFinal> <protected>[a-z][\w]+</protected> <protectedStatic>[a-z][\w]+</protectedStatic> <protectedStaticFinal>[a-z][\w]+</protectedStaticFinal> <public>[a-z][\w]+</public> <publicStatic>[a-z][\w]+</publicStatic> <publicStaticFinal>[a-z][\w]+</publicStaticFinal> </methods> <packages>[a-z]+(?:\.[a-z]+)*</packages> <parameters> <default>[a-z][\w]+</default> <final>[a-z][\w]+</final> </parameters> <variables>[a-z][\w]*</variables> </naming> <tips> <adhereToNamingConvention>false</adhereToNamingConvention> <alwaysOverrideHashCode>false</alwaysOverrideHashCode> <avoidThreadGroups>false</avoidThreadGroups> <declareCollectionComment>false</declareCollectionComment> <dontIgnoreExceptions>false</dontIgnoreExceptions> <dontSubstituteObjectEquals>false</dontSubstituteObjectEquals> <neverDeclareException>false</neverDeclareException> <neverDeclareThrowable>false</neverDeclareThrowable> <neverInvokeWaitOutsideLoop>false</neverInvokeWaitOutsideLoop> <neverReturnZeroArrays>false</neverReturnZeroArrays> <neverUseEmptyFinally>false</neverUseEmptyFinally> <obeyContractEquals>false</obeyContractEquals> <overrideToString>false</overrideToString> <referToObjectsByInterface>false</referToObjectsByInterface> <replaceStructureWithClass>false</replaceStructureWithClass> <stringLiterallI18n>false</stringLiterallI18n> <useInterfaceOnlyForTypes>false</useInterfaceOnlyForTypes> <wrongCollectionComment>false</wrongCollectionComment> </tips> </inspector> <internal> <version>6</version> </internal> <messages> <priority> <general>30000</general> <parser>30000</parser> <parserJavadoc>30000</parserJavadoc> <printer>30000</printer> <printerJavadoc>30000</printerJavadoc> <transform>30000</transform> </priority> <showErrorStackTrace>true</showErrorStackTrace> </messages> <misc> <threadCount>1</threadCount> </misc> <printer> <alignment> <methodCallChain>true</methodCallChain> <parameterMethodDeclaration>false</parameterMethodDeclaration> <ternaryOperator>true</ternaryOperator> <variableAssignment>false</variableAssignment> <variableDeclAssignment>false</variableDeclAssignment> <variableIdentifier>false</variableIdentifier> </alignment> <backup> <directory>bak</directory> <level>0</level> </backup> <blanklines> <after> <block>1</block> <braceLeft>0</braceLeft> <class>1</class> <declaration>0</declaration> <footer>1</footer> <header>0</header> <interface>1</interface> <lastImport>2</lastImport> <method>1</method> <package>1</package> </after> <before> <block>1</block> <braceRight>0</braceRight> <caseBlock>1</caseBlock> <comment> <javadoc>1</javadoc> <multiline>1</multiline> <singleline>1</singleline> </comment> <controlStatement>1</controlStatement> <declaration>1</declaration> <footer>0</footer> <header>0</header> </before> <keepUpTo>1</keepUpTo> </blanklines> <brace> <comment>false</comment> </brace> <braces> <empty> <cuddle>false</cuddle> <insertStatement>false</insertStatement> </empty> <insert> <dowhile>false</dowhile> <for>false</for> <ifelse>true</ifelse> <while>false</while> </insert> <remove> <block>true</block> <dowhile>false</dowhile> <for>false</for> <ifelse>false</ifelse> <while>false</while> </remove> <treatDifferent> <methodClass>false</methodClass> <methodClassIfWrapped>false</methodClassIfWrapped> </treatDifferent> </braces> <chunks> <blanklines>true</blanklines> <comments>true</comments> </chunks> <comments> <format> <multiline>false</multiline> </format> <javadoc> <check> <innerclass>false</innerclass> <tags>false</tags> <throwsTags>false</throwsTags> </check> <fieldsShort>true</fieldsShort> <generate> <class>0</class> <constructor>0</constructor> <field>0</field> <method>0</method> </generate> <parseComments>false</parseComments> <parseDescription>false</parseDescription> <skip> <ifml>false</ifml> </skip> <tags> <in-line/> <standard/> </tags> <templates> <method> <bottom> */</bottom> <exception> * @throws $exceptionType$ DOCUMENT ME!</exception> <param> * @param $paramType$ DOCUMENT ME!</param> <return> * @return DOCUMENT ME!</return> <top>/**| * DOCUMENT ME!</top> </method> </templates> </javadoc> <remove> <javadoc>false</javadoc> <multiline>false</multiline> <singleline>false</singleline> </remove> <separator> <fillCharacter>-</fillCharacter> <insert>false</insert> <insertRecursive>false</insertRecursive> <text> <annotation>Annotations</annotation> <class>Inner Classes</class> <constructor>Constructors</constructor> <enum>Enumerations</enum> <field>Instance fields</field> <initializer>Instance initializers</initializer> <interface>Inner Interfaces</interface> <method>Methods</method> <static>Static fields/initializers</static> </text> </separator> </comments> <environment/> <footer> <ignoreIfExists>false</ignoreIfExists> <keys/> <smartMode>0</smartMode> <use>false</use> </footer> <header> <ignoreIfExists>false</ignoreIfExists> <keys/> <smartMode>0</smartMode> <use>false</use> </header> <history> <policy>disabled</policy> </history> <imports> <grouping> <defaultDepth>3</defaultDepth> <packages>*:0|gnu:2|java:2|javax:2</packages> </grouping> <policy>disabled</policy> <sort>true</sort> </imports> <indentation> <caseFromSwitch>false</caseFromSwitch> <continuation> <block>true</block> <operator>false</operator> </continuation> <firstColumnComments>true</firstColumnComments> <label>false</label> <policy> <deep>false</deep> </policy> <sizes> <braceCuddled>1</braceCuddled> <braceLeft>0</braceLeft> <braceRight>0</braceRight> <braceRightAfter>0</braceRightAfter> <continuation>4</continuation> <deep>55</deep> <extends>-1</extends> <general>4</general> <implements>-1</implements> <leading>0</leading> <tabs>8</tabs> <throws>-1</throws> <trailingComment>1</trailingComment> </sizes> <tabs> <enable>false</enable> <onlyLeading>false</onlyLeading> </tabs> </indentation> <misc> <arrayBracketsAfterIdent>false</arrayBracketsAfterIdent> <forceFinalModifier>false</forceFinalModifier> <forceFormatting>false</forceFormatting> <insertExpressionParentheses>true</insertExpressionParentheses> <insertLoggingConditional>false</insertLoggingConditional> <insertTrailingNewline>true</insertTrailingNewline> <insertUID>false</insertUID> <method> <forceFinalModifier>false</forceFinalModifier> </method> </misc> <sorting> <declaration> <annotation>false</annotation> <class>false</class> <constructor>false</constructor> <enable>false</enable> <enum>false</enum> <interface>false</interface> <method> <bean>false</bean> </method> <order>static|field|initializer|constructor|method|interface|class|annotation|enum</order> <variable>false</variable> </declaration> <modifier> <enable>false</enable> <order>public=true|protected=true|private=true|abstract=true|static=true|final=true|synchronized=true|transient=true|volatile=true|native=true|strictfp=true</order> </modifier> </sorting> <whitespace> <after> <comma>true</comma> <semicolon>true</semicolon> <typeCast>true</typeCast> </after> <before> <braces>true</braces> <brackets>false</brackets> <bracketsTypes>false</bracketsTypes> <caseColon>false</caseColon> <operator> <not>false</not> </operator> <parentheses> <methodCall>false</methodCall> <methodDeclaration>false</methodDeclaration> <statement>true</statement> </parentheses> </before> <padding> <braces>true</braces> <brackets>false</brackets> <operator> <assignment>true</assignment> <bitwise>true</bitwise> <logical>true</logical> <mathematical>true</mathematical> <relational>true</relational> <shift>true</shift> </operator> <parenthesis>false</parenthesis> <typeCast>false</typeCast> </padding> </whitespace> <wrapping> <always> <after> <arrayElement>0</arrayElement> <braceRight>true</braceRight> <extendsTypes>false</extendsTypes> <implementsTypes>false</implementsTypes> <label>true</label> <methodCallChained>false</methodCallChained> <ternaryOperator> <first>false</first> <second>false</second> </ternaryOperator> <throwsTypes>false</throwsTypes> </after> <before> <braceLeft>true</braceLeft> <extends>false</extends> <implements>false</implements> <throws>false</throws> </before> <parameter> <methodCall>false</methodCall> <methodCallNested>false</methodCallNested> <methodDeclaration>false</methodDeclaration> </parameter> </always> <anon> <align> <after>2147483647</after> </align> <lcurly> <newline>true</newline> </lcurly> </anon> <anondef> <align> <after>2147483647</after> </align> <lcurly> <nonewline>true</nonewline> </lcurly> </anondef> <enum> <align> <after>2147483647</after> </align> <lcurly> <nonewline>true</nonewline> </lcurly> </enum> <general> <beforeOperator>false</beforeOperator> <enable>true</enable> <lineLength>80</lineLength> </general> <ondemand> <after> <assignment>false</assignment> <leftParenthesis>false</leftParenthesis> <parameter>false</parameter> <types> <extends>false</extends> <implements>false</implements> <throws>false</throws> </types> </after> <before> <rightParenthesis>false</rightParenthesis> </before> <deep> <parameter>false</parameter> </deep> <groupingParentheses>false</groupingParentheses> <hard> <parameter>false</parameter> </hard> </ondemand> </wrapping> </printer> </jalopy>
Test Case #17
Requirements Traceability:
3.0.9
Purpose:
- User can add/modify Style Preferences through UI.
Procedure:
- Download and install “changestyle.jar” from the LUNA Wiki Page.
- Create a new file called “JDalbeyConvention.xml” with the text from case #16
- Create a new BlueJ Project called “Test Case MARK”.
- Create a new Class called “TestClass”.
- Edit “TestClass” (see case #18).
- Go to Tools > Preferences…
- Go to the [Extensions] tab
- Click [Edit...]
- Navigate to the General section.
- Type “New Convention” in the “Name:” field.
- Type “New (Test) Convention” in the “Description:” field.
- Navigate to the Printer > Indentation section.
- Set the “General indent:” field to “8”.
- Click [Apply].
- Navigate to the General section.
- Click [Export…]
- Click [Browse…].
- Type “NewConvention” in the “File name:” field.
- Click [OK].
- Click [Import…].
- Click [Browse…].
- Find the file “JDalbeyConvention.xml”, click on it and then click [OK].
- Click [OK].
- Click [Import…].
- Click [Browse…].
- Find the file “NewConvention.xml”, click on it and then click [OK].
- Click [OK].
- -- compare expected output #1 below –
- Click [OK].
- Click [OK].
- Close BlueJ.
Test Data:
Expected Output #1
General Section
Name: JDalbey Convention
Description: JDalbey 305/308/309 Coding Convention
Printer > Indentation Section (General Tab)
General indent: 4
JDalbeyConvention.xml
see test case 16
Test Case #18
Requirement Traceability:
3.0.6
Purpose:
- Verify that ChangeStyle formats code properly
Procedure:
- Download and install “changestyle.jar” from the LUNA Wiki Page.
- Create a new file called “JDalbeyConvention.xml”
- Edit “JDalbeyConvention.xml” (see below).
- Create a new BlueJ Project called “Test Case MARK”.
- Create a new Class called “TestClass”.
- Edit “TestClass” (see below).
- Go to Tools > Preferences…
- Go to the [Extensions] tab
- Click [Edit...]
- Navigate to the General section.
- Click on the Import button
- Click the Browse button
- Choose JDalbeyConvention.xml
- Click the OK Button
- Navigate to the Printer > Indentation section.
- Set the “General indent:” field to “8”.
- Navigate to the Printer > Braces section.
- Click the box next to “Sun Java style”.
- Click [Apply].
- Click [OK].
- Click [OK].
- Right-click “TestClass”.
- Click Compile.
- Right-click “TestClass”.
- Click ChangeStyle > Format.
- -- compare expected output #1 below –
- Right-click “TestClass”.
- Click Open Editor.
- -- compare expected output #2 below –
- Close the “TestClass” Editor.
- Close BlueJ
Test Data:
Expected Output #1
The “TestClass” icon should have ‘hash marks’ indicating it is not compiled. No pop-up messages should appear.
Expected Output #2
public class TestClass {
// instance variables - replace the example below with your own
private int x;
/**
* Constructor for objects of class TestClass
*/
public TestClass() {
// initialise instance variables
x = 0;
}
}
TestClass
public class TestClass
{
// instance variables - replace the example below with your own
private int x;
/**
* Constructor for objects of class TestClass
*/
public TestClass()
{
// initialise instance variables
x = 0;
}
}
JDalbeyConvention.xml
see case 16
Test Case #19
Requirement Traceability:
13 (Staged Delivery Plan)
Purpose:
- Show the main preferences button is labeled correctly and that the History and Backup panes are not visible on Jalopy’s Misc settings page.
Procedure:
- Open BlueJ with ChangeStyle installed.
- Create a new project.
- Create a new Class
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| In main BlueJ window, click the ’Tools’ located in the menu across the top of the screen | A pull-down menu appears | |
| Select and click ‘Preferences…’ | A pop up window appears giving information about preferences | |
| Find and click on the ‘Extensions’ tab | The tab should change and you should see different detail sections for each extentsion | |
| Under the ChangeStyle detatil section, click the button labeled ‘Edit...’ | The Label is correct according to the User Manual | |
| Looking over the ‘Custom Settings’ pane, select the Misc settings page | The Misc Settings panel should show in the pane | |
| Look at the pane, you should not see any panels labeled History or BackUp | The History and BackUp Panels have been removed |
Test Case #20
Requirement Traceability:
12 (Staged Delivery Plan)
Purpose:
- Verify the removal of the extraneous confirm pop-up window after format
Procedure:
- Open BlueJ with ChangeStyle installed.
- Create a new project.
- Create a new Class
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Double-click on your new class | The editor window appears for your class. | |
| 2. Click anywhere in the text area of the editor | A blinking vertical curser appears where you clicked. | |
| 3. Click the Compile button | Your class is compiled | |
| 6. Right-click on your class | Class context menu appears | |
| 7. Click on ChangeStyle | Sub-menu appears | |
| 8. Click on Format | Test1 is formatted. No pop-up window to confirm the format occurred. |
Test Case #21
Requirement Traceability:
10 (Staged Delivery Plan)
Purpose:
- Verify the link in the Settings Dialog opens the Luna Manual in a browser.
Procedure:
- Open BlueJ with ChangeStyle installed.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Click on Tools | The tools menu appears. | |
| 2. Click on Preferences | The preference dialog is displayed. | |
| 3. Click the Extensions tab | Extension tab displayed | |
| 4. Click on Edit... | The jalopy settings are displayed | |
| 5. Click on the Help icon in the lower right | A browser should open with the Luna Manual |
Test Case #22
Requirement Traceability:
9,15 (Staged Delivery Plan)
Purpose:
- Verify ChangeStyle has a "Format" button in the class menu and the tools menu.
- Verify ChangeStyle has an option to Format Package.
Procedure:
- Open BlueJ with ChangeStyle installed.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Click on Tools | The tools menu appears. | |
| 2. Click on ChangeStyle | Verify the option "Format Entire Project" is available | |
| 3. Close the menu | Main BlueJ window has focus | |
| 4. Right-Click on a compiled class | The Class menu is displayed | |
| 5. Click on ChangeStyle | Verify the Format option is available |
Test Case #23
Requirement Traceability:
Stage 1.1 Requirement 4 and Defect Ticket #251
Purpose:
- Test that when you use the ANSI_C and K & R predefined conventions the names and descriptions are correct.
Procedure:
- Open BlueJ with ChangeStyle installed.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Click on Tools | The tools menu appears. | |
| 2. Select Preferences | BlueJ’s Preferences Panel appears | |
| 3. Select the Extensions tab | The extensions tab should appear | |
| 4. In the Predefined Conventions drop down menu, select ANSI_C | The ANSI_C option will be selected and a confirmation window will appear | |
| 5. Confirm that you want to change your predefined convention by selecting the okay button | The confirmation window will appear | |
| 6. Click the Edit... button | The Custom Settings window and Preview pane will appear | |
| 7.Look at the Name and Description field in the General Settings pane | The Name field will read ANSI_C and the Description field will read ANSI_C Style Convention | |
| 8. Click the Okay button | The custom settings panel will disappear | |
| 9. Next, in the Predefined Conventions drop down menu, select K&R | The K&R option will be selected and a confirmation window will appear | |
| 10. Confirm that you want to change your predefined convention by selecting the okay button | The confirmation window will appear | |
| 11. Click the Edit... button | The Custom Settings window and Preview pane will appear | |
| 12. Look at the Name and Description field in the General Settings pane | The Name field will read K & R and the Description field will read K & R Style Convention | |
| 13. Click the Okay button | The custom settings panel will disappear |
Test Case #24
Requirement Traceability:
Stage 2.0 Requirement 7
Purpose:
- Test that ChangeStyle allows users to insert a custom header or footer into their code when formatted.
Procedure:
- Open BlueJ with ChangeStyle installed.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Click on the Tools Menu | The tools menu appears. | |
| 2. Select Preferences | BlueJ’s Preferences Panel appears | |
| 3. Select the Extensions tab | The extensions tab should appear | |
| 4. Click the Edit... button | The Custom Settings window and Preview pane will appear | |
| 5. Click on the label named Header | The Header settings page's tab should appear labeled options | |
| 6. Locate the text box under the Text label | The text box should be blank | |
| 7. Enter the header comment you would like entered into your text, it should be formatted like a multiline comment | /* * ChangeStyle Header */ | |
| 8. Select the check box labeled Use Header | The check box should appear checked | |
| 9. In the preview pane, select the Formatted pane | Your header should appear before the text in the pane | |
| 10. Click on the label named Footer | The Footer settings page should appear with a tab labeled options | |
| 11. Locate the text box under the Text label | The text box should appear blank | |
| 12. Enter the footer comment you would like entered into your text, it should be formatted like a multiline comment | /* * ChangeStyle Footer */ | |
| 13. Select the check box labeled Use Footer | The check box should appear checked | |
| 14. In the preview pane, select the Formatted pane | Your footer should appear after the text in the pane | |
| 15. Select the Ok button | The Custom Settings Pane should disappear | |
| 16. Click back to the main BlueJ window | The main BlueJ window should appear | |
| 17. Create a new class by clicking on the New Class button | The new class panel should appear | |
| 18. In the Class Name, text box name your class TestHeadFoot and click Ok | TestHeadFoot | A new class icon should appear in the window |
| 19. Right Click on the class | The class drop down menu will appear | |
| 20. Select the Compile option | After compilation the class will appear solid colored | |
| 21. Right Click on the class | The class drop down menu will appear | |
| 22. Move the mouse over the label named ChangeStyle and select the Format option | The class will be formatted | |
| 23. Open the class editor by double clicking on the class icon | The class editor will appear | |
| 24. Look at the first lines of the code and the last lines of the code | You should see your header and footer inserted into the code |
Test Case #25
Requirement Traceability:
Maintenance Requirement 1
Purpose:
Test that the Predefined Conventions drop down menu is displaying correctly.
Procedure:
- Open BlueJ with ChangeStyle-1.1 installed.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| Open the prefence dialog. | Tools->Preferences | BlueJ: Preferences dialog is displayed. |
| Open the Extensions tab. | The ChangeStyle panel is displayed. | |
| Open the Predefined Conventions drop down menu. | The full menu is displayed. | |
| Verify there is no visual defect in the drop down menu. | The entire dropdown menu should be displayed filled with no visual break in the menu. |
Test Case #26
Requirement Traceability:
Stage 1.1 Requirement 2
Stage 2.0 Requirement 1
Purpose:
To verify that there is a help link in the ChangeStyle Preference panel (near “Predefined Conventions” label),
and that it opens an internet browser to the ChangeStyle User Manual predefined conventions section.
Procedure:
- Open BlueJ with ChangeStyle-1.1 installed.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| Click “Tools->Preferences” at the top of the BlueJ Project Window. | A “BlueJ: Preferences” Window should appear. | |
| Click on the “Extensions” Tab. | There should be a panel labeled “ChangeStyle”, with a help Icon that has a question mark image displayed, on it. | |
| Click the Help Icon. | An internet browser should open to this link: |
Test Case #27
Requirement Traceability:
Stage 2.0 Requirement 3
Purpose:
To ensure that Batch Undo and the associated Dialog function as expected.
Procedure:
- Download the test project directory from SVN.
- Open BlueJ with ChangeStyle installed.
- Open the test project.
- Reset ChangeStyle to DalbeyStyle through the Extensions Tab in BlueJ’s Preferences dialog.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Click the Compile button | All classes are compiled | |
| 2. Right-click on test1 | Class menu appears with ChangeStyle as an option | |
| 3. Click on ChangeStyle | Sub-Menu appears with Format enabled and Undo disabled | |
| 4. Click on Format | The file is formatted | |
| 5. Click on Tools | The Tools menu appears with ChangeStyle as an option | |
| 6. Click on ChangeStyle | Sub-Menu appears with Undo Formatting enabled | |
| 7. Click on Undo Formatting | A Dialog appears like the one shown here | |
| 8. Click on Select All | Only the enabled check boxes should be selected | |
| 9. Click on Clear Selected | All check boxes are cleared | |
| 10. Click on the test1 check box | test1 is selected | |
| 11. Click on Undo | The Dialog should close and test1 is restored | |
| 12. repeat steps 1 - 7 | The Dialog should appear again | |
| 13. Select test1 | test1 is selected | |
| 14. Click on Cancel | The Dialog closes and test1 remains formatted |
Test Case #28
Requirement Traceability:
Stage 2.0 Requirement 4
Purpose:
Formatting the code causes the editor to refresh immediately.
Procedure:
- Download the test project directory from SVN.
- Open BlueJ with ChangeStyle installed.
- Open the test project.
- Reset ChangeStyle to DalbeyStyle through the Extensions Tab in BlueJ’s Preferences dialog.
- Follow the steps below.
Test Data:
| Action | Input | Expected Output |
| 1. Click the Compile button | All classes are compiled | |
| 2. Double-click on test1 | The Editor window appears | |
| 3. Right-click on test1 | Class menu appears with ChangeStyle as an option | |
| 4. Click on ChangeStyle | Sub-Menu appears with Format enabled and Undo disabled | |
| 5. Click on Format | The file is formatted and the effects are immediately visible in the editor |
Test Case #29
Requirement Traceability:
Stage 2.0 Requirement 9
Purpose:
Clicking on the “Edit” button in the preference panel multiple times will only open Jalopy once.
Procedure:
- Download the test project directory from SVN.
- Open BlueJ with ChangeStyle installed.
- Open the test project.
- Click multiple times on the “Edit” button in the preference panel.
Test Data:
| Action | Input | Expected Output |
| 1. Click the “Edit” button in the preference panel | Jalopy will open. | |
| 2. Click the “Edit” button again | Another window of Jalopy will not open. | |
| 3. Click the “Edit” button again | Another window of Jalopy will not open. | |
| 4. Click the “Edit” button again | Another window of Jalopy will not open. | |
| 5. Click the “Edit” button again | Another window of Jalopy will not open. |
Test Case #30
Requirement Traceability:
Stage 2.0 Requirement 2
Purpose:
Test that the Custom Convention are available and working correctly using a Costello script.
Procedure:
- Copy/Install the costello program inside your BlueJ folder.
- Copy the tools.jar library from your <Java SDK>\lib folder into the <BlueJ>\lib folder.
- Verify the conventions folder is empty if it exists: <bluej_settings_folder>\conventions
- Download the script file from SVN: SystemTestStage2.0_2
- Run the Costello Script Editor.
- Open the provided script file: SystemTestStage2.0_2
- Run the Script.
Test Data:
| Action | Input | Expected Output |
| 1. Click Test->Run or press Ctrl-r to run the test. | The test will run. |
Test Case #31
Requirement Traceability:
Stage 2.0 Requirement 6
Purpose:
Test that the import/export functionality is working correctly. Test that the Custom Settings dialog now has the simplified menu.
Procedure:
- Copy/Install the costello program inside your BlueJ folder.
- Copy the tools.jar library from your <Java SDK>\lib folder into the <BlueJ>\lib folder.
- Verify the conventions folder is empty if it exists: <bluej_settings_folder>\conventions
- Download the script file from SVN: SystemTestStage2.0_6
- Run the Costello Script Editor.
- Open the provided script file: SystemTestStage2.0_6
- Run the Script.
Test Data:
| Action | Input | Expected Output |
| 1. Click Test->Run or press Ctrl-r to run the test. | The test will run. |
Test Case #32
Purpose
Verify that the requisite status messages are displayed when a single class undergoes the 'format' and 'undo' actions.
Requirements Traceability
Stage 2.0 requirement 8. (staged delivery plan).
Procedure
BlueJ (version 2.2 or newer) and Java SDK (version 1.6 or newer) must already be installed.
- Start BlueJ
- Create a new project: “TestProject32”
- Create a new class: “TestClass”
- Click [Compile].
- Right click the “T!estClass” icon.
- Click ChangeStyle > Format.
- The panel in the lower left-hand corner should have displayed “Formatting... Done”
- Double click the “TestClass”.
- The Editor window should appear.
- The panel in the lower left-hand corner should have displayed “Formatting... Done”
- Close [x] the Editor window.
- Right click the “TestClass” icon.
- Click ChangeStyle > Undo.
- The panel in the lower left-hand corner should have displayed “Undo Formatting... Done”
- Double click the “T!estClass”.
- The Editor window should appear.
- The panel in the lower left-hand corner should have displayed “Undo Formatting... Done”
- Close [x] the Editor window.
- Close [x] BlueJ.
Test Case #33
Purpose
Verify that the requisite status messages are displayed when a single class undergoes the 'format' and 'undo' actions.
Requirement Traceability
Stage 2.0 requirement 8. (staged delivery plan).
Procedure
BlueJ (version 2.2 or newer) and Java SDK (version 1.6 or newer) must already be installed.
- Start BlueJ
- Create a new project: “TestProject33”
- Create a new class: “TestClassA”
- Create a new class: “TestClassB”
- Click [Compile].
- Click Tools > ChangeStyle > Format Entire Project.
- The panel in the lower left-hand corner should have displayed “Formatting... Done”
- Double click the “TestClassA”.
- The Editor window should appear.
- The panel in the lower left-hand corner should have displayed “Formatting... Done”
- Close [x] the Editor window.
- Double click the “TestClassB”.
- The Editor window should appear.
- The panel in the lower left-hand corner should have displayed “Formatting... Done”
- Close [x] the Editor window.
- Click Tools > ChangeStyle > Undo Formatting.
- Click [Select All].
- Click [Undo].
- The panel in the lower left-hand corner should have displayed “Undo Formatting... Done”
- Double click the “TestClassA”.
- The Editor window should appear.
- The panel in the lower left-hand corner should have displayed “Undo Formatting... Done”
- Close [x] the Editor window.
- Double click the “TestClassB”.
- The Editor window should appear.
- The panel in the lower left-hand corner should have displayed “Undo Formatting... Done”
- Close [x] the Editor window.
- Close [x] BlueJ.
History
| Date | Change | Author | ||
| 5/30/08 | Refine test case #24 | long | ||
| 5/28/08 | Added Test case #31 | istewart | ||
| 5/28/08 | Added Test case #30 | istewart | ||
| 5/27/08 | Fix Test Case 11 to reflect updated requirement | long | ||
| 5/22/08 | Added Test case #29 | tldavies | ||
| 5/21/08 | Added Test Case #28 | rmcdanie | ||
| 5/20/08 | Added Test Case #27 | rmcdanie | ||
| 5/18/08 | Updated some cases for v1.1 | rmcdanie | ||
| 5/17/08 | Modified links and Tables | rmcdanie | ||
| 5/17/08 | Add Cases 23, 24 | long | ||
| 4/28/08 | Add Stage 1 req. tests 19 and 20 | long | ||
| 4/28/08 | Mark's Cases | rmcdanie | ||
| 4/27/08 | Case 6,8 | istewart | ||
| 4/27/08 | QA Acceptance | istewart |
Attachments
- undoDialog.JPG (13.9 kB) -
Screenshot of prototype batch undo dialog
, added by rmcdanie on 05/20/08 20:34:06.
