diff options
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java index 8add0b19d80..403d9b2b68e 100644 --- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java +++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java @@ -3,6 +3,7 @@ package org.postgresql.test.jdbc2.optional; import junit.framework.TestCase; import org.postgresql.test.TestUtil; import org.postgresql.jdbc2.optional.BaseDataSource; +import org.postgresql.PGConnection; import java.sql.*; import java.util.*; @@ -16,7 +17,7 @@ import javax.naming.*; * tests. * * @author Aaron Mulder (ammulder@chariotsolutions.com) - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ public abstract class BaseDataSourceTest extends TestCase { @@ -180,6 +181,24 @@ public abstract class BaseDataSourceTest extends TestCase } /** + * Test to make sure that PGConnection methods can be called on the + * pooled Connection. + */ + public void testPGConnection() + { + try + { + con = getDataSourceConnection(); + ((PGConnection)con).getEncoding().name(); + con.close(); + } + catch (Exception e) + { + fail("Unable to call PGConnection method on pooled connection due to "+e.getClass().getName()+" ("+e.getMessage()+")"); + } + } + + /** * Uses the mini-JNDI implementation for testing purposes */ protected InitialContext getInitialContext() |