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
;
30 * Testing <code>com.sun.star.linguistic2.XHyphenator</code>
33 * <li><code>hyphenate()</code></li>
34 * <li><code>queryAlternativeSpelling()</code></li>
35 * <li><code>createPossibleHyphens()</code></li>
37 * @see com.sun.star.linguistic2.XHyphenator
39 public class _XHyphenator
extends MultiMethodTest
{
41 public XHyphenator oObj
= null;
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() {
49 PropertyValue
[] Props
= null;
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'");
57 ex
.printStackTrace(log
);
59 tRes
.tested("hyphenate()",res
);
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() {
68 PropertyValue
[] Props
= null;
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'");
76 ex
.printStackTrace(log
);
78 tRes
.tested("queryAlternativeSpelling()",res
);
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() {
87 PropertyValue
[] Props
= null;
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'");
95 ex
.printStackTrace(log
);
97 tRes
.tested("createPossibleHyphens()",res
);
100 } // \u0422\u044B finish class XHyphenator