01: package net.sourceforge.jaxor.db.tests;
02:
03: import junit.framework.TestCase;
04: import net.sourceforge.jaxor.example.db.HyperConnection;
05:
06: import java.sql.Connection;
07: import java.sql.SQLException;
08:
09: /*
10: * User: Mike
11: * Date: Jul 16, 2003
12: * Time: 6:36:58 PM
13: */
14:
15: public class ConnectionDecoratorTest extends TestCase {
16:
17: public void testNonClosing() throws SQLException {
18: Connection conn = HyperConnection.INSTANCE.getConnection();
19: Connection nonClosing = net.sourceforge.jaxor.db.ConnectionDecorator
20: .createNonClosing(conn);
21: nonClosing.close();
22: assertFalse(conn.isClosed());
23: assertFalse(nonClosing.isClosed());
24: conn.close();
25: assertTrue(conn.isClosed());
26: assertTrue(nonClosing.isClosed());
27: }
28: }
|