tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _ucprmt / ContentProvider.java
blob22c7885227e8333018cb1097e4118340969305e6
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._ucprmt;
21 import java.io.PrintWriter;
23 import lib.TestCase;
24 import lib.TestEnvironment;
25 import lib.TestParameters;
27 import com.sun.star.lang.XMultiServiceFactory;
28 import com.sun.star.ucb.XContentIdentifierFactory;
29 import com.sun.star.uno.UnoRuntime;
30 import com.sun.star.uno.XInterface;
32 /**
33 * Test for object which is represented by service
34 * <code>com.sun.star.ucb.RemoteAccessContentProvider</code>. <p>
35 * Object implements the following interfaces :
36 * <ul>
37 * <li> <code>com::sun::star::ucb::XContentProvider</code></li>
38 * <li> <code>com::sun::star::ucb::XFileIdentifierConverter</code></li>
39 * <li> <code>com::sun::star::ucb::XContentIdentifierFactory</code></li>
40 * <li> <code>com::sun::star::ucb::XParameterizedContentProvider</code></li>
41 * </ul>
42 * This object test <b> is NOT </b> designed to be run in several
43 * threads concurrently.
44 * @see com.sun.star.ucb.XContentProvider
45 * @see com.sun.star.ucb.XFileIdentifierConverter
46 * @see com.sun.star.ucb.XContentIdentifierFactory
47 * @see com.sun.star.ucb.XParameterizedContentProvider
48 * @see ifc.ucb._XContentProvider
49 * @see ifc.ucb._XFileIdentifierConverter
50 * @see ifc.ucb._XContentIdentifierFactory
51 * @see ifc.ucb._XParameterizedContentProvider
53 public class ContentProvider extends TestCase {
55 /**
56 * Creating a TestEnvironment for the interfaces to be tested.
57 * Creates an instance of the service
58 * <code>com.sun.star.ucprmt.ContentProvider</code>. <p>
59 * Object relations created :
60 * <ul>
61 * <li> <code>'FACTORY'</code> for
62 * {@link ifc.ucb._XContentProvider} factory for
63 * content identifiers. Here it is
64 * <code>UniversalContentBroker</code> service.</li>
65 * <li> <code>'CONTENT1'</code> for
66 * {@link ifc.ucb._XContentProvider}: suitable
67 * content URL for this provider </li>
68 * <li> <code>'CONTENT2'</code> for
69 * {@link ifc.ucb._XContentProvider}: another suitable
70 * content URL for this provider </li>
71 * </ul>
73 @Override
74 public TestEnvironment createTestEnvironment
75 (TestParameters Param, PrintWriter log ) throws Exception {
76 XInterface oObj = null;
77 XMultiServiceFactory xMSF = Param.getMSF();
78 XContentIdentifierFactory cntIDFac = null ;
80 oObj = (XInterface) xMSF.createInstance
81 ("com.sun.star.ucb.RemoteAccessContentProvider");
82 cntIDFac = UnoRuntime.queryInterface
83 (XContentIdentifierFactory.class, oObj) ;
85 TestEnvironment tEnv = new TestEnvironment( oObj );
87 // adding relation for XContentProvider
88 tEnv.addObjRelation("FACTORY", cntIDFac) ;
89 tEnv.addObjRelation("CONTENT1","vnd.sun.star.wfs:///user/work");
90 tEnv.addObjRelation("CONTENT2","vnd.sun.star.wfs:///user/config");
92 return tEnv;
93 } // finish method getTestEnvironment