diff options
author | Tomas O'Connor <toconnor@openoffice.org> | 2003-03-25 10:27:06 +0000 |
---|---|---|
committer | Tomas O'Connor <toconnor@openoffice.org> | 2003-03-25 10:27:06 +0000 |
commit | 945abd8ce8e081e524ac5d34a63d37ad2b654a45 (patch) | |
tree | 3209b3eba5d2b0ab824a3c36a9dca02c7060f857 /scripting | |
parent | 9a5d88733783a459360463581672c0e17d9b851e (diff) |
Updates to jSuite tests.
Diffstat (limited to 'scripting')
17 files changed, 71 insertions, 46 deletions
diff --git a/scripting/workben/data/ExampleSpreadSheetLatest.sxc b/scripting/workben/data/ExampleSpreadSheetLatest.sxc Binary files differnew file mode 100644 index 000000000000..7be6c0d4be05 --- /dev/null +++ b/scripting/workben/data/ExampleSpreadSheetLatest.sxc diff --git a/scripting/workben/data/doc_with_one_script.sxw b/scripting/workben/data/doc_with_one_script.sxw Binary files differnew file mode 100644 index 000000000000..7445f4afca47 --- /dev/null +++ b/scripting/workben/data/doc_with_one_script.sxw diff --git a/scripting/workben/data/doc_with_two_scripts.sxw b/scripting/workben/data/doc_with_two_scripts.sxw Binary files differnew file mode 100644 index 000000000000..23a12ac9f86a --- /dev/null +++ b/scripting/workben/data/doc_with_two_scripts.sxw diff --git a/scripting/workben/data/script_in_class_file.sxw b/scripting/workben/data/script_in_class_file.sxw Binary files differnew file mode 100644 index 000000000000..ddb44c14d2d3 --- /dev/null +++ b/scripting/workben/data/script_in_class_file.sxw diff --git a/scripting/workben/data/script_in_jar_file.sxw b/scripting/workben/data/script_in_jar_file.sxw Binary files differnew file mode 100644 index 000000000000..93b10494d266 --- /dev/null +++ b/scripting/workben/data/script_in_jar_file.sxw diff --git a/scripting/workben/data/xscriptcontext_test_document.sxw b/scripting/workben/data/xscriptcontext_test_document.sxw Binary files differnew file mode 100644 index 000000000000..da6dafb0b805 --- /dev/null +++ b/scripting/workben/data/xscriptcontext_test_document.sxw diff --git a/scripting/workben/ifc/scripting/SecurityDialogUtil.java b/scripting/workben/ifc/scripting/SecurityDialogUtil.java index 86f293ef515f..0c58caad2901 100644 --- a/scripting/workben/ifc/scripting/SecurityDialogUtil.java +++ b/scripting/workben/ifc/scripting/SecurityDialogUtil.java @@ -2,9 +2,9 @@ * * $RCSfile: SecurityDialogUtil.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change:$Date: 2003-02-26 09:56:36 $ + * last change:$Date: 2003-03-25 11:26:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -124,7 +124,7 @@ public void run() // wait for the message box to appear try { - Thread.currentThread().sleep(2000) ; + Thread.currentThread().sleep(4000) ; } catch (InterruptedException e) { @@ -157,21 +157,21 @@ public void run() XInterface oObj = null; try { - System.err.println("Name of the AccessibleContext:\n\t"+ - xCon.getAccessibleName()); + /* System.err.println("Name of the AccessibleContext:\n\t"+ + xCon.getAccessibleName()); */ int count = xCon.getAccessibleChildCount(); - System.err.println("Number of children: "+count); + // System.err.println("Number of children: "+count); for (int i=0; i<count; i++) { XAccessible xAcc = xCon.getAccessibleChild(i); String name = xAcc.getAccessibleContext().getAccessibleName(); - System.out.println("Child "+i+": "+ name); + // System.out.println("Child "+i+": "+ name); // check for button if ( name.equals( btnName ) && ( UnoRuntime.queryInterface( XButton.class, xAcc ) != null ) ) { + // System.out.println("Child "+i+": "+ name); oObj = xAcc.getAccessibleContext(); - break; } // check for checkbox if ( checkBox && ( UnoRuntime.queryInterface( XCheckBox.class, xAcc ) != null ) ) @@ -182,8 +182,8 @@ public void run() (XAccessibleAction)UnoRuntime.queryInterface( XAccessibleAction.class, xAcc.getAccessibleContext()); xAction.doAccessibleAction(0); + // might be worth using oObj2 to double check the new state?? - break; } } if (oObj == null) { diff --git a/scripting/workben/ifc/scripting/_XScriptInfo.java b/scripting/workben/ifc/scripting/_XScriptInfo.java index 2fb4c625b3b4..22c3a6c14a4c 100644 --- a/scripting/workben/ifc/scripting/_XScriptInfo.java +++ b/scripting/workben/ifc/scripting/_XScriptInfo.java @@ -2,9 +2,9 @@ * * $RCSfile: _XScriptInfo.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change:$Date: 2003-02-25 16:22:04 $ + * last change:$Date: 2003-03-25 11:26:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/scripting/workben/ifc/scripting/_XScriptInvocation.java b/scripting/workben/ifc/scripting/_XScriptInvocation.java index 74a378eedf78..6ceb39c56b18 100644 --- a/scripting/workben/ifc/scripting/_XScriptInvocation.java +++ b/scripting/workben/ifc/scripting/_XScriptInvocation.java @@ -2,9 +2,9 @@ * * $RCSfile: _XScriptInvocation.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change:$Date: 2003-03-05 15:29:36 $ + * last change:$Date: 2003-03-25 11:26:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,7 @@ * ************************************************************************/ -package ifc.script.framework; +package ifc.script.framework.runtime; import java.util.HashMap; import java.util.Iterator; @@ -149,7 +149,9 @@ public class _XScriptInvocation extends MultiMethodTest { log.println(description + ": " + logicalname); try { - oObj.invoke(logicalname, params, args, num, result); + Object ret = oObj.invoke(logicalname, params, args, num, result); + log.println("return type is: " + ret.getClass().getName() + + ", value is: " + ret.toString()); output = "success"; } catch (com.sun.star.lang.IllegalArgumentException iae) { diff --git a/scripting/workben/ifc/scripting/_XScriptNameResolver.java b/scripting/workben/ifc/scripting/_XScriptNameResolver.java index 112f5d7b5d39..902da7381000 100644 --- a/scripting/workben/ifc/scripting/_XScriptNameResolver.java +++ b/scripting/workben/ifc/scripting/_XScriptNameResolver.java @@ -2,9 +2,9 @@ * * $RCSfile: _XScriptNameResolver.java,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change:$Date: 2003-03-05 15:29:36 $ + * last change:$Date: 2003-03-25 11:26:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,7 @@ * ************************************************************************/ -package ifc.script.framework; +package ifc.script.framework.runtime; import java.util.HashMap; import java.util.Iterator; diff --git a/scripting/workben/ifc/scripting/_XScriptSecurity.java b/scripting/workben/ifc/scripting/_XScriptSecurity.java index 1d136134d689..e28a1e5431be 100644 --- a/scripting/workben/ifc/scripting/_XScriptSecurity.java +++ b/scripting/workben/ifc/scripting/_XScriptSecurity.java @@ -2,9 +2,9 @@ * * $RCSfile: _XScriptSecurity.java,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change:$Date: 2003-02-27 15:59:09 $ + * last change:$Date: 2003-03-25 11:26:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -120,6 +120,10 @@ public class _XScriptSecurity extends MultiMethodTest { result = false; } + // set security to always without confirmation dialog and empty path + // list so other tests can run without dialog popping up + setSecurity(2, "false", "false", null); + tRes.tested("checkPermission()", result); } @@ -150,6 +154,8 @@ public class _XScriptSecurity extends MultiMethodTest { String output = null; + log.println(description); + // get the officeBasic setting int officeBasic = 0; if( runmacro.equals("never") ) @@ -172,10 +178,6 @@ public class _XScriptSecurity extends MultiMethodTest { String uri = util.utils.getFullTestURL(location); secureURLs = uri.substring(0, uri.lastIndexOf('/')); } - else if ( pathlist.equals("false") ) - { - secureURLs = ""; - } if ( !setSecurity( officeBasic, confirm, warning, secureURLs ) ) { @@ -207,6 +209,14 @@ public class _XScriptSecurity extends MultiMethodTest { output = "false"; } } + catch (com.sun.star.security.AccessControlException ace) { + log.println("Couldn't invoke script:" + ace); + output = "com.sun.star.security.AccessControlException"; + } + catch (com.sun.star.lang.IllegalArgumentException iae) { + log.println("Couldn't invoke script:" + iae); + output = "com.sun.star.lang.IllegalArgumentException"; + } catch (com.sun.star.uno.RuntimeException re) { log.println("Couldn't invoke script:" + re); output = "com.sun.star.uno.RuntimeException"; @@ -218,7 +228,7 @@ public class _XScriptSecurity extends MultiMethodTest { if( checkpath.equals("true") ) { String setPath = getPathList(); - String expectedPath = ""; + String expectedPath = "empty"; if( checkBoxStr.equals( "true" ) ) { String uri = util.utils.getFullTestURL(location); @@ -267,10 +277,16 @@ public class _XScriptSecurity extends MultiMethodTest { aArgs ); XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, oConfigUpdate ); - result = (String) xPropertySet.getPropertyValue( "SecureURL" ); + + String[] paths = (String[])xPropertySet.getPropertyValue("SecureURL"); + if (paths == null || paths.length == 0) + result = "empty"; + else + result = paths[0]; + } catch (Exception e) { - result = "Exception getting list of secure URLs"; + result = e.getClass().getName() + " getting list of secure URLs"; } return result; } @@ -306,12 +322,18 @@ public class _XScriptSecurity extends MultiMethodTest { XChangesBatch xChangesBatch = (XChangesBatch)UnoRuntime.queryInterface( XChangesBatch.class, oConfigUpdate ); - Object[] aSecureURLs = new Object[1]; - aSecureURLs[0]=secureURLs; - log.println("settting SecureURL"); + Object[] aSecureURLs; + if (secureURLs == null) { + aSecureURLs = new Object[0]; + } + else { + aSecureURLs = new Object[1]; + aSecureURLs[0] = secureURLs; + } + log.println("setting SecureURL"); xNameReplace.replaceByName( "SecureURL", aSecureURLs ); - log.println("settting OfficeBasic"); + log.println("setting OfficeBasic"); xNameReplace.replaceByName( "OfficeBasic", new Integer(officeBasic) ); Boolean bConfirm = null; @@ -323,7 +345,7 @@ public class _XScriptSecurity extends MultiMethodTest { { bConfirm = new Boolean( false ); } - log.println("settting Confirmation"); + log.println("setting Confirmation"); xNameReplace.replaceByName( "Confirmation", bConfirm ); Boolean bWarning = null; @@ -335,7 +357,7 @@ public class _XScriptSecurity extends MultiMethodTest { { bWarning = new Boolean( false ); } - log.println("settting Warning"); + log.println("setting Warning"); xNameReplace.replaceByName( "Warning", bWarning ); // and now commit the changes diff --git a/scripting/workben/ifc/scripting/_XScriptStorageManager.java b/scripting/workben/ifc/scripting/_XScriptStorageManager.java index 01e9cc445306..1aa62e0bafb9 100644 --- a/scripting/workben/ifc/scripting/_XScriptStorageManager.java +++ b/scripting/workben/ifc/scripting/_XScriptStorageManager.java @@ -2,9 +2,9 @@ * * $RCSfile: _XScriptStorageManager.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change:$Date: 2002-12-10 14:12:06 $ + * last change:$Date: 2003-03-25 11:26:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -252,6 +252,7 @@ public class _XScriptStorageManager extends MultiMethodTest { try { String uri = util.utils.getFullTestURL(location); + log.println("calling refreshScriptStorage with URI: " + uri); oObj.refreshScriptStorage(uri); output = "success"; } diff --git a/scripting/workben/mod/_scripting/Dispatch.java b/scripting/workben/mod/_scripting/Dispatch.java index bed97a790f77..a49ef358415d 100644 --- a/scripting/workben/mod/_scripting/Dispatch.java +++ b/scripting/workben/mod/_scripting/Dispatch.java @@ -2,9 +2,9 @@ * * $RCSfile: Dispatch.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change:$Date: 2003-02-25 16:22:06 $ + * last change:$Date: 2003-03-25 11:26:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/scripting/workben/mod/_scripting/Function.java b/scripting/workben/mod/_scripting/Function.java index 604baa0a3ee5..fabbaa5a8352 100644 --- a/scripting/workben/mod/_scripting/Function.java +++ b/scripting/workben/mod/_scripting/Function.java @@ -2,9 +2,9 @@ * * $RCSfile: Function.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change:$Date: 2003-02-25 16:22:07 $ + * last change:$Date: 2003-03-25 11:26:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/scripting/workben/mod/_scripting/ScriptInfo.java b/scripting/workben/mod/_scripting/ScriptInfo.java index bfd692033f54..92482832680b 100644 --- a/scripting/workben/mod/_scripting/ScriptInfo.java +++ b/scripting/workben/mod/_scripting/ScriptInfo.java @@ -2,9 +2,9 @@ * * $RCSfile: ScriptInfo.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change:$Date: 2003-02-25 16:22:07 $ + * last change:$Date: 2003-03-25 11:26:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/scripting/workben/mod/_scripting/ScriptRuntimeManager.java b/scripting/workben/mod/_scripting/ScriptRuntimeManager.java index 1f8b2a71c8f4..834aa0d21411 100644 --- a/scripting/workben/mod/_scripting/ScriptRuntimeManager.java +++ b/scripting/workben/mod/_scripting/ScriptRuntimeManager.java @@ -2,9 +2,9 @@ * * $RCSfile: ScriptRuntimeManager.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change:$Date: 2002-12-10 14:12:41 $ + * last change:$Date: 2003-03-25 11:26:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,7 +82,7 @@ public class ScriptRuntimeManager extends TestCase { try { oObj = (XInterface) Param.getMSF().createInstance - ("drafts.com.sun.star.script.framework.ScriptRuntimeManager"); + ("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager"); } catch (com.sun.star.uno.Exception e) { throw new StatusException("Can't create object environment", e) ; } diff --git a/scripting/workben/mod/_scripting/ScriptStorage.java b/scripting/workben/mod/_scripting/ScriptStorage.java index e8dfc22caf01..ff244567783a 100644 --- a/scripting/workben/mod/_scripting/ScriptStorage.java +++ b/scripting/workben/mod/_scripting/ScriptStorage.java @@ -2,9 +2,9 @@ * * $RCSfile: ScriptStorage.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change:$Date: 2003-02-25 16:22:08 $ + * last change:$Date: 2003-03-25 11:26:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses |