bump product version to 5.0.4.1
[LibreOffice.git] / ucb / qa / complex / tdoc / _XServiceInfo.java
bloba58b6ac4b0da1459eac42699dad01a5104e727b0
1 /*
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 .
19 package complex.tdoc;
21 import com.sun.star.lang.XServiceInfo;
22 import share.LogWriter;
24 /**
25 * Testing <code>com.sun.star.lang.XServiceInfo</code>
26 * interface methods :
27 * <ul>
28 * <li><code> getImplementationName()</code></li>
29 * <li><code> supportsService()</code></li>
30 * <li><code> getSupportedServiceNames()</code></li>
31 * </ul> <p>
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;
40 /**
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());
49 result=true;
51 return result;
53 } // end getImplementationName()
56 /**
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++) {
65 int k = i+1;
66 log.println(k+". Supported Service is "+names[i]);
68 result=true;
70 return result;
72 } // end getSupportedServiceNames()
74 /**
75 * Gets one of the service names returned by
76 * <code>getSupportedServiceNames</code> method and
77 * calls the <code>supportsService</code> methos with this
78 * name. <p>
79 * Has <b>OK</b> status if <code>true</code> value is
80 * returned.
82 public boolean _supportsService() {
83 log.println("testing supportsService");
84 names = oObj.getSupportedServiceNames();
85 return oObj.supportsService(names[0]);
86 } // end supportsService()