Thread: [Proxool-cvs] proxool/src/java-test/org/logicalcobwebs/proxool testconfig-hsqldb.properties,NONE,1.1
UNMAINTAINED!
Brought to you by:
billhorsman
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8632/src/java-test/org/logicalcobwebs/proxool Modified Files: ProxyStatementTest.java GlobalTest.java FatalSqlExceptionTest.java ManyPoolsTest.java TestConstants.java PropertyTest.java PrototyperTest.java ConfigurationListenerTest.java ConnectionListenerTest.java UpdateDefinitionTest.java Added Files: testconfig-hsqldb.properties Log Message: Allow JUnit tests to be executed against another database. By default the test configuration will be taken from the 'testconfig-hsqldb.properties' file located in the org.logicalcobwebs.proxool package. This behavior can be overriden by setting the 'testConfig' environment property to another location. --- NEW FILE: testconfig-hsqldb.properties --- HYPERSONIC_DRIVER = org.hsqldb.jdbcDriver HYPERSONIC_USER = sa HYPERSONIC_PASSWORD = HYPERSONIC_TEST_SQL = SELECT COUNT(1) FROM SYSTEM_CATALOGS HYPERSONIC_URL_PREFIX = jdbc:hsqldb:db/ HYPERSONIC_TEST_URL = jdbc:hsqldb:db/test HYPERSONIC_TEST_URL2 = jdbc:hsqldb:db/2 FATAL_SQL_STATEMENT = drop table Z FATAL_SQL_EXCEPTION = Table not found Index: ProxyStatementTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/ProxyStatementTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ProxyStatementTest.java 23 Mar 2004 21:17:23 -0000 1.9 --- ProxyStatementTest.java 26 May 2004 17:19:09 -0000 1.10 *************** *** 6,19 **** package org.logicalcobwebs.proxool; ! import org.logicalcobwebs.logging.Log; ! import org.logicalcobwebs.logging.LogFactory; ! import java.sql.Connection; import java.sql.DriverManager; - import java.sql.Statement; import java.sql.PreparedStatement; ! import java.sql.CallableStatement; import java.util.Properties; /** * Test whether ProxyStatement works --- 6,19 ---- package org.logicalcobwebs.proxool; ! import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; ! import java.sql.Statement; import java.util.Properties; + import org.logicalcobwebs.logging.Log; + import org.logicalcobwebs.logging.LogFactory; + /** * Test whether ProxyStatement works *************** *** 35,61 **** * That we can get the delegate driver's Statement from the one given by Proxool */ ! public void testDelegateStatement() throws Exception { ! String testName = "delegateStatement"; - String alias = testName; - Connection c = null; // Register pool ! String url = TestHelper.buildProxoolUrl(alias, ! TestConstants.HYPERSONIC_DRIVER, ! TestConstants.HYPERSONIC_TEST_URL); ! Properties info = new Properties(); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ! ProxoolFacade.registerConnectionPool(url, info); ! c = DriverManager.getConnection(url); ! Statement s = c.createStatement(); ! Statement delegateStatement = ProxoolFacade.getDelegateStatement(s); ! LOG.debug("Statement " + s.getClass() + " is delegating to " + delegateStatement.getClass()); ! assertTrue("Delegate statement isn't a Hypersonic one as expected.", delegateStatement instanceof org.hsqldb.jdbcStatement); } /** * Test what interfaces are supported when getting a PreparedStatement --- 35,67 ---- * That we can get the delegate driver's Statement from the one given by Proxool */ ! public void testDelegateStatement() throws Exception ! { String testName = "delegateStatement"; // Register pool ! String url = registerPool(testName); ! // get a connection from the pool and create a statement with it ! Connection c = DriverManager.getConnection(url); ! Statement s = c.createStatement(); ! Statement delegateStatement = ProxoolFacade.getDelegateStatement(s); ! Class delegateStatementClass = delegateStatement.getClass(); ! s.close(); ! ! LOG.debug("Statement " + s.getClass() + " is delegating to " + delegateStatementClass); ! ! // get a *real* connection directly from the native driver (bypassing the pool) ! Connection realConnection = TestHelper.getDirectConnection(); ! Statement realStatement = realConnection.createStatement(); ! Class realStatementClass = realStatement.getClass(); ! ! realStatement.close(); ! realConnection.close(); + // are they of the same type ? + assertEquals("Delegate statement isn't of the expected type.", realStatementClass, delegateStatementClass); } + /** * Test what interfaces are supported when getting a PreparedStatement *************** *** 64,87 **** String testName = "preparedStatement"; - String alias = testName; - Connection c = null; // Register pool ! String url = TestHelper.buildProxoolUrl(alias, ! TestConstants.HYPERSONIC_DRIVER, ! TestConstants.HYPERSONIC_TEST_URL); ! Properties info = new Properties(); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ! ProxoolFacade.registerConnectionPool(url, info); ! c = DriverManager.getConnection(url); PreparedStatement s = c.prepareStatement(TestConstants.HYPERSONIC_TEST_SQL); Statement delegateStatement = ProxoolFacade.getDelegateStatement(s); ! LOG.debug("Statement " + s.getClass() + " is delegating to " + delegateStatement.getClass()); ! assertTrue("Delegate statement isn't a Hypersonic one as expected.", delegateStatement instanceof org.hsqldb.jdbcPreparedStatement); ! } /** * Test what interfaces are supported when getting a CallableStatement --- 70,99 ---- String testName = "preparedStatement"; // Register pool ! String url = registerPool(testName); ! // get a connection from the pool and create a prepare statement with it ! Connection c = DriverManager.getConnection(url); PreparedStatement s = c.prepareStatement(TestConstants.HYPERSONIC_TEST_SQL); Statement delegateStatement = ProxoolFacade.getDelegateStatement(s); ! Class delegateStatementClass = delegateStatement.getClass(); ! s.close(); ! ! LOG.debug("Statement " + s.getClass() + " is delegating to " + delegateStatementClass); ! ! // get a *real* connection directly from the native driver (bypassing the pool) ! Connection realConnection = TestHelper.getDirectConnection(); ! Statement realStatement = realConnection.prepareStatement(TestConstants.HYPERSONIC_TEST_SQL); ! Class realStatementClass = realStatement.getClass(); ! ! realStatement.close(); ! realConnection.close(); ! ! // are they of the same type ? ! assertEquals("Delegate statement isn't of the expected type.", realStatementClass, delegateStatementClass); } + /** * Test what interfaces are supported when getting a CallableStatement *************** *** 90,112 **** String testName = "callableStatement"; - String alias = testName; - Connection c = null; // Register pool ! String url = TestHelper.buildProxoolUrl(alias, ! TestConstants.HYPERSONIC_DRIVER, ! TestConstants.HYPERSONIC_TEST_URL); ! Properties info = new Properties(); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ! ProxoolFacade.registerConnectionPool(url, info); ! c = DriverManager.getConnection(url); CallableStatement s = c.prepareCall(TestConstants.HYPERSONIC_TEST_SQL); - s = c.prepareCall(TestConstants.HYPERSONIC_TEST_SQL); Statement delegateStatement = ProxoolFacade.getDelegateStatement(s); ! LOG.debug("Statement " + s.getClass() + " is delegating to " + delegateStatement.getClass()); ! assertTrue("Delegate statement isn't a Hypersonic one as expected.", delegateStatement instanceof org.hsqldb.jdbcPreparedStatement); ! } --- 102,128 ---- String testName = "callableStatement"; // Register pool ! String url = registerPool(testName); ! // get a connection from the pool and create a callable statement with it ! Connection c = DriverManager.getConnection(url); CallableStatement s = c.prepareCall(TestConstants.HYPERSONIC_TEST_SQL); Statement delegateStatement = ProxoolFacade.getDelegateStatement(s); ! Class delegateStatementClass = delegateStatement.getClass(); ! s.close(); ! ! LOG.debug("Statement " + s.getClass() + " is delegating to " + delegateStatementClass); ! ! // get a *real* connection directly from the native driver (bypassing the pool) ! Connection realConnection = TestHelper.getDirectConnection(); ! Statement realStatement = realConnection.prepareCall(TestConstants.HYPERSONIC_TEST_SQL); ! Class realStatementClass = realStatement.getClass(); ! ! realStatement.close(); ! realConnection.close(); ! ! // are they of the same type ? ! assertEquals("Delegate statement isn't of the expected type.", realStatementClass, delegateStatementClass ); } *************** *** 118,125 **** String testName = "delegateConnection"; - String alias = testName; - Connection c = null; // Register pool String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, --- 134,165 ---- String testName = "delegateConnection"; // Register pool + String url = registerPool(testName); + + // get a connection from the pool + Connection c = DriverManager.getConnection(url); + Connection delegateConnection = ProxoolFacade.getDelegateConnection(c); + Class delegateConnectionClass = delegateConnection.getClass(); + + LOG.debug("Connection " + c + " is delegating to " + delegateConnectionClass); + c.close(); + + // get a *real* connection directly from the native driver (bypassing the pool) + Connection realConnection = TestHelper.getDirectConnection(); + Class realConnectionClass = realConnection.getClass(); + realConnection.close(); + + assertEquals("Connection isn't of the expected.", realConnectionClass, delegateConnectionClass); + } + + + /** + * + * @param alias + * @throws Exception + */ + private String registerPool(String alias) throws Exception + { String url = TestHelper.buildProxoolUrl(alias, TestConstants.HYPERSONIC_DRIVER, *************** *** 129,140 **** info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); ! ! c = DriverManager.getConnection(url); ! Connection delegateConnection = ProxoolFacade.getDelegateConnection(c); ! LOG.debug("Conneciton " + c.getClass() + " is delegating to " + delegateConnection.getClass()); ! assertTrue("Connection isn't a Hypersonic one as expected.", delegateConnection instanceof org.hsqldb.jdbcConnection); ! ! } ! } --- 169,175 ---- info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); ! ! return url; ! } } *************** *** 143,146 **** --- 178,186 ---- Revision history: $Log$ + Revision 1.10 2004/05/26 17:19:09 brenuart + Allow JUnit tests to be executed against another database. + By default the test configuration will be taken from the 'testconfig-hsqldb.properties' file located in the org.logicalcobwebs.proxool package. + This behavior can be overriden by setting the 'testConfig' environment property to another location. + Revision 1.9 2004/03/23 21:17:23 billhorsman added preparedStatement and callableStatement tests Index: GlobalTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/GlobalTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GlobalTest.java 26 Oct 2003 16:23:20 -0000 1.18 --- GlobalTest.java 26 May 2004 17:19:09 -0000 1.19 *************** *** 6,12 **** --- 6,17 ---- package org.logicalcobwebs.proxool; + import java.io.InputStream; + import java.lang.reflect.Field; + import java.util.Properties; + import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestSuite; + import org.apache.log4j.xml.DOMConfigurator; import org.logicalcobwebs.logging.Log; *************** *** 16,19 **** --- 21,26 ---- * Provides a suite of all tests. And some utility methods for setting * up the logging. + * + * The test configuration can be specified using the env property "testConfig" * * @version $Revision$, $Date$ *************** *** 24,53 **** public class GlobalTest { private static final Log LOG = LogFactory.getLog(GlobalTest.class); private static boolean initialised; ! public static synchronized void globalSetup() throws ClassNotFoundException { ! if (!initialised) { ! String log4jPath = System.getProperty("log4jPath"); ! if (log4jPath != null && log4jPath.length() > 0) { ! try { ! DOMConfigurator.configureAndWatch(log4jPath); ! } catch (Exception e) { ! LOG.debug("Can't configure logging using " + log4jPath); ! } ! } else { ! // Well, at least switch on debugging ! System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug"); ! org.apache.log4j.BasicConfigurator.resetConfiguration(); ! org.apache.log4j.BasicConfigurator.configure(); } ! Class.forName(ProxoolDriver.class.getName()); ! initialised = true; ! } } public static synchronized void globalTeardown(String alias) { ProxoolFacade.shutdown(alias + ":teardown", 10000); --- 31,138 ---- public class GlobalTest { + private static final String defaultConfig = "/org/logicalcobwebs/proxool/testconfig-hsqldb.properties"; + private static final Log LOG = LogFactory.getLog(GlobalTest.class); private static boolean initialised; ! public static synchronized void globalSetup() throws Exception ! { ! // return immediately if we are already initialised ! if (initialised) { ! return; ! } ! ! // configure log4j ! String log4jPath = System.getProperty("log4jPath"); ! if (log4jPath != null && log4jPath.length() > 0) { ! try { ! DOMConfigurator.configureAndWatch(log4jPath); ! } catch (Exception e) { ! LOG.debug("Can't configure logging using " + log4jPath); } + } else { + // Well, at least switch on debugging + System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug"); + org.apache.log4j.BasicConfigurator.resetConfiguration(); + org.apache.log4j.BasicConfigurator.configure(); + } ! // Load ProxoolDriver class into DriverManager ! Class.forName(ProxoolDriver.class.getName()); ! // initialise test configuration ! initTestConstants(defaultConfig); ! ! // remember we are correctly initialized ! initialised = true; } + + /** + * + * @throws Exception + */ + private static void initTestConstants() throws Exception + { + String resourceName = System.getProperty("testConfig"); + if( resourceName==null || resourceName.length()==0 ) + { + LOG.info("Test configuration set to default value"); + } + else + { + initTestConstants(resourceName); + } + } + + /** + * + * @param resourceName + */ + private static void initTestConstants(String resourceName) throws Exception + { + // locate and read resource file + InputStream resourceStream = null; + Properties props = new Properties(); + try { + LOG.info("Loading test configuration from "+resourceName); + resourceStream = resourceName.getClass().getResourceAsStream(resourceName); + props.load(resourceStream); + } + catch(Exception e) + { + LOG.error("Problem while loading test configuration", e); + throw e; + } + finally { + if( resourceStream != null ) { + resourceStream.close(); + } + } + + // parse resource file and initialize TestConstants + Field[] fields = TestConstants.class.getDeclaredFields(); + for(int i=0; i<fields.length; i++) + { + Field field = fields[i]; + + // locate value in property file + String propertyName = field.getName(); + String value = props.getProperty(propertyName); + + if( value==null ) + { + LOG.info("Set "+propertyName+" to default value"); + } + else + { + LOG.info("Set " + propertyName+ " to '" + value + "'"); + field.set(null, value); + } + } + } + + public static synchronized void globalTeardown(String alias) { ProxoolFacade.shutdown(alias + ":teardown", 10000); *************** *** 80,83 **** --- 165,169 ---- return wrapper; } + } *************** *** 86,89 **** --- 172,180 ---- Revision history: $Log$ + Revision 1.19 2004/05/26 17:19:09 brenuart + Allow JUnit tests to be executed against another database. + By default the test configuration will be taken from the 'testconfig-hsqldb.properties' file located in the org.logicalcobwebs.proxool package. + This behavior can be overriden by setting the 'testConfig' environment property to another location. + Revision 1.18 2003/10/26 16:23:20 billhorsman Fixed up test suites Index: FatalSqlExceptionTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/FatalSqlExceptionTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FatalSqlExceptionTest.java 23 Mar 2004 21:16:05 -0000 1.6 --- FatalSqlExceptionTest.java 26 May 2004 17:19:09 -0000 1.7 *************** *** 41,49 **** TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, "Table not found"); ! info.setProperty(ProxoolConstants.VERBOSE_PROPERTY, String.valueOf(Boolean.TRUE)); ! info.setProperty(ProxoolConstants.TRACE_PROPERTY, String.valueOf(Boolean.TRUE)); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); --- 41,49 ---- TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, TestConstants.FATAL_SQL_EXCEPTION); ! info.setProperty(ProxoolConstants.VERBOSE_PROPERTY, String.valueOf(Boolean.TRUE)); ! info.setProperty(ProxoolConstants.TRACE_PROPERTY, String.valueOf(Boolean.TRUE)); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); *************** *** 67,76 **** Statement s = c2.createStatement(); // Doing it twice will guarantee a failure. Even if it exists ! s.execute("drop table Z"); ! s.execute("drop table Z"); } catch (SQLException e) { assertTrue("Didn't expect a " + FatalSQLException.class.getName(), !(e instanceof FatalSQLException)); // Expected exception (foo doesn't exist) ! LOG.debug("Expected exception (safe to ignore)", e); } finally { if (c2 != null) { --- 67,76 ---- Statement s = c2.createStatement(); // Doing it twice will guarantee a failure. Even if it exists ! s.execute(TestConstants.FATAL_SQL_STATEMENT); ! s.execute(TestConstants.FATAL_SQL_STATEMENT); } catch (SQLException e) { assertTrue("Didn't expect a " + FatalSQLException.class.getName(), !(e instanceof FatalSQLException)); // Expected exception (foo doesn't exist) ! //LOG.debug("Expected exception (safe to ignore)", e); } finally { if (c2 != null) { *************** *** 93,96 **** --- 93,97 ---- } + public void testWrappedFatalSqlException() throws Exception { *************** *** 102,109 **** TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, "Table not found"); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, FatalSQLException.class.getName()); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); --- 103,110 ---- TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, TestConstants.FATAL_SQL_EXCEPTION); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, FatalSQLException.class.getName()); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); *************** *** 112,120 **** c = DriverManager.getConnection(url); Statement s = c.createStatement(); ! s.execute("drop table Z"); } catch (SQLException e) { assertTrue("Expected a " + FatalSQLException.class.getName() + " but got a " + e.getClass().getName() + " instead", e instanceof FatalSQLException); // Expected exception (foo doesn't exist) ! LOG.debug("Expected exception (safe to ignore)", e); } --- 113,121 ---- c = DriverManager.getConnection(url); Statement s = c.createStatement(); ! s.execute(TestConstants.FATAL_SQL_STATEMENT); } catch (SQLException e) { assertTrue("Expected a " + FatalSQLException.class.getName() + " but got a " + e.getClass().getName() + " instead", e instanceof FatalSQLException); // Expected exception (foo doesn't exist) ! //LOG.debug("Expected exception (safe to ignore)", e); } *************** *** 143,150 **** TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, "Table not found"); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, FatalRuntimeException.class.getName()); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); --- 144,151 ---- TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, TestConstants.FATAL_SQL_EXCEPTION); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, FatalRuntimeException.class.getName()); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); ProxoolFacade.registerConnectionPool(url, info); *************** *** 153,157 **** c = DriverManager.getConnection(url); Statement s = c.createStatement(); ! s.execute("drop table Z"); } catch (RuntimeException e) { assertTrue("Expected a " + FatalRuntimeException.class.getName() + " but got a " + e.getClass().getName() + " instead", e instanceof FatalRuntimeException); --- 154,158 ---- c = DriverManager.getConnection(url); Statement s = c.createStatement(); ! s.execute(TestConstants.FATAL_SQL_STATEMENT); } catch (RuntimeException e) { assertTrue("Expected a " + FatalRuntimeException.class.getName() + " but got a " + e.getClass().getName() + " instead", e instanceof FatalRuntimeException); *************** *** 184,191 **** TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, "Table not found"); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, "org.does.not.Exist"); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); try { ProxoolFacade.registerConnectionPool(url, info); --- 185,192 ---- TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, TestConstants.FATAL_SQL_EXCEPTION); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, "org.does.not.Exist"); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); try { ProxoolFacade.registerConnectionPool(url, info); *************** *** 207,215 **** TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, "Table not found"); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); // ProxoolException isn't a RuntimeException or an SQLException info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, ProxoolException.class.getName()); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); try { ProxoolFacade.registerConnectionPool(url, info); --- 208,216 ---- TestConstants.HYPERSONIC_TEST_URL); Properties info = new Properties(); ! info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, TestConstants.FATAL_SQL_EXCEPTION); ! info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); // ProxoolException isn't a RuntimeException or an SQLException info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_WRAPPER_CLASS_PROPERTY, ProxoolException.class.getName()); ! info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); try { ProxoolFacade.registerConnectionPool(url, info); *************** *** 227,230 **** --- 228,236 ---- Revision history: $Log$ + Revision 1.7 2004/05/26 17:19:09 brenuart + Allow JUnit tests to be executed against another database. + By default the test configuration will be taken from the 'testconfig-hsqldb.properties' file located in the org.logicalcobwebs.proxool package. + This behavior can be overriden by setting the 'testConfig' environment property to another location. + Revision 1.6 2004/03/23 21:16:05 billhorsman make use of new getId() to compare connections Index: ManyPoolsTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/ManyPoolsTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ManyPoolsTest.java 5 Mar 2003 18:49:27 -0000 1.1 --- ManyPoolsTest.java 26 May 2004 17:19:09 -0000 1.2 *************** *** 41,45 **** info.setProperty(ProxoolConstants.PROTOTYPE_COUNT_PROPERTY, "2"); info.setProperty(ProxoolConstants.HOUSE_KEEPING_SLEEP_TIME_PROPERTY, "30000"); ! final int poolCount = 100; String alias[] = new String[poolCount]; --- 41,46 ---- info.setProperty(ProxoolConstants.PROTOTYPE_COUNT_PROPERTY, "2"); ... [truncated message content] |