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: _XModuleUIConfigurationManager.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 ************************************************************************/
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() {
49 result
= oObj
.isDefaultSettings(resourceUrl
);
51 catch(com
.sun
.star
.lang
.IllegalArgumentException e
) {
52 log
.println("'" + resourceUrl
+ "' is an illegal resource.");
55 String notPossibleUrl
= "private:resource/menubar/dingsbums";
57 result
&= !oObj
.isDefaultSettings(notPossibleUrl
);
59 catch(com
.sun
.star
.lang
.IllegalArgumentException e
) {
60 log
.println("'" + notPossibleUrl
+ "' is an illegal resource.");
64 tRes
.tested("isDefaultSettings()", result
);
67 public void _getDefaultSettings() {
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.");
77 catch(com
.sun
.star
.container
.NoSuchElementException e
) {
78 log
.println("No resource '" + resourceUrl
+ "' available.");
81 tRes
.tested("getDefaultSettings()", result
);