Update ooo320-m1
[ooovba.git] / qadevOOo / tests / java / ifc / i18n / _XExtendedTransliteration.java
blob2700d5ec5ecbfacf7728d5918b718b5a92513e53
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XExtendedTransliteration.java,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
30 package ifc.i18n;
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;
37 /**
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);
49 /**
50 * Check lowercase - uppercase conversion of chars
52 public void _transliterateChar2Char() {
53 boolean result = true;
54 char in = 'a';
55 char out = ' ';
56 try {
57 out = oObj.transliterateChar2Char(in) ;
58 result &= out == 'A';
59 in = '$'; // should not be changed
60 out = oObj.transliterateChar2Char(in) ;
61 result &= out == '$';
63 catch(com.sun.star.i18n.MultipleCharsOutputException e) {
64 e.printStackTrace((java.io.PrintWriter)log);
66 tRes.tested("transliterateChar2Char()", result);
69 /**
70 * Check lowercase - uppercase conversion of char to string
72 public void _transliterateChar2String() {
73 boolean result = true;
74 char in = 'a';
75 String out = null;
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);
84 /**
85 * Check lowercase - uppercase conversion of strings
87 public void _transliterateString2String() {
88 boolean result = true;
89 String in = "aAbBcC";
90 String out = null;
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);