Kaydet (Commit) 945abd8c authored tarafından Tomas O'Connor's avatar Tomas O'Connor

Updates to jSuite tests.

üst 9a5d8873
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: SecurityDialogUtil.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -124,7 +124,7 @@ public void run() ...@@ -124,7 +124,7 @@ public void run()
// wait for the message box to appear // wait for the message box to appear
try try
{ {
Thread.currentThread().sleep(2000) ; Thread.currentThread().sleep(4000) ;
} }
catch (InterruptedException e) catch (InterruptedException e)
{ {
...@@ -157,21 +157,21 @@ public void run() ...@@ -157,21 +157,21 @@ public void run()
XInterface oObj = null; XInterface oObj = null;
try try
{ {
System.err.println("Name of the AccessibleContext:\n\t"+ /* System.err.println("Name of the AccessibleContext:\n\t"+
xCon.getAccessibleName()); xCon.getAccessibleName()); */
int count = xCon.getAccessibleChildCount(); 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++) { for (int i=0; i<count; i++) {
XAccessible xAcc = xCon.getAccessibleChild(i); XAccessible xAcc = xCon.getAccessibleChild(i);
String name = String name =
xAcc.getAccessibleContext().getAccessibleName(); xAcc.getAccessibleContext().getAccessibleName();
System.out.println("Child "+i+": "+ name); // System.out.println("Child "+i+": "+ name);
// check for button // check for button
if ( name.equals( btnName ) && ( UnoRuntime.queryInterface( if ( name.equals( btnName ) && ( UnoRuntime.queryInterface(
XButton.class, xAcc ) != null ) ) XButton.class, xAcc ) != null ) )
{ {
// System.out.println("Child "+i+": "+ name);
oObj = xAcc.getAccessibleContext(); oObj = xAcc.getAccessibleContext();
break;
} }
// check for checkbox // check for checkbox
if ( checkBox && ( UnoRuntime.queryInterface( XCheckBox.class, xAcc ) != null ) ) if ( checkBox && ( UnoRuntime.queryInterface( XCheckBox.class, xAcc ) != null ) )
...@@ -182,8 +182,8 @@ public void run() ...@@ -182,8 +182,8 @@ public void run()
(XAccessibleAction)UnoRuntime.queryInterface( (XAccessibleAction)UnoRuntime.queryInterface(
XAccessibleAction.class, xAcc.getAccessibleContext()); XAccessibleAction.class, xAcc.getAccessibleContext());
xAction.doAccessibleAction(0); xAction.doAccessibleAction(0);
// might be worth using oObj2 to double check the new state?? // might be worth using oObj2 to double check the new state??
break;
} }
} }
if (oObj == null) { if (oObj == null) {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: _XScriptInfo.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: _XScriptInvocation.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
* *
************************************************************************/ ************************************************************************/
package ifc.script.framework; package ifc.script.framework.runtime;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
...@@ -149,7 +149,9 @@ public class _XScriptInvocation extends MultiMethodTest { ...@@ -149,7 +149,9 @@ public class _XScriptInvocation extends MultiMethodTest {
log.println(description + ": " + logicalname); log.println(description + ": " + logicalname);
try { 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"; output = "success";
} }
catch (com.sun.star.lang.IllegalArgumentException iae) { catch (com.sun.star.lang.IllegalArgumentException iae) {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: _XScriptNameResolver.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
* *
************************************************************************/ ************************************************************************/
package ifc.script.framework; package ifc.script.framework.runtime;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: _XScriptSecurity.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -120,6 +120,10 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -120,6 +120,10 @@ public class _XScriptSecurity extends MultiMethodTest {
result = false; 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); tRes.tested("checkPermission()", result);
} }
...@@ -150,6 +154,8 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -150,6 +154,8 @@ public class _XScriptSecurity extends MultiMethodTest {
String output = null; String output = null;
log.println(description);
// get the officeBasic setting // get the officeBasic setting
int officeBasic = 0; int officeBasic = 0;
if( runmacro.equals("never") ) if( runmacro.equals("never") )
...@@ -172,10 +178,6 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -172,10 +178,6 @@ public class _XScriptSecurity extends MultiMethodTest {
String uri = util.utils.getFullTestURL(location); String uri = util.utils.getFullTestURL(location);
secureURLs = uri.substring(0, uri.lastIndexOf('/')); secureURLs = uri.substring(0, uri.lastIndexOf('/'));
} }
else if ( pathlist.equals("false") )
{
secureURLs = "";
}
if ( !setSecurity( officeBasic, confirm, warning, secureURLs ) ) if ( !setSecurity( officeBasic, confirm, warning, secureURLs ) )
{ {
...@@ -207,6 +209,14 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -207,6 +209,14 @@ public class _XScriptSecurity extends MultiMethodTest {
output = "false"; 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) { catch (com.sun.star.uno.RuntimeException re) {
log.println("Couldn't invoke script:" + re); log.println("Couldn't invoke script:" + re);
output = "com.sun.star.uno.RuntimeException"; output = "com.sun.star.uno.RuntimeException";
...@@ -218,7 +228,7 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -218,7 +228,7 @@ public class _XScriptSecurity extends MultiMethodTest {
if( checkpath.equals("true") ) if( checkpath.equals("true") )
{ {
String setPath = getPathList(); String setPath = getPathList();
String expectedPath = ""; String expectedPath = "empty";
if( checkBoxStr.equals( "true" ) ) if( checkBoxStr.equals( "true" ) )
{ {
String uri = util.utils.getFullTestURL(location); String uri = util.utils.getFullTestURL(location);
...@@ -267,10 +277,16 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -267,10 +277,16 @@ public class _XScriptSecurity extends MultiMethodTest {
aArgs ); aArgs );
XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface( XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, oConfigUpdate ); 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) } catch (Exception e)
{ {
result = "Exception getting list of secure URLs"; result = e.getClass().getName() + " getting list of secure URLs";
} }
return result; return result;
} }
...@@ -306,12 +322,18 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -306,12 +322,18 @@ public class _XScriptSecurity extends MultiMethodTest {
XChangesBatch xChangesBatch = (XChangesBatch)UnoRuntime.queryInterface( XChangesBatch xChangesBatch = (XChangesBatch)UnoRuntime.queryInterface(
XChangesBatch.class, oConfigUpdate ); XChangesBatch.class, oConfigUpdate );
Object[] aSecureURLs = new Object[1]; Object[] aSecureURLs;
aSecureURLs[0]=secureURLs; if (secureURLs == null) {
log.println("settting SecureURL"); aSecureURLs = new Object[0];
}
else {
aSecureURLs = new Object[1];
aSecureURLs[0] = secureURLs;
}
log.println("setting SecureURL");
xNameReplace.replaceByName( "SecureURL", aSecureURLs ); xNameReplace.replaceByName( "SecureURL", aSecureURLs );
log.println("settting OfficeBasic"); log.println("setting OfficeBasic");
xNameReplace.replaceByName( "OfficeBasic", new Integer(officeBasic) ); xNameReplace.replaceByName( "OfficeBasic", new Integer(officeBasic) );
Boolean bConfirm = null; Boolean bConfirm = null;
...@@ -323,7 +345,7 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -323,7 +345,7 @@ public class _XScriptSecurity extends MultiMethodTest {
{ {
bConfirm = new Boolean( false ); bConfirm = new Boolean( false );
} }
log.println("settting Confirmation"); log.println("setting Confirmation");
xNameReplace.replaceByName( "Confirmation", bConfirm ); xNameReplace.replaceByName( "Confirmation", bConfirm );
Boolean bWarning = null; Boolean bWarning = null;
...@@ -335,7 +357,7 @@ public class _XScriptSecurity extends MultiMethodTest { ...@@ -335,7 +357,7 @@ public class _XScriptSecurity extends MultiMethodTest {
{ {
bWarning = new Boolean( false ); bWarning = new Boolean( false );
} }
log.println("settting Warning"); log.println("setting Warning");
xNameReplace.replaceByName( "Warning", bWarning ); xNameReplace.replaceByName( "Warning", bWarning );
// and now commit the changes // and now commit the changes
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: _XScriptStorageManager.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -252,6 +252,7 @@ public class _XScriptStorageManager extends MultiMethodTest { ...@@ -252,6 +252,7 @@ public class _XScriptStorageManager extends MultiMethodTest {
try { try {
String uri = util.utils.getFullTestURL(location); String uri = util.utils.getFullTestURL(location);
log.println("calling refreshScriptStorage with URI: " + uri);
oObj.refreshScriptStorage(uri); oObj.refreshScriptStorage(uri);
output = "success"; output = "success";
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: Dispatch.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: Function.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: ScriptInfo.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: ScriptRuntimeManager.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -82,7 +82,7 @@ public class ScriptRuntimeManager extends TestCase { ...@@ -82,7 +82,7 @@ public class ScriptRuntimeManager extends TestCase {
try { try {
oObj = (XInterface) Param.getMSF().createInstance 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) { } catch (com.sun.star.uno.Exception e) {
throw new StatusException("Can't create object environment", e) ; throw new StatusException("Can't create object environment", e) ;
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: ScriptStorage.java,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment