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.linguistic2; 29 30 import lib.MultiMethodTest; 31 32 import com.sun.star.beans.PropertyValue; 33 import com.sun.star.lang.Locale; 34 import com.sun.star.linguistic2.XHyphenatedWord; 35 import com.sun.star.linguistic2.XHyphenator; 36 import com.sun.star.linguistic2.XPossibleHyphens; 37 38 /** 39 * Testing <code>com.sun.star.linguistic2.XHyphenator</code> 40 * interface methods: 41 * <ul> 42 * <li><code>hyphenate()</code></li> 43 * <li><code>queryAlternativeSpelling()</code></li> 44 * <li><code>createPossibleHyphens()</code></li> 45 * </ul><p> 46 * @see com.sun.star.linguistic2.XHyphenator 47 */ 48 public class _XHyphenator extends MultiMethodTest { 49 50 public XHyphenator oObj = null; 51 52 /** 53 * Test calls the method and checks returned value. <p> 54 * Has <b> OK </b> status if returned value isn't null. <p> 55 */ 56 public void _hyphenate() { 57 boolean res = true; 58 PropertyValue[] Props = null; 59 try { 60 XHyphenatedWord result = oObj.hyphenate( 61 "wacker",new Locale("de","DE",""),(short)3,Props); 62 res &= (result != null); 63 } catch (com.sun.star.lang.IllegalArgumentException ex) { 64 log.println("Exception while checking 'hyphenate'"); 65 res = false; 66 ex.printStackTrace(log); 67 } 68 tRes.tested("hyphenate()",res); 69 } 70 71 /** 72 * Test calls the method and checks returned value. <p> 73 * Has <b> OK </b> status if returned value isn't null. <p> 74 */ 75 public void _queryAlternativeSpelling() { 76 boolean res = true; 77 PropertyValue[] Props = null; 78 try { 79 XHyphenatedWord result = oObj.queryAlternativeSpelling( 80 "wacker",new Locale("de","DE",""),(short)2,Props); 81 res &= (result != null); 82 } catch (com.sun.star.lang.IllegalArgumentException ex) { 83 log.println("Exception while checking 'queryAlternativeSpelling'"); 84 res = false; 85 ex.printStackTrace(log); 86 } 87 tRes.tested("queryAlternativeSpelling()",res); 88 } 89 90 /** 91 * Test calls the method and checks returned value. <p> 92 * Has <b> OK </b> status if returned value isn't null. <p> 93 */ 94 public void _createPossibleHyphens() { 95 boolean res = true; 96 PropertyValue[] Props = null; 97 try { 98 XPossibleHyphens result = oObj.createPossibleHyphens( 99 "wacker",new Locale("de","DE",""),Props); 100 res &= (result != null); 101 } catch (com.sun.star.lang.IllegalArgumentException ex) { 102 log.println("Exception while checking 'createPossibleHyphens'"); 103 res = false; 104 ex.printStackTrace(log); 105 } 106 tRes.tested("createPossibleHyphens()",res); 107 } 108 109 } // \u0422\u044B finish class XHyphenator 110 111 112