Update ooo320-m1
[ooovba.git] / qadevOOo / tests / java / ifc / lang / _XLocalizable.java
blob6534c24b0bb1ed73cc217fcafc6ab93aea9b9a4f
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: _XLocalizable.java,v $
10 * $Revision: 1.5 $
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.lang;
32 import lib.MultiMethodTest;
34 import com.sun.star.lang.Locale;
35 import com.sun.star.lang.XLocalizable;
36 import lib.Status;
39 public class _XLocalizable extends MultiMethodTest {
41 public XLocalizable oObj;
42 protected Locale initialLocale;
44 public void _getLocale() {
45 initialLocale = oObj.getLocale();
46 tRes.tested("getLocale()", initialLocale != null);
49 public void _setLocale() {
50 requiredMethod("getLocale()");
52 String ro = (String) tEnv.getObjRelation("XLocalizable.ReadOnly");
53 if (ro != null) {
54 log.println(ro);
55 tRes.tested("setLocale()", Status.skipped(true));
56 return;
58 Locale newLocale = new Locale("de", "DE", "");
59 oObj.setLocale(newLocale);
61 Locale getLocale = oObj.getLocale();
62 boolean res = ((getLocale.Country.equals(newLocale.Country)) &&
63 (getLocale.Language.equals(newLocale.Language)));
65 if (!res) {
66 log.println("Expected Language " + newLocale.Language +
67 " and Country " + newLocale.Country);
68 log.println("Getting Language " + getLocale.Language +
69 " and Country " + getLocale.Country);
72 oObj.setLocale(initialLocale);
73 tRes.tested("setLocale()", res);