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 .
21 import lib
.MultiMethodTest
;
22 import lib
.StatusException
;
24 import com
.sun
.star
.sdbc
.SQLException
;
25 import com
.sun
.star
.sdbc
.XCloseable
;
26 import com
.sun
.star
.sdbc
.XResultSet
;
27 import com
.sun
.star
.uno
.UnoRuntime
;
30 * Testing <code>com.sun.star.sdbc.XCloseable</code>
33 * <li><code> close()</code></li>
35 * After test object must be recreated.
36 * @see com.sun.star.sdbc.XCloseable
38 public class _XCloseable
extends MultiMethodTest
{
40 // oObj filled by MultiMethodTest
41 public XCloseable oObj
= null ;
44 * Closes row set. If the component implements the interface
45 * <code>com.sun.star.sdbc.XResultSet</code> then tries to move
46 * the cursor to the first row in the result set.
47 * Has OK status if no exceptions were thrown during first call and
48 * if expected SQL exception was thrown during cursor moving.
50 public void _close() throws StatusException
{
55 } catch (SQLException e
) {
56 log
.println("Unexpected SQL Exception occurred:" + e
) ;
60 XResultSet resSet
= UnoRuntime
.queryInterface(XResultSet
.class, oObj
);
65 log
.println("Expected SQLException not occurred !");
67 } catch(SQLException e
) {
68 log
.println("Expected SQLException occurred");
73 tRes
.tested("close()", res
);
77 * Forces environment recreation.
81 disposeEnvironment() ;
84 } // finish class _XCloseable