KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > logicalcobwebs > proxool > DelegateConnectionTest


1 /*
2  * This software is released under a licence similar to the Apache Software Licence.
3  * See org.logicalcobwebs.proxool.package.html for details.
4  * The latest version is available at http://proxool.sourceforge.net
5  */

6 package org.logicalcobwebs.proxool;
7
8 import java.util.Properties JavaDoc;
9 import java.sql.Connection JavaDoc;
10 import java.sql.DriverManager JavaDoc;
11
12 /**
13  * Tests whether we have access to the delegate connection
14  * @version $Revision: 1.1 $, $Date: 2004/03/23 21:14:24 $
15  * @author <a HREF="mailto:bill@logicalcobwebs.co.uk">Bill Horsman</a>
16  * @author $Author: billhorsman $ (current maintainer)
17  * @since Proxool 0.9
18  */

19 public class DelegateConnectionTest extends AbstractProxoolTest {
20
21     /**
22      * @see AbstractProxoolTest
23      */

24     public DelegateConnectionTest(String JavaDoc alias) {
25         super(alias);
26     }
27
28     /**
29      * Get a connection and cast it into the appropriate interface
30      */

31     public void testDelegateConnection() throws Exception JavaDoc {
32         String JavaDoc alias = "delegateConnection";
33         String JavaDoc url = TestHelper.buildProxoolUrl(alias,
34                 TestConstants.HYPERSONIC_DRIVER,
35                 TestConstants.HYPERSONIC_TEST_URL);
36         Properties JavaDoc info = new Properties JavaDoc();
37         info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER);
38         info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD);
39         Connection JavaDoc c1 = DriverManager.getConnection(url, info);
40         // TODO cast the connection into the appropriate *interface* and see if it works.
41
c1.close();
42     }
43
44 }
45 /*
46  Revision history:
47  $Log: DelegateConnectionTest.java,v $
48  Revision 1.1 2004/03/23 21:14:24 billhorsman
49  new tests
50
51 */
Popular Tags