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.XMeaning;
31 import com.sun.star.linguistic2.XThesaurus;
32 
33 /**
34 * Testing <code>com.sun.star.linguistic2.XThesaurus</code>
35 * interface methods:
36 * <ul>
37 *   <li><code>queryMeanings()</code></li>
38 * </ul> <p>
39 * @see com.sun.star.linguistic2.XThesaurus
40 */
41 public class _XThesaurus extends MultiMethodTest {
42 
43     public XThesaurus oObj = null;
44 
45     /**
46     * Test calls the method for one of supported language and checks
47     * returned value. <p>
48     * Has <b> OK </b> status if returned array is not empty
49     * and no exceptions were thrown. <p>
50     */
_queryMeanings()51     public void _queryMeanings() {
52         boolean res = true;
53         try {
54             XMeaning[] mean = oObj.queryMeanings(
55                 "survive",new Locale("en","US",""), new PropertyValue[0]);
56             res = (mean.length > 0);
57         } catch (com.sun.star.lang.IllegalArgumentException ex) {
58             log.println("Exception while checking 'queryMeanings'");
59             res = false;
60             ex.printStackTrace(log);
61         }
62         tRes.tested("queryMeanings()",res);
63     }
64 
65 
66 }  // finish class
67 
68 
69