Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / ifc / linguistic2 / _XHyphenator.java
blob907cd5aebe90e8df5c736170959876a6a691452d
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package ifc.linguistic2;
21 import lib.MultiMethodTest;
23 import com.sun.star.beans.PropertyValue;
24 import com.sun.star.lang.Locale;
25 import com.sun.star.linguistic2.XHyphenatedWord;
26 import com.sun.star.linguistic2.XHyphenator;
27 import com.sun.star.linguistic2.XPossibleHyphens;
29 /**
30 * Testing <code>com.sun.star.linguistic2.XHyphenator</code>
31 * interface methods:
32 * <ul>
33 * <li><code>hyphenate()</code></li>
34 * <li><code>queryAlternativeSpelling()</code></li>
35 * <li><code>createPossibleHyphens()</code></li>
36 * </ul><p>
37 * @see com.sun.star.linguistic2.XHyphenator
39 public class _XHyphenator extends MultiMethodTest {
41 public XHyphenator oObj = null;
43 /**
44 * Test calls the method and checks returned value. <p>
45 * Has <b> OK </b> status if returned value isn't null. <p>
47 public void _hyphenate() {
48 boolean res = true;
49 PropertyValue[] Props = null;
50 try {
51 XHyphenatedWord result = oObj.hyphenate(
52 "wacker",new Locale("de","DE",""),(short)3,Props);
53 res &= (result != null);
54 } catch (com.sun.star.lang.IllegalArgumentException ex) {
55 log.println("Exception while checking 'hyphenate'");
56 res = false;
57 ex.printStackTrace(log);
59 tRes.tested("hyphenate()",res);
62 /**
63 * Test calls the method and checks returned value. <p>
64 * Has <b> OK </b> status if returned value isn't null. <p>
66 public void _queryAlternativeSpelling() {
67 boolean res = true;
68 PropertyValue[] Props = null;
69 try {
70 XHyphenatedWord result = oObj.queryAlternativeSpelling(
71 "wacker",new Locale("de","DE",""),(short)2,Props);
72 res &= (result != null);
73 } catch (com.sun.star.lang.IllegalArgumentException ex) {
74 log.println("Exception while checking 'queryAlternativeSpelling'");
75 res = false;
76 ex.printStackTrace(log);
78 tRes.tested("queryAlternativeSpelling()",res);
81 /**
82 * Test calls the method and checks returned value. <p>
83 * Has <b> OK </b> status if returned value isn't null. <p>
85 public void _createPossibleHyphens() {
86 boolean res = true;
87 PropertyValue[] Props = null;
88 try {
89 XPossibleHyphens result = oObj.createPossibleHyphens(
90 "wacker",new Locale("de","DE",""),Props);
91 res &= (result != null);
92 } catch (com.sun.star.lang.IllegalArgumentException ex) {
93 log.println("Exception while checking 'createPossibleHyphens'");
94 res = false;
95 ex.printStackTrace(log);
97 tRes.tested("createPossibleHyphens()",res);
100 } // \u0422\u044B finish class XHyphenator