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 .
20 import com
.sun
.star
.i18n
.TransliterationModules
;
21 import com
.sun
.star
.i18n
.XExtendedTransliteration
;
22 import com
.sun
.star
.lang
.Locale
;
23 import lib
.MultiMethodTest
;
28 public class _XExtendedTransliteration
extends MultiMethodTest
{
29 public XExtendedTransliteration oObj
= null;
30 private final Locale loc
= new Locale("en", "US", "") ;
33 public void before() {
34 oObj
.loadModule(TransliterationModules
.LOWERCASE_UPPERCASE
, loc
);
38 * Check lowercase - uppercase conversion of chars
40 public void _transliterateChar2Char() {
41 boolean result
= true;
45 out
= oObj
.transliterateChar2Char(in
) ;
47 in
= '$'; // should not be changed
48 out
= oObj
.transliterateChar2Char(in
) ;
51 catch(com
.sun
.star
.i18n
.MultipleCharsOutputException e
) {
52 e
.printStackTrace(log
);
54 tRes
.tested("transliterateChar2Char()", result
);
58 * Check lowercase - uppercase conversion of char to string
60 public void _transliterateChar2String() {
61 boolean result
= true;
64 out
= oObj
.transliterateChar2String('a') ;
65 result
&= out
.equals("A");
66 in
= '$'; // should not be changed
67 out
= oObj
.transliterateChar2String(in
) ;
68 result
&= out
.equals("$");
69 tRes
.tested("transliterateChar2String()", result
);
73 * Check lowercase - uppercase conversion of strings
75 public void _transliterateString2String() {
76 boolean result
= true;
79 out
= oObj
.transliterateString2String(in
, 0, 6) ;
80 result
&= out
.equals("AABBCC");
81 in
= "$"; // should not be changed
82 out
= oObj
.transliterateString2String(in
, 0, 1) ;
83 result
&= out
.equals("$");
84 tRes
.tested("transliterateString2String()", result
);