merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / mod / _cfgmgr2 / OConfigurationRegistry.java
blobb5e0c4513acc61f31fdf72915c24ef0194b130d8
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: OConfigurationRegistry.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 mod._cfgmgr2;
32 import java.io.PrintWriter;
34 import lib.TestCase;
35 import lib.TestEnvironment;
36 import lib.TestParameters;
38 import com.sun.star.lang.XMultiServiceFactory;
39 import com.sun.star.uno.XInterface;
42 public class OConfigurationRegistry extends TestCase {
43 protected static int uniq = 0;
45 /** Called to create an instance of <code>TestEnvironment</code> with an
46 * object to test and related objects.
48 * For this an instance of com.sun.star.configuration.ConfigurationRegistry
49 * is created at the MultiServiceFactory of the Office
51 * @param tParam test parameters
52 * @param log writer to log information while testing
54 * @see TestEnvironment
55 * @see #getTestEnvironment()
58 protected TestEnvironment createTestEnvironment(TestParameters tParam,
59 PrintWriter log) {
60 XInterface oObj = null;
62 try {
63 oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
64 .createInstance("com.sun.star.configuration.ConfigurationRegistry");
65 } catch (com.sun.star.uno.Exception e) {
66 e.printStackTrace();
69 System.out.println("IName: " + util.utils.getImplName(oObj));
71 TestEnvironment tEnv = new TestEnvironment(oObj);
73 tEnv.addObjRelation("XSimpleRegistry.open", "org.openoffice.Setup") ;
74 tEnv.addObjRelation("XSimpleRegistry.merge", "org.openoffice.Inet") ;
75 tEnv.addObjRelation("XSimpleRegistry.destroy", "org.openoffice.Setup") ;
77 tEnv.addObjRelation("configuration", new Boolean(true));
79 return tEnv;