summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2007-08-02 16:03:27 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2007-08-02 16:03:27 +0000
commit604a72dee12e6d073a5abcb8471e6c6dd8e91546 (patch)
tree445a36929183cabbca75be0d5843579fee8f5f68
parenta535569126ddd7fab0e92ad5ab589e66faf69bfb (diff)
INTEGRATION: CWS fwk69 (1.3.186); FILE MERGED
2007/07/23 07:24:06 as 1.3.186.1: new test for interception
-rw-r--r--framework/qa/complex/dispatches/checkdispatchapi.java36
1 files changed, 33 insertions, 3 deletions
diff --git a/framework/qa/complex/dispatches/checkdispatchapi.java b/framework/qa/complex/dispatches/checkdispatchapi.java
index c0dabfca5939..c5b007631dbf 100644
--- a/framework/qa/complex/dispatches/checkdispatchapi.java
+++ b/framework/qa/complex/dispatches/checkdispatchapi.java
@@ -4,9 +4,9 @@
*
* $RCSfile: checkdispatchapi.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obo $ $Date: 2006-07-13 15:15:31 $
+ * last change: $Author: hr $ $Date: 2007-08-02 17:03:27 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -99,7 +99,8 @@ public class checkdispatchapi extends ComplexTestCase
"checkDispatchInfoOfRelationDesign",
"checkDispatchInfoOfBasic",
"checkDispatchInfoOfStartModule",
- "checkInterceptorLifeTime"
+ "checkInterceptorLifeTime",
+ "checkInterception"
};
}
@@ -286,6 +287,35 @@ public class checkdispatchapi extends ComplexTestCase
}
//-------------------------------------------
+ public void checkInterception()
+ {
+ String [] lDisabledURLs = new String [1];
+ lDisabledURLs[0] = ".uno:Open";
+
+ log.println("create and initialize interceptor ...");
+ Interceptor aInterceptor = new Interceptor(log);
+ aInterceptor.setURLs4URLs4Blocking(lDisabledURLs);
+
+ com.sun.star.frame.XDispatchProviderInterceptor xInterceptor = (com.sun.star.frame.XDispatchProviderInterceptor)UnoRuntime.queryInterface(
+ com.sun.star.frame.XDispatchProviderInterceptor.class,
+ aInterceptor);
+
+ log.println("create and initialize frame ...");
+ com.sun.star.frame.XFrame xFrame = impl_createNewFrame();
+ impl_loadIntoFrame(xFrame, "private:factory/swriter", null);
+
+ com.sun.star.frame.XDispatchProviderInterception xInterception = (com.sun.star.frame.XDispatchProviderInterception)UnoRuntime.queryInterface(
+ com.sun.star.frame.XDispatchProviderInterception.class,
+ xFrame);
+
+ log.println("register interceptor ...");
+ xInterception.registerDispatchProviderInterceptor(xInterceptor);
+
+ log.println("deregister interceptor ...");
+ xInterception.releaseDispatchProviderInterceptor(xInterceptor);
+ }
+
+ //-------------------------------------------
private void impl_checkDispatchInfoOfXXX(String sXXX)
{
XFrame xFrame = impl_createNewFrame();