1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XExtendedTransliteration.java,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 import com
.sun
.star
.i18n
.TransliterationModules
;
33 import com
.sun
.star
.i18n
.XExtendedTransliteration
;
34 import com
.sun
.star
.lang
.Locale
;
35 import lib
.MultiMethodTest
;
40 public class _XExtendedTransliteration
extends MultiMethodTest
{
41 public XExtendedTransliteration oObj
= null;
42 // private Locale loc = new Locale("ja", "JP", "") ;
43 private Locale loc
= new Locale("en", "US", "") ;
45 public void before() {
46 oObj
.loadModule(TransliterationModules
.LOWERCASE_UPPERCASE
, loc
);
50 * Check lowercase - uppercase conversion of chars
52 public void _transliterateChar2Char() {
53 boolean result
= true;
57 out
= oObj
.transliterateChar2Char(in
) ;
59 in
= '$'; // should not be changed
60 out
= oObj
.transliterateChar2Char(in
) ;
63 catch(com
.sun
.star
.i18n
.MultipleCharsOutputException e
) {
64 e
.printStackTrace((java
.io
.PrintWriter
)log
);
66 tRes
.tested("transliterateChar2Char()", result
);
70 * Check lowercase - uppercase conversion of char to string
72 public void _transliterateChar2String() {
73 boolean result
= true;
76 out
= oObj
.transliterateChar2String('a') ;
77 result
&= out
.equals("A");
78 in
= '$'; // should not be changed
79 out
= oObj
.transliterateChar2String(in
) ;
80 result
&= out
.equals("$");
81 tRes
.tested("transliterateChar2String()", result
);
85 * Check lowercase - uppercase conversion of strings
87 public void _transliterateString2String() {
88 boolean result
= true;
91 out
= oObj
.transliterateString2String(in
, 0, 6) ;
92 result
&= out
.equals("AABBCC");
93 in
= "$"; // should not be changed
94 out
= oObj
.transliterateString2String(in
, 0, 1) ;
95 result
&= out
.equals("$");
96 tRes
.tested("transliterateString2String()", result
);