diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-12-10 16:03:51 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-12-10 16:03:51 +0000 |
commit | cc48d288c4ad46dad0cb6e0e6d73099949a90f3f (patch) | |
tree | 89d28d409c1352135affb46bf6e661ed891b5463 /qadevOOo/tests/java/mod/_fwl | |
parent | eb4ad60217f036b5d3680c82572e4b2333877a3d (diff) |
INTEGRATION: CWS qadev20 (1.6.74); FILE MERGED
2004/11/24 20:11:59 cn 1.6.74.1: #i36520# adopt test to handle jump marks in URLs
Diffstat (limited to 'qadevOOo/tests/java/mod/_fwl')
-rw-r--r-- | qadevOOo/tests/java/mod/_fwl/TypeDetection.java | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java index 00d6870aabb0..dea3e944b3ca 100644 --- a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java +++ b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java @@ -2,9 +2,9 @@ * * $RCSfile: TypeDetection.java,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change:$Date: 2004-01-28 19:29:07 $ + * last change:$Date: 2004-12-10 17:03:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,7 +76,11 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.beans.PropertyValue; +import com.sun.star.frame.XStorable; +import com.sun.star.text.XTextContent; +import com.sun.star.text.XTextDocument; import com.sun.star.uno.AnyConverter; +import util.SOfficeFactory; /** * Test for object which is represented by service @@ -111,6 +115,16 @@ import com.sun.star.uno.AnyConverter; public class TypeDetection extends TestCase { /** + * Disposes text document. + */ + protected void cleanup( TestParameters tParam, PrintWriter log ) { + log.println( " disposing xTextDoc " ); + //util.DesktopTools.closeDoc(xTextDoc); + } + + XTextDocument xTextDoc = null; + + /** * Creating a Testenvironment for the interfaces to be tested. * Creates an instance of the service * <code>com.sun.star.document.TypeDetection</code>. <p> @@ -167,8 +181,30 @@ public class TypeDetection extends TestCase { query.Value = "writer_Text"; querySequenze[0] = query; + + log.println("create text document with bookmarks"); + SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() ); + String fileURL = null; + try { + xTextDoc = SOF.createTextDoc( null ); + XInterface xBookMark = SOF.createBookmark( xTextDoc ); + SOF.insertTextContent( xTextDoc, (XTextContent) xBookMark ); + + fileURL = utils.getOfficeTemp((XMultiServiceFactory)Param.getMSF() ); + fileURL = fileURL + "/bookmarks.oot"; + + XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDoc); + System.out.println(fileURL); + store.storeToURL(fileURL, new PropertyValue[0]); + + } catch( com.sun.star.uno.Exception e ) { + e.printStackTrace( log ); + throw new StatusException( "Couldnt create Bookmark", e ); + } + tEnv.addObjRelation("XContainerQuery.createSubSetEnumerationByProperties", querySequenze); + tEnv.addObjRelation("XTypeDetection.bookmarkDoc", fileURL+"#bookmark"); return tEnv; } // finish method getTestEnvironment |