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 ************************************************************************/
31 package complex
.tdoc
.interfaces
;
33 import lib
.MultiMethodTest
;
35 import com
.sun
.star
.lang
.XServiceInfo
;
36 import share
.LogWriter
;
39 * Testing <code>com.sun.star.lang.XServiceInfo</code>
42 * <li><code> getImplementationName()</code></li>
43 * <li><code> supportsService()</code></li>
44 * <li><code> getSupportedServiceNames()</code></li>
46 * Test is multithread compilant. <p>
47 * @see com.sun.star.lang.XServiceInfo
49 public class _XServiceInfo
{
50 public static XServiceInfo oObj
= null;
51 public static String
[] names
= null;
52 public LogWriter log
= null;
55 * Just calls the method.<p>
56 * Has <b>OK</b> status if no runtime exceptions occured.
58 public boolean _getImplementationName() {
59 boolean result
= true;
60 log
.println("testing getImplementationName() ... ");
62 log
.println("The ImplementationName ist "+oObj
.getImplementationName());
67 } // end getImplementationName()
71 * Just calls the method.<p>
72 * Has <b>OK</b> status if no runtime exceptions occured.
74 public boolean _getSupportedServiceNames() {
75 boolean result
= true;
76 log
.println("getting supported Services...");
77 names
= oObj
.getSupportedServiceNames();
78 for (int i
=0;i
<names
.length
;i
++) {
80 log
.println(k
+". Supported Service is "+names
[i
]);
86 } // end getSupportedServiceNames()
89 * Gets one of the service names returned by
90 * <code>getSupportedServiceNames</code> method and
91 * calls the <code>supportsService</code> methos with this
93 * Has <b>OK</b> status if <code>true</code> value is
96 public boolean _supportsService() {
97 log
.println("testing supportsService");
98 names
= oObj
.getSupportedServiceNames();
99 return oObj
.supportsService(names
[0]);
100 } // end supportsService()