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 .
21 import java
.io
.PrintWriter
;
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
;
34 * Test for object which is represented by PropertySetInfo of
36 * Object implements the following interfaces :
38 * <li> <code>com::sun::star::beans::XPropertySetInfo</code></li>
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
;
49 * Disposes text document.
52 protected void cleanup( TestParameters Param
, PrintWriter log
) {
53 log
.println( " disposing xTextDoc " );
54 util
.DesktopTools
.closeDoc(xTextDoc
);
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.
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
);
79 } // finish method getTestEnvironment
81 } // finish class SwXPropertySetInfo