tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _sw / SwXPropertySetInfo.java
blobc47e0080b3e46e17b904784fdab34c1eba26f8fc
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.beans.XPropertySet;
29 import com.sun.star.text.XTextDocument;
30 import com.sun.star.uno.UnoRuntime;
31 import com.sun.star.uno.XInterface;
33 /**
34 * Test for object which is represented by PropertySetInfo of
35 * text document.<p>
36 * Object implements the following interfaces :
37 * <ul>
38 * <li> <code>com::sun::star::beans::XPropertySetInfo</code></li>
39 * </ul> <p>
40 * This object test <b> is NOT </b> designed to be run in several
41 * threads concurrently.
42 * @see com.sun.star.beans.XPropertySetInfo
43 * @see ifc.beans._XPropertySetInfo
45 public class SwXPropertySetInfo extends TestCase {
46 XTextDocument xTextDoc;
48 /**
49 * Disposes text document.
51 @Override
52 protected void cleanup( TestParameters Param, PrintWriter log) {
53 log.println( " disposing xTextDoc " );
54 util.DesktopTools.closeDoc(xTextDoc);
57 /**
58 * Creating a TestEnvironment for the interfaces to be tested. Method
59 * creates text document, then obtains PropertySetInfo of created text
60 * document using <code>XPropertySet</code> interface.
62 @Override
63 public TestEnvironment createTestEnvironment(
64 TestParameters Param, PrintWriter log ) throws Exception {
65 XInterface oObj = null;
67 log.println( "creating a test environment" );
68 SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() );
69 log.println( "creating a textdocument" );
70 xTextDoc = SOF.createTextDoc( null );
72 log.println( " getting the XPropertySetInfo" );
73 XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, xTextDoc);
74 oObj = xProp.getPropertySetInfo();
75 log.println( " creating a new environment for PropertySetInfo object" );
77 TestEnvironment tEnv = new TestEnvironment( oObj );
78 return tEnv;
79 } // finish method getTestEnvironment
81 } // finish class SwXPropertySetInfo