merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / ifc / sdb / _XCompletedConnection.java
bloba51e8cd485f2e84ca38a1bb7329be5aa91c8e906
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: _XCompletedConnection.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.sdb;
33 import lib.MultiMethodTest;
34 import lib.StatusException;
36 import com.sun.star.sdb.XCompletedConnection;
37 import com.sun.star.sdbc.XConnection;
38 import com.sun.star.task.XInteractionHandler;
40 /**
41 * Testing <code>com.sun.star.sdb.XCompletedConnection</code>
42 * interface methods :
43 * <ul>
44 * <li><code> connectWithCompletion()</code></li>
45 * </ul> <p>
46 * The following object relations required :
47 * <ul>
48 * <li> <code>'XCompletedConnection.Handler'</code> : passed as parameter
49 * to <code>connectWithCompletion</code> method. </li>
50 * </ul>
51 * @see com.sun.star.sdb.XCompletedConnection
52 * @see com.sun.star.task.XInteractionHandler
53 * @see com.sun.star.sdbc.XConnection
55 public class _XCompletedConnection extends MultiMethodTest {
57 // oObj filled by MultiMethodTest
58 public XCompletedConnection oObj = null ;
60 /**
61 * Test call the method with handler passed as object relation.
62 * Then value returned is checked.<p>
63 * Has OK status if not null value returned. <&nbsp>
64 * FAILED if exception occured, null value returned or object
65 * relation was not found.
67 public void _connectWithCompletion() throws StatusException {
68 XInteractionHandler handler = (XInteractionHandler)
69 tEnv.getObjRelation("XCompletedConnection.Handler") ;
71 if (handler == null) {
72 log.println("Required object relation not found !") ;
73 tRes.tested("connectWithCompletion()", false) ;
74 return ;
77 XConnection con = null ;
78 try {
79 con = oObj.connectWithCompletion(handler) ;
80 } catch (com.sun.star.sdbc.SQLException e) {
81 throw new StatusException("Exception while method calling", e) ;
84 tRes.tested("connectWithCompletion()", con != null) ;
86 } // finish class _XCompletedConnection