xref: /AOO41X/main/ucb/qa/complex/tdoc/_XServiceInfo.java (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package complex.tdoc;
29 
30 import lib.MultiMethodTest;
31 
32 import com.sun.star.lang.XServiceInfo;
33 import share.LogWriter;
34 
35 /**
36 * Testing <code>com.sun.star.lang.XServiceInfo</code>
37 * interface methods :
38 * <ul>
39 *  <li><code> getImplementationName()</code></li>
40 *  <li><code> supportsService()</code></li>
41 *  <li><code> getSupportedServiceNames()</code></li>
42 * </ul> <p>
43 * Test is multithread compilant. <p>
44 * @see com.sun.star.lang.XServiceInfo
45 */
46 public class _XServiceInfo {
47     public static XServiceInfo oObj = null;
48     public static String[] names = null;
49     public LogWriter log = null;
50 
51     /**
52     * Just calls the method.<p>
53     * Has <b>OK</b> status if no runtime exceptions occured.
54     */
55     public boolean _getImplementationName() {
56         boolean result = true;
57         log.println("testing getImplementationName() ... ");
58 
59         log.println("The ImplementationName ist "+oObj.getImplementationName());
60         result=true;
61 
62         return result;
63 
64     } // end getImplementationName()
65 
66 
67     /**
68     * Just calls the method.<p>
69     * Has <b>OK</b> status if no runtime exceptions occured.
70     */
71     public boolean _getSupportedServiceNames() {
72         boolean result = true;
73         log.println("getting supported Services...");
74         names = oObj.getSupportedServiceNames();
75         for (int i=0;i<names.length;i++) {
76            int k = i+1;
77            log.println(k+". Supported Service is "+names[i]);
78         }
79         result=true;
80 
81         return result;
82 
83     } // end getSupportedServiceNames()
84 
85     /**
86     * Gets one of the service names returned by
87     * <code>getSupportedServiceNames</code> method and
88     * calls the <code>supportsService</code> methos with this
89     * name. <p>
90     * Has <b>OK</b> status if <code>true</code> value is
91     * returned.
92     */
93     public boolean _supportsService() {
94         log.println("testing supportsService");
95         names = oObj.getSupportedServiceNames();
96         return oObj.supportsService(names[0]);
97     } // end supportsService()
98 }
99 
100