1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package ifc.text; 25 26 import lib.MultiMethodTest; 27 28 import com.sun.star.text.XSentenceCursor; 29 30 /** 31 * Testing <code>com.sun.star.text.XSentenceCursor</code> 32 * interface methods : 33 * <ul> 34 * <li><code> isStartOfSentence()</code></li> 35 * <li><code> isEndOfSentence()</code></li> 36 * <li><code> gotoNextSentence()</code></li> 37 * <li><code> gotoPreviousSentence()</code></li> 38 * <li><code> gotoStartOfSentence()</code></li> 39 * <li><code> gotoEndOfSentence()</code></li> 40 * </ul> <p> 41 * Test is <b> NOT </b> multithread compilant. <p> 42 * @see com.sun.star.text.XSentenceCursor 43 */ 44 public class _XSentenceCursor extends MultiMethodTest { 45 46 public XSentenceCursor oObj = null; // oObj filled by MultiMethodTest 47 48 /** 49 * First goes to next sentence (to be sure that previous exists), 50 * then calls the method. <p> 51 * 52 * Has <b>OK</b> status if the method returns <code>true</code>. 53 */ _gotoPreviousSentence()54 public void _gotoPreviousSentence(){ 55 oObj.gotoNextSentence(false); 56 oObj.gotoNextSentence(false); 57 tRes.tested("gotoPreviousSentence()", oObj.gotoPreviousSentence(false) ); 58 } 59 60 /** 61 * First goes to previous sentence (to be sure that next exists), 62 * then calls the method. <p> 63 * 64 * Has <b>OK</b> status if the method returns <code>true</code>. 65 */ _gotoNextSentence()66 public void _gotoNextSentence(){ 67 oObj.gotoPreviousSentence(false) ; 68 oObj.gotoPreviousSentence(false) ; 69 tRes.tested("gotoNextSentence()", oObj.gotoNextSentence(false) ); 70 } 71 72 /** 73 * Test calls the method. <p> 74 * Has <b> OK </b> status if the method returns <code>true</code>. <p> 75 * The following method tests are to be completed successfully before : 76 * <ul> 77 * <li> <code> gotoPreviousSentence() </code> : to be sure the 78 * cursor is in range of some sentence. </li> 79 * </ul> 80 */ _gotoEndOfSentence()81 public void _gotoEndOfSentence(){ 82 requiredMethod( "gotoPreviousSentence()" ); 83 tRes.tested("gotoEndOfSentence()", oObj.gotoEndOfSentence(false) ); 84 } 85 86 /** 87 * Test calls the method. <p> 88 * Has <b> OK </b> status if the method returns <code>true</code>. <p> 89 * The following method tests are to be completed successfully before : 90 * <ul> 91 * <li> <code> gotoPreviousSentence() </code> : to be sure the 92 * cursor is in range of some sentence. </li> 93 * </ul> 94 */ _gotoStartOfSentence()95 public void _gotoStartOfSentence(){ 96 requiredMethod( "gotoPreviousSentence()" ); 97 tRes.tested("gotoStartOfSentence()", oObj.gotoStartOfSentence(false) ); 98 } 99 100 /** 101 * First moves the cursor to the start of sentence and then calls 102 * the method. <p> 103 * 104 * Has <b>OK</b> status if the method returns <code>true</code>. 105 */ _isStartOfSentence()106 public void _isStartOfSentence(){ 107 oObj.gotoStartOfSentence(false) ; 108 tRes.tested("isStartOfSentence()", oObj.isStartOfSentence() ); 109 } 110 111 /** 112 * First moves the cursor to the end of sentence and then calls 113 * the method. <p> 114 * 115 * Has <b>OK</b> status if the method returns <code>true</code>. 116 */ _isEndOfSentence()117 public void _isEndOfSentence(){ 118 oObj.gotoEndOfSentence(false) ; 119 tRes.tested("isEndOfSentence()", oObj.isEndOfSentence() ); 120 } 121 122 } // finish class _XSentenceCursor 123 124