tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / qadevOOo / tests / java / ifc / lang / _XLocalizable.java
blob9a758032be2936f9b00bcbbcbf1d7a670c131fc1
1 /*
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 .
18 package ifc.lang;
20 import lib.MultiMethodTest;
22 import com.sun.star.lang.Locale;
23 import com.sun.star.lang.XLocalizable;
24 import lib.Status;
27 public class _XLocalizable extends MultiMethodTest {
29 public XLocalizable oObj;
30 protected Locale initialLocale;
32 public void _getLocale() {
33 initialLocale = oObj.getLocale();
34 tRes.tested("getLocale()", initialLocale != null);
37 public void _setLocale() {
38 requiredMethod("getLocale()");
40 String ro = (String) tEnv.getObjRelation("XLocalizable.ReadOnly");
41 if (ro != null) {
42 log.println(ro);
43 tRes.tested("setLocale()", Status.skipped(true));
44 return;
46 Locale newLocale = new Locale("de", "DE", "");
47 oObj.setLocale(newLocale);
49 Locale getLocale = oObj.getLocale();
50 boolean res = ((getLocale.Country.equals(newLocale.Country)) &&
51 (getLocale.Language.equals(newLocale.Language)));
53 if (!res) {
54 log.println("Expected Language " + newLocale.Language +
55 " and Country " + newLocale.Country);
56 log.println("Getting Language " + getLocale.Language +
57 " and Country " + getLocale.Country);
60 oObj.setLocale(initialLocale);
61 tRes.tested("setLocale()", res);