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
.text
.XTextDocument
;
29 import com
.sun
.star
.uno
.UnoRuntime
;
30 import com
.sun
.star
.uno
.XInterface
;
31 import com
.sun
.star
.view
.XViewSettingsSupplier
;
36 * @see com.sun.star.beans.XPropertySet
37 * @see com.sun.star.text.ViewSettings
40 public class SwXViewSettings
extends TestCase
{
41 XTextDocument xTextDoc
;
44 protected void initialize( TestParameters tParam
, PrintWriter log
) throws Exception
{
45 SOfficeFactory SOF
= SOfficeFactory
.getFactory( tParam
.getMSF() );
47 log
.println( "creating a textdocument" );
48 xTextDoc
= SOF
.createTextDoc( null );
52 protected void cleanup( TestParameters tParam
, PrintWriter log
) {
53 log
.println( " disposing xTextDoc " );
54 util
.DesktopTools
.closeDoc(xTextDoc
);
59 * creating a TestEnvironment for the interfaces to be tested
61 * @param tParam class which contains additional test parameters
62 * @param log class to log the test state and result
64 * @return Status class
70 public TestEnvironment createTestEnvironment
71 (TestParameters tParam
, PrintWriter log
) {
73 XInterface oObj
= null;
75 // creation of testobject here
76 // first we write what we are intend to do to log file
77 log
.println( "creating a test environment" );
79 // create testobject here
81 oObj
= xTextDoc
.getCurrentController();
82 XViewSettingsSupplier oVSSupp
= UnoRuntime
.queryInterface(XViewSettingsSupplier
.class, oObj
);
84 oObj
= oVSSupp
.getViewSettings();
86 log
.println( "creating a new environment for ViewSettings object" );
87 TestEnvironment tEnv
= new TestEnvironment( oObj
);
89 log
.println( "adding TextDocument as mod relation to environment" );
90 tEnv
.addObjRelation("TEXTDOC", xTextDoc
);
93 } // finish method getTestEnvironment
96 } // finish class SwXViewSettings