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