merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / ifc / sdbcx / _XColumnsSupplier.java
blobb9eeded8dac2d6a0cde289b22df21e06fe00b4ae
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _XColumnsSupplier.java,v $
10 * $Revision: 1.4 $
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 ifc.sdbcx;
33 import lib.MultiMethodTest;
35 import com.sun.star.container.XNameAccess;
36 import com.sun.star.sdbcx.XColumnsSupplier;
38 /**
39 * Testing <code>com.sun.star.sdbcx.XColumnsSupplier</code>
40 * interface methods :
41 * <ul>
42 * <li><code> getColumns()</code></li>
43 * </ul> <p>
44 * @see com.sun.star.sdbcx.XColumnsSupplier
46 public class _XColumnsSupplier extends MultiMethodTest {
48 // oObj filled by MultiMethodTest
49 public XColumnsSupplier oObj = null ;
51 /**
52 * Has OK status if method returns not null
53 * <code>XNameAccess</code> object, FAILED otherwise.
55 public void _getColumns() {
57 XNameAccess cols = oObj.getColumns() ;
60 String[] colNames = cols.getElementNames() ;
62 log.println("Column names:") ;
63 for (int i =0 ; i < colNames.length; i++) {
64 log.println(" " + colNames[i]) ;
67 XServiceInfo info = null ;
68 try {
69 info = (XServiceInfo) UnoRuntime.queryInterface
70 (XServiceInfo.class, cols.getByName("colNames[0]")) ;
71 } catch (com.sun.star.uno.Exception e) {}
73 log.println("Support : " +
74 info.supportsService("com.sun.star.sdbcx.Column")) ;
77 tRes.tested("getColumns()", cols != null) ;
80 } // finish class _XColumnsSupplier