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 .
22 import java
.io
.PrintWriter
;
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
;
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 :
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>
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
;
70 * Creates the service <code>com.sun.star.text.Defaults</code>
73 protected TestEnvironment
createTestEnvironment(
74 TestParameters tParam
, PrintWriter log
) throws Exception
{
76 XInterface oObj
= null;
78 XMultiServiceFactory docMSF
= UnoRuntime
.queryInterface(XMultiServiceFactory
.class,xTextDoc
);
81 docMSF
.createInstance("com.sun.star.text.Defaults");
83 TestEnvironment tEnv
= new TestEnvironment(oObj
);
89 * Creates text document.
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 );
99 * Disposes text document.
102 protected void cleanup( TestParameters tParam
, PrintWriter log
) {
103 log
.println( " disposing xTextDoc " );
104 util
.DesktopTools
.closeDoc(xTextDoc
);