Update ooo320-m1
[ooovba.git] / qadevOOo / tests / java / ifc / ui / _XModuleUIConfigurationManager.java
blob328c263155f555f04fa1c9661077971856c7c988
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: _XModuleUIConfigurationManager.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 ************************************************************************/
31 package ifc.ui;
33 import com.sun.star.container.XIndexAccess;
34 import com.sun.star.ui.XModuleUIConfigurationManager;
35 import lib.MultiMethodTest;
37 public class _XModuleUIConfigurationManager extends MultiMethodTest {
39 public XModuleUIConfigurationManager oObj = null;
40 private String resourceUrl = null;
42 public void before() {
43 resourceUrl = (String)tEnv.getObjRelation("XModuleUIConfigurationManager.ResourceURL");
46 public void _isDefaultSettings() {
47 boolean result;
48 try {
49 result = oObj.isDefaultSettings(resourceUrl);
51 catch(com.sun.star.lang.IllegalArgumentException e) {
52 log.println("'" + resourceUrl + "' is an illegal resource.");
53 result = false;
55 String notPossibleUrl = "private:resource/menubar/dingsbums";
56 try {
57 result &= !oObj.isDefaultSettings(notPossibleUrl);
59 catch(com.sun.star.lang.IllegalArgumentException e) {
60 log.println("'" + notPossibleUrl + "' is an illegal resource.");
61 result = false;
64 tRes.tested("isDefaultSettings()", result);
67 public void _getDefaultSettings() {
68 boolean result;
69 try {
70 XIndexAccess xIndexAcc = oObj.getDefaultSettings(resourceUrl);
71 result = xIndexAcc != null;
73 catch(com.sun.star.lang.IllegalArgumentException e) {
74 log.println("'" + resourceUrl + "' is an illegal resource.");
75 result = false;
77 catch(com.sun.star.container.NoSuchElementException e) {
78 log.println("No resource '" + resourceUrl + "' available.");
79 result = false;
81 tRes.tested("getDefaultSettings()", result);