tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _sw / SwXTextViewCursor.java
blob1ee16ff4e1363ab382dd853ce2a892421ac6e15e
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package mod._sw;
21 import java.io.PrintWriter;
23 import lib.TestCase;
24 import lib.TestEnvironment;
25 import lib.TestParameters;
26 import util.SOfficeFactory;
28 import com.sun.star.text.XTextDocument;
29 import com.sun.star.text.XTextViewCursorSupplier;
30 import com.sun.star.uno.UnoRuntime;
31 import com.sun.star.uno.XInterface;
32 /**
34 * initial description
35 * @see com.sun.star.beans.XPropertySet
36 * @see com.sun.star.beans.XPropertyState
37 * @see com.sun.star.document.XDocumentInsertable
38 * @see com.sun.star.style.CharacterProperties
39 * @see com.sun.star.style.ParagraphProperties
40 * @see com.sun.star.text.XPageCursor
41 * @see com.sun.star.text.XParagraphCursor
42 * @see com.sun.star.text.XSentenceCursor
43 * @see com.sun.star.text.XTextCursor
44 * @see com.sun.star.text.XTextRange
45 * @see com.sun.star.text.XWordCursor
46 * @see com.sun.star.util.XSortable
47 * @see com.sun.star.view.XScreenCursor
50 public class SwXTextViewCursor extends TestCase {
51 XTextDocument xTextDoc;
53 @Override
54 protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
55 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
57 log.println( "creating a textdocument" );
58 xTextDoc = SOF.createTextDoc( null );
61 @Override
62 protected void cleanup( TestParameters tParam, PrintWriter log ) {
63 log.println( " disposing xTextDoc " );
64 util.DesktopTools.closeDoc(xTextDoc);
68 /**
69 * creating a TestEnvironment for the interfaces to be tested
71 * @param tParam class which contains additional test parameters
72 * @param log class to log the test state and result
74 * @return Status class
76 * @see TestParameters
77 * @see PrintWriter
79 @Override
80 public TestEnvironment createTestEnvironment
81 (TestParameters tParam, PrintWriter log) {
83 XInterface oObj = null;
85 // creation of testobject here
86 // first we write what we are intend to do to log file
87 log.println( "creating a test environment" );
89 // create testobject here
90 oObj = xTextDoc.getCurrentController();
92 XTextViewCursorSupplier oTVCSupp = UnoRuntime.queryInterface(XTextViewCursorSupplier.class, oObj);
94 oObj = oTVCSupp.getViewCursor();
96 log.println( "creating a new environment for TextViewCursor object" );
97 TestEnvironment tEnv = new TestEnvironment( oObj );
99 log.println( "adding TextDocument as mod relation to environment" );
100 tEnv.addObjRelation("TEXTDOC", xTextDoc);
101 tEnv.addObjRelation("XTEXT", xTextDoc.getText());
103 return tEnv;
104 } // finish method getTestEnvironment
107 } // finish class SwXTextViewCursor