Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / ifc / ucb / _XParameterizedContentProvider.java
blobf8dcd4d8a32de08d974a049c33dd9a46b7ea7776
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 ifc.ucb;
21 import lib.MultiMethodTest;
23 import com.sun.star.ucb.XContentProvider;
24 import com.sun.star.ucb.XParameterizedContentProvider;
26 /**
27 * Testing <code>com.sun.star.ucb.XParameterizedContentProvider</code>
28 * interface methods :
29 * <ul>
30 * <li><code> registerInstance()</code></li>
31 * <li><code> deregisterInstance()</code></li>
32 * </ul> <p>
33 * Test is <b> NOT </b> multithread compliant. <p>
34 * @see com.sun.star.ucb.XParameterizedContentProvider
36 public class _XParameterizedContentProvider extends MultiMethodTest {
38 public static XParameterizedContentProvider oObj = null;
40 /**
41 * Registers an instance with some arguments. <p>
42 * Has <b>OK</b> status if the method returns non <code>null</code>
43 * provider.
45 public void _registerInstance() {
46 try {
47 XContentProvider CP = oObj.registerInstance(
48 "\"vnd.sun.star.pkg://file\".*",
49 "uno:pipe,name=ucb_soffice;<PIPE>;urp;UCB.Factory",
50 true);
51 tRes.tested("registerInstance()",CP != null);
52 } catch (com.sun.star.lang.IllegalArgumentException e) {
53 log.println("Exception while checking 'registerInstance'");
54 e.printStackTrace(log);
55 tRes.tested("registerInstance()",false);
59 /**
60 * Deregisters the instance registered before. <p>
61 * Has <b>OK</b> status if the method returns non <code>null</code>
62 * provider. <p>
64 * The following method tests are to be completed successfully before :
65 * <ul>
66 * <li> <code> registerInstance() </code> : to deregister it here. </li>
67 * </ul>
69 public void _deregisterInstance() {
70 requiredMethod("registerInstance()");
71 try {
72 XContentProvider CP = oObj.deregisterInstance(
73 "\"vnd.sun.star.pkg://file\".*",
74 "uno:pipe,name=ucb_soffice;<PIPE>;urp;UCB.Factory");
75 tRes.tested("deregisterInstance()",CP != null);
76 } catch (com.sun.star.lang.IllegalArgumentException e) {
77 log.println("Exception while checking 'deregisterInstance'");
78 e.printStackTrace(log);
79 tRes.tested("deregisterInstance()",false);