tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _sw / SwXTextDefaults.java
blob1b02f44d35102ce72bb8db9a2f59a001de3d4842
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 //API Interfaces
22 import java.io.PrintWriter;
24 import lib.TestCase;
25 import lib.TestEnvironment;
26 import lib.TestParameters;
27 import util.SOfficeFactory;
29 import com.sun.star.lang.XMultiServiceFactory;
30 import com.sun.star.text.XTextDocument;
31 import com.sun.star.uno.UnoRuntime;
32 import com.sun.star.uno.XInterface;
34 /**
35 * Test for object which is represented by service
36 * <code>com.sun.star.text.Defaults</code> created by a writer
37 * document's <code>XMultiServiceFactory</code>. <p>
39 * Object implements the following interfaces :
40 * <ul>
41 * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
42 * <li> <code>com::sun::star::style::CharacterPropertiesComplex</code></li>
43 * <li> <code>com::sun::star::style::CharacterPropertiesAsian</code></li>
44 * <li> <code>com::sun::star::text::Defaults</code></li>
45 * <li> <code>com::sun::star::style::CharacterProperties</code></li>
46 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
47 * <li> <code>com::sun::star::style::ParagraphPropertiesComplex</code></li>
48 * </ul> <p>
50 * @see com.sun.star.style.ParagraphProperties
51 * @see com.sun.star.style.CharacterPropertiesComplex
52 * @see com.sun.star.style.CharacterPropertiesAsian
53 * @see com.sun.star.text.Defaults
54 * @see com.sun.star.style.CharacterProperties
55 * @see com.sun.star.beans.XPropertySet
56 * @see com.sun.star.style.ParagraphPropertiesComplex
57 * @see ifc.style._ParagraphProperties
58 * @see ifc.style._CharacterPropertiesComplex
59 * @see ifc.style._CharacterPropertiesAsian
60 * @see ifc.text._Defaults
61 * @see ifc.style._CharacterProperties
62 * @see ifc.beans._XPropertySet
63 * @see ifc.style._ParagraphPropertiesComplex
65 public class SwXTextDefaults extends TestCase {
67 XTextDocument xTextDoc;
69 /**
70 * Creates the service <code>com.sun.star.text.Defaults</code>
72 @Override
73 protected TestEnvironment createTestEnvironment(
74 TestParameters tParam, PrintWriter log) throws Exception {
76 XInterface oObj = null;
78 XMultiServiceFactory docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class,xTextDoc);
80 oObj = (XInterface)
81 docMSF.createInstance("com.sun.star.text.Defaults");
83 TestEnvironment tEnv = new TestEnvironment(oObj);
85 return tEnv;
88 /**
89 * Creates text document.
91 @Override
92 protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
93 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF() );
94 log.println( "creating a textdocument" );
95 xTextDoc = SOF.createTextDoc( null );
98 /**
99 * Disposes text document.
101 @Override
102 protected void cleanup( TestParameters tParam, PrintWriter log ) {
103 log.println( " disposing xTextDoc " );
104 util.DesktopTools.closeDoc(xTextDoc);