1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
30 import lib
.MultiMethodTest
;
31 import lib
.StatusException
;
33 import com
.sun
.star
.sdb
.XCompletedConnection
;
34 import com
.sun
.star
.sdbc
.XConnection
;
35 import com
.sun
.star
.task
.XInteractionHandler
;
38 * Testing <code>com.sun.star.sdb.XCompletedConnection</code>
41 * <li><code> connectWithCompletion()</code></li>
43 * The following object relations required :
45 * <li> <code>'XCompletedConnection.Handler'</code> : passed as parameter
46 * to <code>connectWithCompletion</code> method. </li>
48 * @see com.sun.star.sdb.XCompletedConnection
49 * @see com.sun.star.task.XInteractionHandler
50 * @see com.sun.star.sdbc.XConnection
52 public class _XCompletedConnection
extends MultiMethodTest
{
54 // oObj filled by MultiMethodTest
55 public XCompletedConnection oObj
= null ;
58 * Test call the method with handler passed as object relation.
59 * Then value returned is checked.<p>
60 * Has OK status if not null value returned. < >
61 * FAILED if exception occurred, null value returned or object
62 * relation was not found.
64 public void _connectWithCompletion() throws StatusException
{
65 XInteractionHandler handler
= (XInteractionHandler
)
66 tEnv
.getObjRelation("XCompletedConnection.Handler") ;
68 if (handler
== null) {
69 log
.println("Required object relation not found !") ;
70 tRes
.tested("connectWithCompletion()", false) ;
74 XConnection con
= null ;
76 con
= oObj
.connectWithCompletion(handler
) ;
77 } catch (com
.sun
.star
.sdbc
.SQLException e
) {
78 throw new StatusException("Exception while method calling", e
) ;
81 tRes
.tested("connectWithCompletion()", con
!= null) ;
83 } // finish class _XCompletedConnection