1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 package ifc.text; 29 30 import lib.MultiMethodTest; 31 32 import com.sun.star.text.XSentenceCursor; 33 34 /** 35 * Testing <code>com.sun.star.text.XSentenceCursor</code> 36 * interface methods : 37 * <ul> 38 * <li><code> isStartOfSentence()</code></li> 39 * <li><code> isEndOfSentence()</code></li> 40 * <li><code> gotoNextSentence()</code></li> 41 * <li><code> gotoPreviousSentence()</code></li> 42 * <li><code> gotoStartOfSentence()</code></li> 43 * <li><code> gotoEndOfSentence()</code></li> 44 * </ul> <p> 45 * Test is <b> NOT </b> multithread compilant. <p> 46 * @see com.sun.star.text.XSentenceCursor 47 */ 48 public class _XSentenceCursor extends MultiMethodTest { 49 50 public XSentenceCursor oObj = null; // oObj filled by MultiMethodTest 51 52 /** 53 * First goes to next sentence (to be sure that previous exists), 54 * then calls the method. <p> 55 * 56 * Has <b>OK</b> status if the method returns <code>true</code>. 57 */ 58 public void _gotoPreviousSentence(){ 59 oObj.gotoNextSentence(false); 60 oObj.gotoNextSentence(false); 61 tRes.tested("gotoPreviousSentence()", oObj.gotoPreviousSentence(false) ); 62 } 63 64 /** 65 * First goes to previous sentence (to be sure that next exists), 66 * then calls the method. <p> 67 * 68 * Has <b>OK</b> status if the method returns <code>true</code>. 69 */ 70 public void _gotoNextSentence(){ 71 oObj.gotoPreviousSentence(false) ; 72 oObj.gotoPreviousSentence(false) ; 73 tRes.tested("gotoNextSentence()", oObj.gotoNextSentence(false) ); 74 } 75 76 /** 77 * Test calls the method. <p> 78 * Has <b> OK </b> status if the method returns <code>true</code>. <p> 79 * The following method tests are to be completed successfully before : 80 * <ul> 81 * <li> <code> gotoPreviousSentence() </code> : to be sure the 82 * cursor is in range of some sentence. </li> 83 * </ul> 84 */ 85 public void _gotoEndOfSentence(){ 86 requiredMethod( "gotoPreviousSentence()" ); 87 tRes.tested("gotoEndOfSentence()", oObj.gotoEndOfSentence(false) ); 88 } 89 90 /** 91 * Test calls the method. <p> 92 * Has <b> OK </b> status if the method returns <code>true</code>. <p> 93 * The following method tests are to be completed successfully before : 94 * <ul> 95 * <li> <code> gotoPreviousSentence() </code> : to be sure the 96 * cursor is in range of some sentence. </li> 97 * </ul> 98 */ 99 public void _gotoStartOfSentence(){ 100 requiredMethod( "gotoPreviousSentence()" ); 101 tRes.tested("gotoStartOfSentence()", oObj.gotoStartOfSentence(false) ); 102 } 103 104 /** 105 * First moves the cursor to the start of sentence and then calls 106 * the method. <p> 107 * 108 * Has <b>OK</b> status if the method returns <code>true</code>. 109 */ 110 public void _isStartOfSentence(){ 111 oObj.gotoStartOfSentence(false) ; 112 tRes.tested("isStartOfSentence()", oObj.isStartOfSentence() ); 113 } 114 115 /** 116 * First moves the cursor to the end of sentence and then calls 117 * the method. <p> 118 * 119 * Has <b>OK</b> status if the method returns <code>true</code>. 120 */ 121 public void _isEndOfSentence(){ 122 oObj.gotoEndOfSentence(false) ; 123 tRes.tested("isEndOfSentence()", oObj.isEndOfSentence() ); 124 } 125 126 } // finish class _XSentenceCursor 127 128