diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-10-06 12:30:20 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-10-06 12:30:20 +0000 |
commit | 39df1ada3fb0d719af2258e2654ac302971e83d3 (patch) | |
tree | 81861fafa725888fbb5c05ad649353020d38e9b5 /qadevOOo | |
parent | 8f2b7e47e5d0e9ecea5e14d0752a9758d22b6257 (diff) |
INTEGRATION: CWS qadev12 (1.3.2); FILE MERGED
2003/09/30 08:32:08 cn 1.3.2.2: CHG: #112259# parsing for XMultiServiceFactory
2003/09/19 12:34:05 cn 1.3.2.1: CHG: #i19645# removed dispatching of invalid URL: XDispatchRecorderSupplier does not validate dispatched URLs
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java index ed945d21b61e..0bc70c5360e6 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java @@ -2,9 +2,9 @@ * * $RCSfile: _XDispatchRecorderSupplier.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change:$Date: 2003-09-08 10:39:02 $ + * last change:$Date: 2003-10-06 13:30:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,23 +61,22 @@ package ifc.frame; -import lib.MultiMethodTest; -import lib.StatusException; -import util.SOfficeFactory; -import util.utils; - import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XDesktop; import com.sun.star.frame.XDispatch; import com.sun.star.frame.XDispatchProvider; import com.sun.star.frame.XDispatchRecorder; +import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.frame.XDispatchRecorderSupplier; import com.sun.star.frame.XFrame; import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.util.URL; +import lib.MultiMethodTest; +import lib.StatusException; +import util.SOfficeFactory; +import util.utils; /** * Testing <code>com.sun.star.frame.XDispatchRecorderSupplier</code> @@ -118,14 +117,14 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { * service created for obtaining document's frame. */ protected void before() { - SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()); + SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory) tParam.getMSF()); try { log.println( "creating a text document" ); xTextDoc = SOF.createTextDoc(null); - Object inst = (XInterface)((XMultiServiceFactory)tParam.getMSF()) - .createInstance("com.sun.star.frame.Desktop"); + Object inst = (XInterface)((XMultiServiceFactory)tParam.getMSF()).createInstance + ("com.sun.star.frame.Desktop"); desktop = (XDesktop) UnoRuntime.queryInterface (XDesktop.class, inst); } catch ( com.sun.star.uno.Exception e ) { @@ -207,7 +206,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { boolean res = true; if (recorder == null) { try { - Object inst = ((XMultiServiceFactory)tParam.getMSF()).createInstance + Object inst = ((XMultiServiceFactory) tParam.getMSF()).createInstance ("com.sun.star.comp.framework.DispatchRecorder"); recorder = (XDispatchRecorder) UnoRuntime.queryInterface (XDispatchRecorder.class, inst); @@ -225,7 +224,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, fr); - URL dispURL = utils.parseURL((XMultiServiceFactory)tParam.getMSF(), ".uno:InsertText"); + URL dispURL = utils.parseURL((XMultiServiceFactory) tParam.getMSF(), ".uno:InsertText"); XDispatch xDisp = xDispProv.queryDispatch(dispURL,"",0); PropertyValue[] args = new PropertyValue[1]; @@ -245,16 +244,6 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { res &= locRes; log.println("Recorder macro :\n" + macro); - log.print("Trying to dispatch with invalid URL ..."); - URL badURL = utils.parseURL((XMultiServiceFactory)tParam.getMSF(), ".uno:AbraCadabra"); - oObj.dispatchAndRecord(badURL, args, xDisp); - macro = recorder.getRecordedMacro(); - locRes &= macro != null && macro.indexOf(".uno:AbraCadabra")==-1; - if (locRes) log.println("OK"); - else log.println("FAILED"); - res &= locRes; - log.println("Recorder macro :\n" + macro); - log.print("Trying to set dispatch with null Dispatcher ..."); try { oObj.dispatchAndRecord(dispURL, args, null); @@ -283,4 +272,4 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { protected void after() { xTextDoc.dispose(); } -} +}
\ No newline at end of file |