merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / mod / _cfgmgr2 / LocalDataImporter.java
blob740064f70552340504d7779d232c21fed1fa5480
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: LocalDataImporter.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 com.sun.star.beans.NamedValue;
33 import com.sun.star.lang.XMultiServiceFactory;
34 import com.sun.star.uno.XInterface;
36 import java.io.PrintWriter;
38 import lib.TestCase;
39 import lib.TestEnvironment;
40 import lib.TestParameters;
43 public class LocalDataImporter extends TestCase {
44 /** Called to create an instance of <code>TestEnvironment</code> with an
45 * object to test and related objects. Subclasses should implement this
46 * method to provide the implementation and related objects. The method is
47 * called from <code>getTestEnvironment()</code>.
49 * @param tParam test parameters
50 * @param log writer to log information while testing
52 * @see TestEnvironment
53 * @see #getTestEnvironment()
56 protected TestEnvironment createTestEnvironment(TestParameters tParam,
57 PrintWriter log) {
58 XInterface oObj = null;
60 try {
61 oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
62 "com.sun.star.comp.configuration.backend.LocalDataImporter");
63 } catch (com.sun.star.uno.Exception e) {
66 String filename = util.utils.getOfficeURL(
67 (XMultiServiceFactory) tParam.getMSF()) +
68 "/../share/registry/data/org/openoffice/Setup.xcs";
70 Object[] vXJobArgs = new Object[1];
71 NamedValue[] vXJobArg0 = new NamedValue[1];
72 vXJobArg0[0] = new NamedValue("LayerDataUrl", filename);
73 vXJobArgs[0] = vXJobArg0;
75 log.println("Implementation name: " + util.utils.getImplName(oObj));
77 TestEnvironment tEnv = new TestEnvironment(oObj);
78 tEnv.addObjRelation("XJobArgs", vXJobArgs);
80 return tEnv;