Update of /cvsroot/commonjava/commonjava-projects/commonjava-datasrc/src/test/org/commonjava/datasrc/sql
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8549/src/test/org/commonjava/datasrc/sql
Added Files:
ConnectionPoolTest.java
Log Message:
added unit test for connection pool by itself, using hsqldb.
Isolated the ConnectionPool to allow for single-pool direct
instantiations, instead of always having to work through the
manager...also improved the user/password logic for
connection instantiation.
--- NEW FILE: ConnectionPoolTest.java ---
/* Created on Jan 28, 2004 */
package org.commonjava.datasrc.sql;
import java.sql.Connection;
import org.commonjava.datasrc.sql.config.PoolConnectionInfo;
import org.commonjava.opl.DocumentDriver;
import org.commonjava.opl.OPLEngine;
import org.commonjava.opl.ParseException;
import junit.framework.TestCase;
/**
* @author jdcasey
*/
public class ConnectionPoolTest extends TestCase {
/**
* Constructor for ConnectionPoolTest.
* @param arg0
*/
public ConnectionPoolTest(String arg0) {
super(arg0);
}
public void testGetConnection() throws ParseException, ConnectionPoolException {
DocumentDriver driver = new DocumentDriver();
PoolConnectionInfo info = (PoolConnectionInfo)OPLEngine.getInstance(driver).parse(
"cprs:///testpool.xml"
);
ConnectionPool pool = new ConnectionPool(info);
Connection conn = pool.getConnection();
}
}
|