merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / ifc / ucb / _XRemoteContentProviderActivator.java
blob8e58322b04295cd5c03288a99b2c54cc204a3955
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: _XRemoteContentProviderActivator.java,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
31 package ifc.ucb;
33 import lib.MultiMethodTest;
35 import com.sun.star.lang.XMultiServiceFactory;
36 import com.sun.star.ucb.XContentProviderManager;
37 import com.sun.star.ucb.XRemoteContentProviderAcceptor;
38 import com.sun.star.ucb.XRemoteContentProviderActivator;
40 /**
41 * Testing <code>com.sun.star.ucb.XRemoteContentProviderActivator</code>
42 * interface methods :
43 * <ul>
44 * <li><code> activateRemoteContentProviders()</code></li>
45 * </ul> <p>
46 * This test needs the following object relations :
47 * <ul>
48 * <li> <code>'RCPA'</code>
49 * (of type <code>XRemoteContentProviderAcceptor</code>):
50 * this acceptor is used to add a provider first before
51 * its activation. </li>
52 * <ul> <p>
53 * Test is <b> NOT </b> multithread compilant. <p>
54 * @see com.sun.star.ucb.XRemoteContentProviderActivator
56 public class _XRemoteContentProviderActivator extends MultiMethodTest {
58 public XRemoteContentProviderActivator oObj = null;
60 /**
61 * First the relation is retrieved and a remote provider is
62 * added to the acceptor. Then it is activated and
63 * removed. <p>
64 * Has <b> OK </b> status if <code>activateRemoteContentProviders</code>
65 * method returns not <code>null</code> value. <p>
67 public void _activateRemoteContentProviders() {
68 boolean res = false;
70 XRemoteContentProviderAcceptor xRCPA = (XRemoteContentProviderAcceptor)
71 tEnv.getObjRelation("RCPA");
72 String[] template = new String[]{"file"};
73 xRCPA.addRemoteContentProvider("ContentID",(XMultiServiceFactory)tParam.getMSF(),template,null);
74 XContentProviderManager CPM = oObj.activateRemoteContentProviders();
75 res = (CPM != null);
76 xRCPA.removeRemoteContentProvider("ContentID");
78 tRes.tested("activateRemoteContentProviders()",res);