/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
package mod._sw;
import java.io.PrintWriter;
import java.util.Vector;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.SOfficeFactory;
import com.sun.star.beans.Property;
import com.sun.star.beans.PropertyAttribute;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.ControlCharacter;
import com.sun.star.text.XParagraphCursor;
import com.sun.star.text.XSimpleText;
import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
/**
* Test for object which is represented by service
* com.sun.star.text.TextCursor
.
* Object implements the following interfaces : *
com::sun::star::text::XTextCursor
com::sun::star::text::XWordCursor
com::sun::star::style::CharacterPropertiesComplex
com::sun::star::text::XTextRange
com::sun::star::beans::XPropertySet
com::sun::star::container::XContentEnumerationAccess
com::sun::star::beans::XPropertyState
com::sun::star::style::CharacterProperties
com::sun::star::text::XSentenceCursor
com::sun::star::style::ParagraphProperties
com::sun::star::text::XParagraphCursor
com::sun::star::document::XDocumentInsertable
com::sun::star::util::XSortable
com::sun::star::style::CharacterPropertiesAsian
* This object test is NOT designed to be run in several * threads concurently. * @see com.sun.star.text.XTextCursor * @see com.sun.star.text.XWordCursor * @see com.sun.star.style.CharacterPropertiesComplex * @see com.sun.star.text.XTextRange * @see com.sun.star.beans.XPropertySet * @see com.sun.star.container.XContentEnumerationAccess * @see com.sun.star.beans.XPropertyState * @see com.sun.star.style.CharacterProperties * @see com.sun.star.text.XSentenceCursor * @see com.sun.star.style.ParagraphProperties * @see com.sun.star.text.XParagraphCursor * @see com.sun.star.document.XDocumentInsertable * @see com.sun.star.util.XSortable * @see com.sun.star.style.CharacterPropertiesAsian * @see ifc.text._XTextCursor * @see ifc.text._XWordCursor * @see ifc.style._CharacterPropertiesComplex * @see ifc.text._XTextRange * @see ifc.beans._XPropertySet * @see ifc.container._XContentEnumerationAccess * @see ifc.beans._XPropertyState * @see ifc.style._CharacterProperties * @see ifc.text._XSentenceCursor * @see ifc.style._ParagraphProperties * @see ifc.text._XParagraphCursor * @see ifc.document._XDocumentInsertable * @see ifc.util._XSortable * @see ifc.style._CharacterPropertiesAsian */ public class SwXTextCursor extends TestCase { XTextDocument xTextDoc; /** * Creates text document. */ protected void initialize(TestParameters tParam, PrintWriter log) { SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF()); try { log.println("creating a textdocument"); xTextDoc = SOF.createTextDoc(null); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); throw new StatusException("Couldn't create document", e); } } /** * Disposes text document. */ protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xTextDoc "); util.DesktopTools.closeDoc(xTextDoc); } /** * Creating a Testenvironment for the interfaces to be tested. After major * text of text document is obtained, text cursor is created and several * paragraphs within the text are inserted to a text document. Finally, * text cursor is returned as a test component. * Object relations created : *
'XTEXT'
for
* {@link ifc.text._XTextRange} : major text of text document