1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XServiceInfo.java,v $
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 ************************************************************************/
33 import lib
.MultiMethodTest
;
35 import com
.sun
.star
.lang
.XServiceInfo
;
38 * Testing <code>com.sun.star.lang.XServiceInfo</code>
41 * <li><code> getImplementationName()</code></li>
42 * <li><code> supportsService()</code></li>
43 * <li><code> getSupportedServiceNames()</code></li>
45 * Test is multithread compilant. <p>
46 * @see com.sun.star.lang.XServiceInfo
48 public class _XServiceInfo
extends MultiMethodTest
{
49 public static XServiceInfo oObj
= null;
50 public static String
[] names
= null;
53 * Just calls the method.<p>
54 * Has <b>OK</b> status if no runtime exceptions occured.
56 public void _getImplementationName() {
57 boolean result
= true;
58 log
.println("testing getImplementationName() ... ");
60 log
.println("The ImplementationName ist "+oObj
.getImplementationName());
63 tRes
.tested("getImplementationName()", result
);
65 } // end getImplementationName()
69 * Just calls the method.<p>
70 * Has <b>OK</b> status if no runtime exceptions occured.
72 public void _getSupportedServiceNames() {
73 boolean result
= true;
74 log
.println("getting supported Services...");
75 names
= oObj
.getSupportedServiceNames();
76 for (int i
=0;i
<names
.length
;i
++) {
78 log
.println(k
+". Supported Service is "+names
[i
]);
82 tRes
.tested("getSupportedServiceNames()", result
);
84 } // end getSupportedServiceNames()
87 * Gets one of the service names returned by
88 * <code>getSupportedServiceNames</code> method and
89 * calls the <code>supportsService</code> methos with this
91 * Has <b>OK</b> status if <code>true</code> value is
94 public void _supportsService() {
95 log
.println("testing supportsService");
96 names
= oObj
.getSupportedServiceNames();
97 tRes
.tested("supportsService()", oObj
.supportsService(names
[0]));
98 } // end supportsService()