Smoke Tests for OpenOffice.org Scripting FrameWork

 

README

Outline the order by which the installs of various components must occur.

Install_01

Test the SFrameworkInstall.jar file will not install if placed in the incorrect directory.

Install_02

Test the SFrameworkInstall.jar  will sense directory names longer than 8 characters. 

Install_03

Test the SFrameworkInstall.jar  will sense directory names which contain a space character. 

Install_04

Test the SFrameworkInstall.jar file when deployed will present to the user options to allow a script to be bound to an event. 
Also test  that scripting framework jar files are successfully deployed to NetBeans and Jedit. 

Bindings_01

Test that the user can assign a deployed script to a key. 

Bindings_02

Test that the user can  remove an assigned key. 

Bindings_03

Test that the user can assign a deployed script to the File menu item. 

Bindings_04

Test that the user can delete an assigned File menu item. 

Bindings_05

Test that the user can execute a  script stored in a document with a binding stored in the same document.

Bindings_06

Test that the user can store a binding within a document for a script already stored in that document.

jEdit_01

Compile and deploy a java script to the application user area using jedit.

jedit_02

Verify that Refresh User Scripts (Java) functions correctly for scripts deployed from jEdit.

jedit_03

Verify that user can deploy a script to a document using jEdit

jedit_04

Verify that user can delete a script deployed to a document using jEdit.

NetBeans_01

Compile and deploy a java script to the application user area using NetBeans.

NetBeans_02

Compile and deploy a java script to a document  using NetBeans.

NetBeans_03

Delete a script  deployed to a document  using NetBeans.



Test Case: README

Test Area: Solaris  - Linux - Windows

Test Aim
Outline the order by which the installs of various components must occur.
 

Prerequisites:-
Download NetBeans 3.4  from http://www.netbeans.org.
Download Jedit  4.0.3  from http://www.jedit.org
Download Scripting Framework from http://framework.openoffice.org/scripting/
Download OpenOffice.org 643C or later from http://www.openoffice.org


General Description:
It is important that the following steps be executed in order and before and other test cases.

1. Install NetBeans
2. Install jedit, install the jar version by executing  'java -Djava.compiler=none -jar filename.jar'
3.  Start jedit, cd to the install directory and select jedit. exit jedit.
4.  Start NetBeans, cd to the install-dir/bin and execute runide.sh for unix systems,
select runidew.exe for windows. exit NetBeans.
5.  Install OpenOffice.org.
6.  Copy  the SFrameworkInstall.jar file to the OpenOffice.org-install-dir/program directory.




 
 

Test Case: install_01

Test Area: Solaris  - Linux - Windows

Test Aim
Test the SFrameworkInstall.jar file will not install if placed in the incorrect directory.
 

Requirements
README is performed before running this test case.


Description:
1. Copy the SFrameworkInstall.jar file to the <office-installation>  directory.
2. Ensure OpenOffice is not running, also ensure the quickstarters for windows and Linux are not running.
3. Execute java -jar SFrameworkInstall.jar
4. The installer should launch and advise the user that the installer must be run from the program directory
of a valid Office installation.
5. Select Cancel, the installer closes.

Expected Result:
All operations should complete successfully.





 
 

Test Case: install_02

Test Area: Windows

Test Aim
Test the SFrameworkInstall.jar  will sense directory names longer than 8 characters.

Requirements
READMEis performed before running this test case.
OpenOffice.org installation path directory has a name which is nine characters or more.
Jedit installation path directory has a name which is nine characters or more.
NetBeans installation path directory has a name which is nine characters or more.


Description:
1. Copy the SFrameworkInstall.jar file to the <office-installation>/program  directory.
2. Ensure OpenOffice is not running, also ensure the quickstarters for windows and Linux are not running.
3. Execute java -jar SFrameworkInstall.jar
4. On the Scripting Framework Installer welcome screen click next.
5. Select Install, in the dialog select Next.
6. When Installation has completed, select Finish, the next dialog should prompt you that the installer has
     found a Jedit installation and a NetBeans installation, select Next.
8. Select the IDE's for update, i.e. NetBeans and Jedit, select Next, Select Install, Select Finish

9. Manully check the jedit install, directory <jedit-install>/jars for the following files:-
OfficeScripting.jar
idesupport.jar
10. Manually check the NetBeans install directory <netbeans-install>/modules for the following file:-
office.jar

11. Start OpenOffice.org, select Tools, there should be an entry - Assign Script (java) to and an entry Refresh User Scripts.
12. Select Tools, Assign Script(java) , Menu. An assign Script(java) dialog should be launched.

Expected Result:
All operations should complete successfully.





 
 

Test Case: install_03

Test Area: Windows

Test Aim
Test the SFrameworkInstall.jar  will sense directory names which contain a space character.

Requirements
README is performed before running this test case.
OpenOffice.org installation path directory has a name which  contains a space character.
Jedit installation path directory has a name which contains a space character.
NetBeans installation path directory has a name which contains a space character.


Description:
1. Copy the SFrameworkInstall.jar file to the <office-installation>/program  directory.
2. Ensure OpenOffice is not running, also ensure the quickstarters for windows and Linux are not running.
3. Execute java -jar SFrameworkInstall.jar
4. On the Scripting Framework Installer welcome screen click next.
5. Select Install, in the dialog select Next.
6. When Installation has completed, select Finish, the next dialog should prompt you that the installer has
     found a Jedit installation and a NetBeans installation, select Next.
8. Select the IDE's for update, i.e. NetBeans and Jedit, select Next, Select Install, Select Finish

9. Manully check the jedit install, directory <jedit-install>/jars for the following files:-
OfficeScripting.jar
idesupport.jar
10. Manually check the NetBeans install directory <netbeans-install>/modules for the following file:-
office.jar

11. Start OpenOffice.org, select Tools, there should be an entry - Assign Script (java) to and an entry Refresh User Scripts.
12. Select Tools, Assign Script(java) , Menu An assign Script(java) dialog should be launched.

Expected Result:
All operations should complete successfully.




 

Test Case: install_04

Test Area: Solaris  - Linux - Windows

Test Aim
Test the SFrameworkInstall.jar file when deployed will present to the user options to allow a script to be bound to an event.
Also test  that scripting framework jar files are successfully deployed to NetBeans and Jedit.

Requirements
README is performed before running this test case.


Description:
1. Copy the SFrameworkInstall.jar file to the <office-installation>/program  directory.
2. Ensure OpenOffice is not running, also ensure the quickstarters for windows and Linux are not running.
3. Execute java -jar SFrameworkInstall.jar
4. On the Scripting Framework Installer welcome screen click next, the welcome screen should state the version of SFramework.jar.
5. Select Install, in the dialog select Next.
6. When Installation has completed, select Finish, the next dialog should prompt you that the installer has
     found a Jedit installation and a NetBeans installation, select Next.
8. Select the IDE's for update, i.e. NetBeans and Jedit, select Next, Select Install, Select Finish

9. Manully check the jedit install, directory <jedit-install>/jars for the following files:-
OfficeScripting.jar
idesupport.jar
10. Manually check the NetBeans install directory <netbeans-install>/modules for the following file:-
office.jar
11. Manually check that the SFrameworkInstall.log file was writter to the program directory.
12. Start OpenOffice.org, select Tools, there should be an entry - Assign Script (java) to and an entry Refresh User Scripts.
13. Select Tools, Assign Script(java) , Menu An assign Script(java) dialog should be launched.

Expected Result:
All operations should complete successfully.





 
 

Test Case: bindings_01

Test Area: Solaris  - Linux - Windows

Test Aim
Test that the user can assign a deployed script to an key.
 

Prerequisites:-
install_04 is executed before running this test case.


Description:
1.  Start OpenOffice.org writer document.
2. Select Tools -Assign Script(java) To, Key.
3. In the popup dialog,
     in the select script function select a script e.g. HighlightText.showForm
    Select  Key Group SHIFT + CONTROL +F keys.
    Select ShortcutKey SHIFT + CONTROL + F3.
    Select New Script Key.
4. The Key should now be assigned to HighlightText.showForm. Select OK.
5. Select OK when prompted that you need to restart OpenOffice.org
6. Exit and restart OpenOffice.org, opening a writer document.
7. Select Shift - Control - F3. The Highlight Text box dialog should be displayed.
8. Select Tools - Assign Script(java) To, Key, SHIFT-CONTROL-F3 should be listed as assigned to HighlightText.showForm. Close the Assign Script (Java) to Key dialog
9. Select Tools - Configure, select the Keyboard option, ensure that writer is selected in the top right corner.
In the shortcut keys scroll to Ctrl+Shift+F3, this should show that it is assigned to [script://HighlightText.showForm].
10. Close the Configuration dialog.
 
 

Expected Result:
All operations should complete successfully.





 
 

Test Case: bindings_02

Test Area: Solaris  - Linux - Windows

Test Aim
Test that the user can  remove an assigned key.
 

Prerequisites:-
bindings_01 is executed before running this test case.


Description:
1.  Start OpenOffice.org writer document.
2. Select Tools -Assign Script(java) To, Key.
3. In the popup dialog,
    Select  Key Group SHIFT + CONTROL +F keys.
    Select ShortcutKey SHIFT + CONTROL + F3.
    Select  Delete Script Key.
4. The Key should not be assigned to anything. Select OK.
5. Select OK when prompted that you need to restart OpenOffice.org
6. Exit and restart OpenOffice.org, opening a writer document.
7. Select Shift - Control - F3. The Highlight Text box dialog should be not  displayed.
8. Select Tools - Assign Script(java) To, Key, SHIFT-CONTROL-F3 should not be listed as assigned to anything. Close the Assign Script (Java) to Key dialog
9. Select Tools - Configure, select the Keyboard option, ensure that writer is selected in the top right corner.
In the shortcut keys scroll to Ctrl+Shift+F3, this should show that it is not assigned to anything
10. Close the Configuration dialog.
 
 

Expected Result:
All operations should complete successfully.





 
 

Test Case: bindings_03

Test Area: Solaris  - Linux - Windows

Test Aim
Test that the user can assign a deployed script to the File menu item.
 

Prerequisites:-
install_04 is executed before running this test case


Description:
1.  Start OpenOffice.org  writer document.
2. Select Tools, Assign Script(java) To, Menu.
3. In the popup dialog,
     in the select script function select a script e.g. HighlightText.showForm
    Select File in the Top Level menu drop down list.
    In the New Menu, enter a menu item name e.g. menuhighlight.
    Select New Script Menu, select ok.
4. Select OK when prompted to restart OpenOffice.org. Exit and restart OpenOffice.org writer document.
5. Select File, menuhighlight - a highlight text box should appear.
 
 

Expected Result:
All operations should complete successfully.





 
 

Test Case: bindings_04

Test Area: Solaris  - Linux - Windows

Test Aim
Test that the user can delete an assigned File menu item.
 

Prerequisites:-
bindings_03  is  executed before running this test case


Description:
1.  Start OpenOffice.org writer document.
2. Select Tools, Assign Script(java) To, Menu.
3. In the popup dialog,
     Select File in the Top Level menu drop down list.
    In the Sub Menu, select menuhighlight [ HighlightText.ShowForm]
    Select Delete Script Menu. Select OK.
4. Select OK when prompted to restart OpenOffice.org. Exit and restart OpenOffice.org writer document.
5. Select File, there should now be no menu option menuhighlight.
 
 

Expected Result:
All operations should complete successfully.





 
 

Test Case: bindings_05

Test Area: Solaris  - Linux - Windows

Test Aim
Test that the user can execute a  script stored in a document with a binding stored in the same document.
 

Prerequisites:-
 install_04 is executed before running this test case.


Description:
1.  Start OpenOffice.org.
2. Select File - Open, navigate to <OpenOffice.org-install-dir>/user/Scripts/java/MemoryUsage.
3. Open file ExampleSpreadSheet.sxc, a spreadsheet document with a pie chart should be opened
4. Press ctrl-shift-m, the user is warned that they are about to execute a sctipt.
Do you want to execute this script.
5. Select Yes.
6. The chart updates with JVM memory usage statistics.
7. Repeat steps 4-6 again.
 
 

Expected Result:

All operations should complete successfully.



Test Case: bindings_06

Test Area: Solaris  - Linux - Windows

Test Aim
Test that the user can store a binding within a document for a script already stored in that document.
 

Prerequisites:-
jedit_03 is executed before running this test case.
Note The functionality for this test case is not available yet.


Description:
 
 

Expected Result:
All operations should complete successfully.




 
 

Test Case: jedit_01

Test Area: Solaris  - Linux - Windows

Test Aim

Compile and deploy a java script to the application user area using jedit.

Prequisites:-
install_04 is executed before running this test case.
JEdit prerequisites


Description:

    1. Start Jedit.
    Click on the Office Scripting button on the right of the frame.

    Right click on all parcels.

    Select New
    Enter the name of the new parcel e.g. HelloJedit.
    Select a directory where you want the parcel to be built .

    2. In the left hand frame the HelloJedit script is opened you need to add the following lines to the top of the script
    immediately after the first import statement

    import com.sun.star.uno.UnoRuntime;
    import com.sun.star.frame.XModel;
    import com.sun.star.text.*;
     

    3. Add the following lines to  the public method doMethod in the HelloJedit class.

    XModel model = xSc.getDocument();
     XTextDocument textdoc = (XTextDocument)
                UnoRuntime.queryInterface(XTextDocument.class, model);
     XText oText = textdoc.getText();
     XTextCursor oCursor = oText.createTextCursor();
     oText.insertString(oCursor, "Hello jEdit", false);
     
     

    4. Right click on  'HelloJedit' and select ScriptCompile.
    After complation has successfully completed, right click on 'HelloJedit' and select Build Parcel SXP.

    In the scripting framework dialog that appears select the method HelloJedit.doMethod in the right frame

    and select Add.

    Select Finish.


     

    5. Right click on the HelloJedit.sxp parcel and select Deploy to OpenOffice.org.

    Check that the scripts have been deployed to <office_installation>/user/Scripts/java.
     

    6. Assign an event  to execute the script.
    - Start OpenOffice.org  writer document.
    - Select Tools, Assign Script(java) To, Menu.
    - In the popup dialog,
         in the select script function select a script e.g. HelloJedit.doMethod
        Select File in the Top Level menu drop down list.
        In the New Menu, enter a menu item name e.g. HelloJedit.
        Select New Script Menu, select ok.
    - Select OK when prompted to restart OpenOffice.org. Exit and restart OpenOffice.org writer document.
    - Select File, HelloJedit - Hello jEdit should be inserted into the document.
     

    Expected Result:

            All operations should complete successfully.






 

Test Case: jedit_02

Test Area: Solaris  - Linux - Windows

Test Aim
Verify that Refresh User Scripts (Java) functions correctly for scripts deployed from jEdit.

 
Prequisites:-
install_04is executed before running this test case.

OpenOffice.org is running a writer document.
Ensure hellojedit2 is not already listed under Assign Script (Java) to Key or Menu.


Description:
 
 

    1. Click on the Office Scripting button on the right of the frame.

    Right click on all parcels.

    Select New
    Enter the name of the new parcel e.g. HelloJedit2.
    Select a directory where you want the parcel to be built .

    2. In the left hand frame the HelloJedit2 script is opened you need to add the following lines to the top of the script
    immediately after the first import statement

    import com.sun.star.uno.UnoRuntime;
    import com.sun.star.frame.XModel;
    import com.sun.star.text.*;
     

    3. Add the following lines to  the public method doMethod in the HelloJedit2 class.

    XModel model = xSc.getDocument();
     XTextDocument textdoc = (XTextDocument)
                UnoRuntime.queryInterface(XTextDocument.class, model);
     XText oText = textdoc.getText();
     XTextCursor oCursor = oText.createTextCursor();
     oText.insertString(oCursor, "Hello jEdit2 ", false);
     

     
    4. Select, File - Save.
    Right click on  'HelloJedit2' and select ScriptCompile.
    After complation has successfully completed, right click on 'HelloJedit2' and select Build Parcel SXP.

    In the scripting framework dialog that appears select the method HelloJedit2.doMethod in the right frame

    and select Add.

     
    5. Right click on the HelloJedit2.sxp parcel and select Deploy to OpenOffice.org.

     
    6. In OpenOffice.org select Tools, Assign Script (Java) To - Key.
    HelloJedit2 should not be listed  in the Select script function box.
    Close the Assign Script (Java) To Key dialog box

    7. Select Tools, Refresh User Scripts (java).
    Select Tools, Assign Script (Java) To - Key.
    HelloJedit2 should now be listed  in the Select script function box.

    8. Select HelloJedit2.doMethod in the Select script function box.
    Select the shotcut key group Shift + Control + F keys.
    Select the Shortcut Key Shift + Control + F10.
    Select, New Script Key, Select OK.
    Select OK when prompted to restart OpenOffice.org. Exit and restart OpenOffice.org writer document.
    Select Shift+ Control + F10, Hello jEdit2 should be inserted into the document.

    Expected Result:

            All operations should complete successfully.





 
 

Test Case: jedit_03

Test Area: Solaris  - Linux - Windows

Test Aim
Verify that user can deploy a script to a document using jEdit.

 
Prequisites:-
jedit_01 is executed before running this test case.
Delete directory <office-install>/user/Scripts/java/HelloJedit.
OpenOffice.org is not running.
A previously created OpenOffice.org writer document, e.g. TestBindjE.sxw


1. Start Jedit
Click on the HelloJedit.java file listed under All Parcels, HelloJedit.
Change the text in the HelloJedit.java file from "Hello jEdit"  to "Hello jEdit 3---".
Select File Save.

2. Right click on hellojedit and select Script Compile.

After complation has successfully completed, right click on 'HelloJedit' and select Build Parcel SXP.

Select Finish.

3. Right click on the HelloJedit.sxp parcel and select Deploy to Document.

4. Check that the script has been successfully deployed to the document by running unzip -l  TestBindjE.sxw. (Unix) or pkunzip -v  TestBindjE.sxw (Windows). You should see the script saved in the document.

5. Launch OpenOffice.org, note the previously assigned bindings as setup in jedit_01 still apply to the TestBindjE.sxw document. Open the TestBindjE.sxw document.

6. Select File HelloJedit - "Hello jEdit  3--- "should be inserted into the document.
 




 
 

Test Case: jedit_04

Test Area: Solaris  - Linux - Windows

Test Aim
Verify that user can delete a script deployed to a document using jEdit.

 
Prequisites:-
jedit_03 is executed before running this test case.
Close the test document TestBindjE.sxw in OpenOffice.org before executing test.


Description:

1. Start Jedit, right click on All Parcels and select Open.

2. Browse to the document TestBindjE.sxw and open it.

3. Expand the document TestBindjE.sxw. Right click on the PARCEL_FILE and select Remove Parcel.

4. Check that the script has been successfully remove from the document by running unzip -l  TestBindjE.sxw. (Unix) or pkunzip -v  TestBindjE.sxw (Windows). You should see that the script has been removed from the document.
 




 
 

Test Case: netbeans_01

Test Area: Solaris  - Linux - Windows

Test Aim
Compile and deploy a java script to the application user area using NetBeans.

Prerequisits
install_04 is executed before running this test case.
Netbeans prerequisites


Description:
 

    1. Create an examples directory e.g. HelloNetBeans.#
    Start NetBeans.

    2. Mount the examples directories
             Select the File->Mount Filesystem menu item
             In the Choose Filesystem Type window select Local Directory and click Next
             Mount the examples directory you created i.e. HelloNetBeans.
             Select Finish.

    3.   Create a new script parcel
             Right click on your mounted examples directory.
             Select New->Office Scripting->Parcel Recipe
             In the New Wizard window that appears, enter the name you wish to call your new parcel e.g HelloNetBeans.
             Select Finish.

    4.  Click on the Contents-Empty file
    -Change the name of 'public class Empty' to 'public class HelloNetBeans'
    -Remove the package declaration 'package HelloNetBeans.Contents;' at the top of the file
    -Add the following lines to the top of the script immediately after the first import statement

    import com.sun.star.uno.UnoRuntime;
    import com.sun.star.frame.XModel;
    import com.sun.star.text.*;
     

    5. Add the following lines to  the public method doMethod in the HelloNetBeans class.

    XModel model = xSc.getDocument();
     XTextDocument textdoc = (XTextDocument)
                UnoRuntime.queryInterface(XTextDocument.class, model);
     XText oText = textdoc.getText();
     XTextCursor oCursor = oText.createTextCursor();
     oText.insertString(oCursor, "Hello NetBeans", false);

    6. Right click on the HelloNetBeans in the right frame and select save.

    7.   Right click on  the HelloNetBeans directory and select compile. You should note that
    the compile completes successfully from the lower right hand frame (output window) of NetBeans.

    8. Right click on the HelloNetBeans  directory and select build,
    In the dialog which appears select the HelloNetBeans.doMethod and add to scripts , select OK.
    A HelloNetBeans parcel file should be built.

    9. Right click on the Hello NetBeans parcel file and select Deploy to OpenOffice.org.

    10. Check that the files have been successfully deployed to <office-install>/user/Scripts/java.

    11. Assign an event  to execute the script.
    - Start OpenOffice.org  writer document.
    - Select Tools, Assign Script(java) To, Menu.
    - In the popup dialog,
         in the select script function select a script e.g. HelloNetBeans.doMethod
        Select File in the Top Level menu drop down list.
        In the New Menu, enter a menu item name e.g. HelloNetBeans.
        Select New Script Menu, select ok.
    - Select OK when prompted to restart OpenOffice.org. Exit and restart OpenOffice.org writer document.
    - Select File, HelloNetBeans - Hello NetBeans should be inserted into the document.

Expected Result:
 

All operations should complete successfully.




 
 

Test Case: netbeans_02

Test Area: Solaris  - Linux - Windows

Test Aim
Compile and deploy a java script to a document  using NetBeans.

Prerequisites
netbeans_01 is executed before running this test case.
Delete directory <office-install>/user/Scripts/java/HelloNetBeans.
A previously created OpenOffice.org writer document, e.g. TestBindNB.sxw



 

1. Start NetBeans
 Right click on the HelloNetBeans in the right frame and select the previously opened HelloNetBeans.java file.
Change the "Hello NetBeans" line to "Hello NetBeans 2 ----"
Select File Save.

2.   Right click on  the HelloNetBeans directory and select compile. You should note that
the compile completes successfully from the lower right hand frame (output window) of NetBeans.

3. Right click on the HelloNetBeans  directory and select build,
In the dialog which appears select the HelloNetBeans.doMethod and add to scripts , select OK.
A HelloNetBeans parcel file should be built.

4. Right click on the Hello NetBeans parcel file and select Deploy to Office Document, select the previously saved
test document i.e. TestBindNB.sxw.

5. Check that the script has been successfully deployed to the document by running unzip -l  TestBindNB.sxw. (Unix) or pkunzip -v  TestBindNB.sxw (Windows). You should see the script saved in the document.

6. Assign an event  to execute the script.
- Start OpenOffice.org  writer document.
- Select Tools, Assign Script(java) To, Menu.
- In the popup dialog,
     in the select script function select a script e.g. HelloNetBeans.doMethod
    Select File in the Top Level menu drop down list.
    In the New Menu, enter a menu item name e.g. HelloNetBeans.
    Select New Script Menu, select ok.
- Select OK when prompted to restart OpenOffice.org. Exit and restart OpenOffice.org writer document.
- Select File, HelloNetBeans - Hello NetBeans should be inserted into the document.
 




 
 

Test Case: netbeans_03

Test Area: Solaris  - Linux - Windows

Test Aim
Delete a script  deployed to a document  using NetBeans.

Prerequisits
netbeans_02 is executed before running this test case.


1. Start NetBeans.
Mount the file system where  TestBindNB.sxw. is stored.

2. Expand the file TestBindNB.sxw file . Right click on the PARCEL_FILE and select Delete.

3. The Script saved in the office document TestBindNB.sxw should now be deleted.

4. Check that it is deleted by running unzip -l TestBindNB.sxw. (Unix) or pkunzip -v TestBindNB.sxw (Windows). You should see that  the previously saved  script in the document is now gone.