Set that a non-modal Popover don't auto-grab focus on popup
[LibreOffice.git] / qadevOOo / tests / java / mod / _shlibloader / uno / DLLComponentLoader.java
blob18e7a2d9e2ebe9455f1e20f08a413facad50885a
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 .
19 package mod._shlibloader.uno;
21 import com.sun.star.lang.XMultiServiceFactory;
22 import com.sun.star.uno.XInterface;
23 import java.io.PrintWriter;
24 import lib.StatusException;
25 import lib.TestCase;
26 import lib.TestEnvironment;
27 import lib.TestParameters;
28 import util.utils;
30 /**
31 * Test for <code>com.sun.star.comp.stoc.DLLComponentLoader</code> service <p>
32 * Files which are used :
33 * <ul>
34 * <li> <code>XImpReg.dll</code> : DLL which will be loaded in
35 * <code>XImplementationLoader</code> interface test. </li>
36 * <ul>
37 * Multithread testing compliant.
38 * @see com.sun.star.loader.XImplementationLoader
39 * @see com.sun.star.lang.XServiceInfo
40 * @see ifc.loader._XImplementationLoader
41 * @see ifc.lang._XServiceInfo
43 public class DLLComponentLoader extends TestCase {
45 /**
46 * Creating a TestEnvironment for the interfaces to be tested.
47 * Creates <code>com.sun.star.comp.stoc.DLLComponentLoader</code>
48 * service. <p>
49 * The following object relations created :
50 * <ul>
51 * <li> <code>'ImplementationLoader'</code> : service which is
52 * responsible for loading DLL implementations. </li>
53 * <li> <code>'ImplementationUrl'</code> : DLL file location. </li>
54 * <li> <code>'ImplementationName'</code> : Name of the implementation.</li>
55 * </ul>
57 @Override
58 protected TestEnvironment createTestEnvironment
59 (TestParameters Param, PrintWriter log) throws com.sun.star.uno.Exception {
60 XInterface oObj = null;
61 Object oInterface = null;
62 XMultiServiceFactory xMSF = null;
64 try {
65 xMSF = Param.getMSF();
66 oInterface = xMSF.createInstance
67 ( "com.sun.star.comp.stoc.DLLComponentLoader" );
69 catch( Exception e ) {
70 log.println("DLLComponentLoader Service not available" );
73 oObj = (XInterface) oInterface;
75 log.println( " creating a new environment for DLLComponentLoader object" );
76 TestEnvironment tEnv = new TestEnvironment( oObj );
78 // adding object relation for XImplementationLoader ifc test
79 tEnv.addObjRelation("ImplementationLoader",
80 "com.sun.star.loader.SharedLibrary") ;
81 String os = (String) Param.get("OS");
82 if (os == null || os.equals(""))
83 throw new StatusException(
84 "Couldn't determine operating system for naming convention.",
85 new NullPointerException());
86 String name = "javaloader.uno";
87 if (!os.equals("wntmsci"))
88 name = name + ".so";
89 else
90 name += ".dll";
91 String implURL = utils.getOfficeURL(xMSF)+"/"+name;
92 tEnv.addObjRelation("ImplementationUrl", implURL) ;
93 log.println("looking for shared lib: " + implURL);
94 tEnv.addObjRelation("ImplementationName",
95 "com.sun.star.comp.stoc.JavaComponentLoader") ;
97 return tEnv;
98 } // finish method getTestEnvironment
100 } // finish class DLLComponentLoader