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
;
23 import lib
.StatusException
;
25 import lib
.TestEnvironment
;
26 import lib
.TestParameters
;
27 import util
.SOfficeFactory
;
29 import com
.sun
.star
.text
.XTextDocument
;
30 import com
.sun
.star
.text
.XTextTable
;
31 import com
.sun
.star
.uno
.XInterface
;
36 * @see com.sun.star.beans.XPropertySet
37 * @see com.sun.star.text.XTextTableCursor
40 public class SwXTextTableCursor
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( TestParameters tParam
,
72 throws StatusException
{
74 XInterface oObj
= null;
76 // creation of testobject here
77 // first we write what we are intend to do to log file
78 log
.println( "creating a test environment" );
80 // get a soffice factory object
81 SOfficeFactory
.getFactory( tParam
.getMSF() );
83 // create testobject here
85 XTextTable oTable
= null;
86 oTable
= SOfficeFactory
.createTextTable( xTextDoc
);
87 SOfficeFactory
.insertTextContent(xTextDoc
, oTable
);
89 oObj
= oTable
.createCursorByCellName("A1");
91 log
.println( "creating a new environment for TextTableCursor object" );
92 TestEnvironment tEnv
= new TestEnvironment( oObj
);
94 log
.println( "adding TextDocument as mod relation to environment" );
95 tEnv
.addObjRelation("TEXTDOC", xTextDoc
);
97 tEnv
.addObjRelation("STYLENAME1", "Table");
98 tEnv
.addObjRelation("STYLENAME2", "Text");
101 } // finish method getTestEnvironment
103 } // finish class SwXTextTableCursor