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
.lang
.XServiceInfo
;
26 * Testing <code>com.sun.star.lang.XServiceInfo</code>
29 * <li><code> getImplementationName()</code></li>
30 * <li><code> supportsService()</code></li>
31 * <li><code> getSupportedServiceNames()</code></li>
33 * Test is multithread compliant. <p>
34 * @see com.sun.star.lang.XServiceInfo
36 public class _XServiceInfo
extends MultiMethodTest
{
37 public static XServiceInfo oObj
= null;
38 public static String
[] names
= null;
41 * Just calls the method.<p>
42 * Has <b>OK</b> status if no runtime exceptions occurred.
44 public void _getImplementationName() {
45 boolean result
= true;
46 log
.println("testing getImplementationName() ... ");
48 log
.println("The ImplementationName is "+oObj
.getImplementationName());
51 tRes
.tested("getImplementationName()", result
);
53 } // end getImplementationName()
57 * Just calls the method.<p>
58 * Has <b>OK</b> status if no runtime exceptions occurred.
60 public void _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
]);
70 tRes
.tested("getSupportedServiceNames()", result
);
72 } // end getSupportedServiceNames()
75 * Gets one of the service names returned by
76 * <code>getSupportedServiceNames</code> method and
77 * calls the <code>supportsService</code> method with this
79 * Has <b>OK</b> status if <code>true</code> value is
82 public void _supportsService() {
83 log
.println("testing supportsService");
84 names
= oObj
.getSupportedServiceNames();
85 tRes
.tested("supportsService()", oObj
.supportsService(names
[0]));
86 } // end supportsService()