1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XSentenceCursor.java,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 import lib
.MultiMethodTest
;
35 import com
.sun
.star
.text
.XSentenceCursor
;
38 * Testing <code>com.sun.star.text.XSentenceCursor</code>
41 * <li><code> isStartOfSentence()</code></li>
42 * <li><code> isEndOfSentence()</code></li>
43 * <li><code> gotoNextSentence()</code></li>
44 * <li><code> gotoPreviousSentence()</code></li>
45 * <li><code> gotoStartOfSentence()</code></li>
46 * <li><code> gotoEndOfSentence()</code></li>
48 * Test is <b> NOT </b> multithread compilant. <p>
49 * @see com.sun.star.text.XSentenceCursor
51 public class _XSentenceCursor
extends MultiMethodTest
{
53 public XSentenceCursor oObj
= null; // oObj filled by MultiMethodTest
56 * First goes to next sentence (to be sure that previous exists),
57 * then calls the method. <p>
59 * Has <b>OK</b> status if the method returns <code>true</code>.
61 public void _gotoPreviousSentence(){
62 oObj
.gotoNextSentence(false);
63 oObj
.gotoNextSentence(false);
64 tRes
.tested("gotoPreviousSentence()", oObj
.gotoPreviousSentence(false) );
68 * First goes to previous sentence (to be sure that next exists),
69 * then calls the method. <p>
71 * Has <b>OK</b> status if the method returns <code>true</code>.
73 public void _gotoNextSentence(){
74 oObj
.gotoPreviousSentence(false) ;
75 oObj
.gotoPreviousSentence(false) ;
76 tRes
.tested("gotoNextSentence()", oObj
.gotoNextSentence(false) );
80 * Test calls the method. <p>
81 * Has <b> OK </b> status if the method returns <code>true</code>. <p>
82 * The following method tests are to be completed successfully before :
84 * <li> <code> gotoPreviousSentence() </code> : to be sure the
85 * cursor is in range of some sentence. </li>
88 public void _gotoEndOfSentence(){
89 requiredMethod( "gotoPreviousSentence()" );
90 tRes
.tested("gotoEndOfSentence()", oObj
.gotoEndOfSentence(false) );
94 * Test calls the method. <p>
95 * Has <b> OK </b> status if the method returns <code>true</code>. <p>
96 * The following method tests are to be completed successfully before :
98 * <li> <code> gotoPreviousSentence() </code> : to be sure the
99 * cursor is in range of some sentence. </li>
102 public void _gotoStartOfSentence(){
103 requiredMethod( "gotoPreviousSentence()" );
104 tRes
.tested("gotoStartOfSentence()", oObj
.gotoStartOfSentence(false) );
108 * First moves the cursor to the start of sentence and then calls
111 * Has <b>OK</b> status if the method returns <code>true</code>.
113 public void _isStartOfSentence(){
114 oObj
.gotoStartOfSentence(false) ;
115 tRes
.tested("isStartOfSentence()", oObj
.isStartOfSentence() );
119 * First moves the cursor to the end of sentence and then calls
122 * Has <b>OK</b> status if the method returns <code>true</code>.
124 public void _isEndOfSentence(){
125 oObj
.gotoEndOfSentence(false) ;
126 tRes
.tested("isEndOfSentence()", oObj
.isEndOfSentence() );
129 } // finish class _XSentenceCursor