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 .
21 import lib
.MultiMethodTest
;
23 import com
.sun
.star
.ucb
.XContentProvider
;
24 import com
.sun
.star
.ucb
.XParameterizedContentProvider
;
27 * Testing <code>com.sun.star.ucb.XParameterizedContentProvider</code>
30 * <li><code> registerInstance()</code></li>
31 * <li><code> deregisterInstance()</code></li>
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;
41 * Registers an instance with some arguments. <p>
42 * Has <b>OK</b> status if the method returns non <code>null</code>
45 public void _registerInstance() {
47 XContentProvider CP
= oObj
.registerInstance(
48 "\"vnd.sun.star.pkg://file\".*",
49 "uno:pipe,name=ucb_soffice;<PIPE>;urp;UCB.Factory",
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);
60 * Deregisters the instance registered before. <p>
61 * Has <b>OK</b> status if the method returns non <code>null</code>
64 * The following method tests are to be completed successfully before :
66 * <li> <code> registerInstance() </code> : to deregister it here. </li>
69 public void _deregisterInstance() {
70 requiredMethod("registerInstance()");
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);