This file now requires Ant 1.4.1. 2002-04-18
- $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.36 2003/08/24 22:10:09 barry Exp $
+ $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.37 2003/11/03 15:28:26 davec Exp $
-->
<!-- This compiles and executes the JUnit tests -->
<!-- defaults for the tests - override these if required -->
- <property name="database" value="jdbc:postgresql:test" />
+ <property name="server" value="localhost" />
+ <property name="port" value="${def_pgport}" />
+ <property name="database" value="test" />
<property name="username" value="test" />
<!-- Password must be something. Doesn't matter if trust is used! -->
<property name="password" value="password" />
<junit>
<formatter type="brief" usefile="false"/>
+ <sysproperty key="server" value="${server}" />
+ <sysproperty key="port" value="${port}" />
<sysproperty key="database" value="${database}" />
<sysproperty key="username" value="${username}" />
<sysproperty key="password" value="${password}" />
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25 2003/10/29 02:39:09 davec Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.26 2003/11/03 15:28:26 davec Exp $
*
*-------------------------------------------------------------------------
*/
if (--current_row < 0)
return false;
this_row = (byte[][]) rows.elementAt(current_row);
+ rowBuffer = new byte[this_row.length][];
System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
return true;
}
TestUtil.closeDB(con);
}
+ public void testBackward() throws Exception
+ {
+ Statement stmt = con.createStatement();
+ ResultSet rs = stmt.executeQuery("SELECT * FROM testrs");
+ rs.afterLast();
+ assertTrue(rs.previous());
+ rs.close();
+ stmt.close();
+ }
+
public void testAbsolute() throws Exception
{
Statement stmt = con.createStatement();
* interface to the PooledConnection is through the CPDS.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class ConnectionPoolTest extends BaseDataSourceTest
{
if (bds == null)
{
bds = new ConnectionPool();
- String db = TestUtil.getURL();
- if (db.indexOf('/') > -1)
- {
- db = db.substring(db.lastIndexOf('/') + 1);
- }
- else if (db.indexOf(':') > -1)
- {
- db = db.substring(db.lastIndexOf(':') + 1);
- }
- bds.setDatabaseName(db);
+ bds.setServerName(TestUtil.getServer());
+ bds.setPortNumber(TestUtil.getPort());
+ bds.setDatabaseName(TestUtil.getDatabase());
bds.setUser(TestUtil.getUser());
bds.setPassword(TestUtil.getPassword());
}
* Minimal tests for pooling DataSource. Needs many more.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class PoolingDataSourceTest extends BaseDataSourceTest
{
if (bds == null)
{
bds = new PoolingDataSource();
- String db = TestUtil.getURL();
- if (db.indexOf('/') > -1)
- {
- db = db.substring(db.lastIndexOf('/') + 1);
- }
- else if (db.indexOf(':') > -1)
- {
- db = db.substring(db.lastIndexOf(':') + 1);
- }
- bds.setDatabaseName(db);
+ bds.setServerName(TestUtil.getServer());
+ bds.setPortNumber(TestUtil.getPort());
+ bds.setDatabaseName(TestUtil.getDatabase());
bds.setUser(TestUtil.getUser());
bds.setPassword(TestUtil.getPassword());
((PoolingDataSource) bds).setDataSourceName(DS_NAME);
* configuration logic.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class SimpleDataSourceTest extends BaseDataSourceTest
{
if (bds == null)
{
bds = new SimpleDataSource();
- String db = TestUtil.getURL();
- if (db.indexOf('/') > -1)
- {
- db = db.substring(db.lastIndexOf('/') + 1);
- }
- else if (db.indexOf(':') > -1)
- {
- db = db.substring(db.lastIndexOf(':') + 1);
- }
- bds.setDatabaseName(db);
+ bds.setServerName(TestUtil.getServer());
+ bds.setPortNumber(TestUtil.getPort());
+ bds.setDatabaseName(TestUtil.getDatabase());
bds.setUser(TestUtil.getUser());
bds.setPassword(TestUtil.getPassword());
}
* Tests JDBC3 implementation of ConnectionPoolDataSource.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class Jdbc3ConnectionPoolTest extends ConnectionPoolTest
{
if (bds == null)
{
bds = new Jdbc3ConnectionPool();
- String db = TestUtil.getURL();
- if (db.indexOf('/') > -1)
- {
- db = db.substring(db.lastIndexOf('/') + 1);
- }
- else if (db.indexOf(':') > -1)
- {
- db = db.substring(db.lastIndexOf(':') + 1);
- }
- bds.setDatabaseName(db);
+ bds.setServerName(TestUtil.getServer());
+ bds.setPortNumber(TestUtil.getPort());
+ bds.setDatabaseName(TestUtil.getDatabase());
bds.setUser(TestUtil.getUser());
bds.setPassword(TestUtil.getPassword());
}
* Minimal tests for JDBC3 pooling DataSource. Needs many more.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class Jdbc3PoolingDataSourceTest extends PoolingDataSourceTest
{
private void configureDataSource(PoolingDataSource source)
{
String db = TestUtil.getURL();
- if (db.indexOf('/') > -1)
- {
- db = db.substring(db.lastIndexOf('/') + 1);
- }
- else if (db.indexOf(':') > -1)
- {
- db = db.substring(db.lastIndexOf(':') + 1);
- }
- source.setDatabaseName(db);
+ source.setServerName(TestUtil.getServer());
+ source.setPortNumber(TestUtil.getPort());
+ source.setDatabaseName(TestUtil.getDatabase());
source.setUser(TestUtil.getUser());
source.setPassword(TestUtil.getPassword());
source.setDataSourceName(DS_NAME);
* Tests JDBC3 non-pooling DataSource.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class Jdbc3SimpleDataSourceTest extends SimpleDataSourceTest {
/**
if (bds == null)
{
bds = new Jdbc3SimpleDataSource();
- String db = TestUtil.getURL();
- if (db.indexOf('/') > -1)
- {
- db = db.substring(db.lastIndexOf('/') + 1);
- }
- else if (db.indexOf(':') > -1)
- {
- db = db.substring(db.lastIndexOf(':') + 1);
- }
- bds.setDatabaseName(db);
+ bds.setServerName(TestUtil.getServer());
+ bds.setPortNumber(TestUtil.getPort());
+ bds.setDatabaseName(TestUtil.getDatabase());
bds.setUser(TestUtil.getUser());
bds.setPassword(TestUtil.getPassword());
}