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 com
.sun
.star
.lang
.XServiceInfo
;
22 import share
.LogWriter
;
25 * Testing <code>com.sun.star.lang.XServiceInfo</code>
28 * <li><code> getImplementationName()</code></li>
29 * <li><code> supportsService()</code></li>
30 * <li><code> getSupportedServiceNames()</code></li>
32 * Test is multithread compliant. <p>
33 * @see com.sun.star.lang.XServiceInfo
35 public class _XServiceInfo
{
36 public static XServiceInfo oObj
= null;
37 private static String
[] names
= null;
38 private final LogWriter log
= null;
41 * Just calls the method.<p>
42 * Has <b>OK</b> status if no runtime exceptions occurred.
44 public boolean _getImplementationName() {
45 boolean result
= true;
46 log
.println("testing getImplementationName() ... ");
48 log
.println("The ImplementationName ist "+oObj
.getImplementationName());
53 } // end getImplementationName()
57 * Just calls the method.<p>
58 * Has <b>OK</b> status if no runtime exceptions occurred.
60 public boolean _getSupportedServiceNames() {
61 boolean result
= true;
62 log
.println("getting supported Services...");
63 names
= oObj
.getSupportedServiceNames();
64 for (int i
=0;i
<names
.length
;i
++) {
66 log
.println(k
+". Supported Service is "+names
[i
]);
72 } // end getSupportedServiceNames()
75 * Gets one of the service names returned by
76 * <code>getSupportedServiceNames</code> method and
77 * calls the <code>supportsService</code> methos with this
79 * Has <b>OK</b> status if <code>true</code> value is
82 public boolean _supportsService() {
83 log
.println("testing supportsService");
84 names
= oObj
.getSupportedServiceNames();
85 return oObj
.supportsService(names
[0]);
86 } // end supportsService()