Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb720fa9

Browse files
author
Dave Cramer
committed
patch for rs.previous and test case as well as patch for allowing server and port to be specified in test cases
1 parentefea5da commitb720fa9

File tree

9 files changed

+42
-68
lines changed

9 files changed

+42
-68
lines changed

‎src/interfaces/jdbc/build.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
This file now requires Ant 1.4.1. 2002-04-18
88
9-
$Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.36 2003/08/24 22:10:09 barry Exp $
9+
$Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.37 2003/11/03 15:28:26 davec Exp $
1010
1111
-->
1212

@@ -305,7 +305,9 @@
305305
<!-- This compiles and executes the JUnit tests-->
306306

307307
<!-- defaults for the tests - override these if required-->
308-
<propertyname="database"value="jdbc:postgresql:test" />
308+
<propertyname="server"value="localhost" />
309+
<propertyname="port"value="${def_pgport}" />
310+
<propertyname="database"value="test" />
309311
<propertyname="username"value="test" />
310312
<!-- Password must be something. Doesn't matter if trust is used!-->
311313
<propertyname="password"value="password" />
@@ -337,6 +339,8 @@
337339
<junit>
338340
<formattertype="brief"usefile="false"/>
339341

342+
<syspropertykey="server"value="${server}" />
343+
<syspropertykey="port"value="${port}" />
340344
<syspropertykey="database"value="${database}" />
341345
<syspropertykey="username"value="${username}" />
342346
<syspropertykey="password"value="${password}" />

‎src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Copyright (c) 2003, PostgreSQL Global Development Group
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25 2003/10/29 02:39:09 davec Exp $
12+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.26 2003/11/03 15:28:26 davec Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -493,6 +493,7 @@ public boolean previous() throws SQLException
493493
if (--current_row <0)
494494
returnfalse;
495495
this_row = (byte[][])rows.elementAt(current_row);
496+
rowBuffer =newbyte[this_row.length][];
496497
System.arraycopy(this_row,0,rowBuffer,0,this_row.length);
497498
returntrue;
498499
}

‎src/interfaces/jdbc/org/postgresql/test/jdbc2/ResultSetTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ protected void tearDown() throws Exception
8383
TestUtil.closeDB(con);
8484
}
8585

86+
publicvoidtestBackward()throwsException
87+
{
88+
Statementstmt =con.createStatement();
89+
ResultSetrs =stmt.executeQuery("SELECT * FROM testrs");
90+
rs.afterLast();
91+
assertTrue(rs.previous());
92+
rs.close();
93+
stmt.close();
94+
}
95+
8696
publicvoidtestAbsolute()throwsException
8797
{
8898
Statementstmt =con.createStatement();

‎src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* interface to the PooledConnection is through the CPDS.
1212
*
1313
* @author Aaron Mulder (ammulder@chariotsolutions.com)
14-
* @version $Revision: 1.6 $
14+
* @version $Revision: 1.7 $
1515
*/
1616
publicclassConnectionPoolTestextendsBaseDataSourceTest
1717
{
@@ -31,16 +31,9 @@ protected void initializeDataSource()
3131
if (bds ==null)
3232
{
3333
bds =newConnectionPool();
34-
Stringdb =TestUtil.getURL();
35-
if (db.indexOf('/') > -1)
36-
{
37-
db =db.substring(db.lastIndexOf('/') +1);
38-
}
39-
elseif (db.indexOf(':') > -1)
40-
{
41-
db =db.substring(db.lastIndexOf(':') +1);
42-
}
43-
bds.setDatabaseName(db);
34+
bds.setServerName(TestUtil.getServer());
35+
bds.setPortNumber(TestUtil.getPort());
36+
bds.setDatabaseName(TestUtil.getDatabase());
4437
bds.setUser(TestUtil.getUser());
4538
bds.setPassword(TestUtil.getPassword());
4639
}

‎src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Minimal tests for pooling DataSource. Needs many more.
1010
*
1111
* @author Aaron Mulder (ammulder@chariotsolutions.com)
12-
* @version $Revision: 1.1 $
12+
* @version $Revision: 1.2 $
1313
*/
1414
publicclassPoolingDataSourceTestextendsBaseDataSourceTest
1515
{
@@ -40,16 +40,9 @@ protected void initializeDataSource()
4040
if (bds ==null)
4141
{
4242
bds =newPoolingDataSource();
43-
Stringdb =TestUtil.getURL();
44-
if (db.indexOf('/') > -1)
45-
{
46-
db =db.substring(db.lastIndexOf('/') +1);
47-
}
48-
elseif (db.indexOf(':') > -1)
49-
{
50-
db =db.substring(db.lastIndexOf(':') +1);
51-
}
52-
bds.setDatabaseName(db);
43+
bds.setServerName(TestUtil.getServer());
44+
bds.setPortNumber(TestUtil.getPort());
45+
bds.setDatabaseName(TestUtil.getDatabase());
5346
bds.setUser(TestUtil.getUser());
5447
bds.setPassword(TestUtil.getPassword());
5548
((PoolingDataSource)bds).setDataSourceName(DS_NAME);

‎src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* configuration logic.
99
*
1010
* @author Aaron Mulder (ammulder@chariotsolutions.com)
11-
* @version $Revision: 1.3 $
11+
* @version $Revision: 1.4 $
1212
*/
1313
publicclassSimpleDataSourceTestextendsBaseDataSourceTest
1414
{
@@ -28,16 +28,9 @@ protected void initializeDataSource()
2828
if (bds ==null)
2929
{
3030
bds =newSimpleDataSource();
31-
Stringdb =TestUtil.getURL();
32-
if (db.indexOf('/') > -1)
33-
{
34-
db =db.substring(db.lastIndexOf('/') +1);
35-
}
36-
elseif (db.indexOf(':') > -1)
37-
{
38-
db =db.substring(db.lastIndexOf(':') +1);
39-
}
40-
bds.setDatabaseName(db);
31+
bds.setServerName(TestUtil.getServer());
32+
bds.setPortNumber(TestUtil.getPort());
33+
bds.setDatabaseName(TestUtil.getDatabase());
4134
bds.setUser(TestUtil.getUser());
4235
bds.setPassword(TestUtil.getPassword());
4336
}

‎src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3ConnectionPoolTest.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Tests JDBC3 implementation of ConnectionPoolDataSource.
1313
*
1414
* @author Aaron Mulder (ammulder@chariotsolutions.com)
15-
* @version $Revision: 1.2 $
15+
* @version $Revision: 1.3 $
1616
*/
1717
publicclassJdbc3ConnectionPoolTestextendsConnectionPoolTest
1818
{
@@ -29,16 +29,9 @@ protected void initializeDataSource()
2929
if (bds ==null)
3030
{
3131
bds =newJdbc3ConnectionPool();
32-
Stringdb =TestUtil.getURL();
33-
if (db.indexOf('/') > -1)
34-
{
35-
db =db.substring(db.lastIndexOf('/') +1);
36-
}
37-
elseif (db.indexOf(':') > -1)
38-
{
39-
db =db.substring(db.lastIndexOf(':') +1);
40-
}
41-
bds.setDatabaseName(db);
32+
bds.setServerName(TestUtil.getServer());
33+
bds.setPortNumber(TestUtil.getPort());
34+
bds.setDatabaseName(TestUtil.getDatabase());
4235
bds.setUser(TestUtil.getUser());
4336
bds.setPassword(TestUtil.getPassword());
4437
}

‎src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3PoolingDataSourceTest.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Minimal tests for JDBC3 pooling DataSource. Needs many more.
1414
*
1515
* @author Aaron Mulder (ammulder@chariotsolutions.com)
16-
* @version $Revision: 1.1 $
16+
* @version $Revision: 1.2 $
1717
*/
1818
publicclassJdbc3PoolingDataSourceTestextendsPoolingDataSourceTest
1919
{
@@ -42,15 +42,9 @@ protected void initializeDataSource()
4242
privatevoidconfigureDataSource(PoolingDataSourcesource)
4343
{
4444
Stringdb =TestUtil.getURL();
45-
if (db.indexOf('/') > -1)
46-
{
47-
db =db.substring(db.lastIndexOf('/') +1);
48-
}
49-
elseif (db.indexOf(':') > -1)
50-
{
51-
db =db.substring(db.lastIndexOf(':') +1);
52-
}
53-
source.setDatabaseName(db);
45+
source.setServerName(TestUtil.getServer());
46+
source.setPortNumber(TestUtil.getPort());
47+
source.setDatabaseName(TestUtil.getDatabase());
5448
source.setUser(TestUtil.getUser());
5549
source.setPassword(TestUtil.getPassword());
5650
source.setDataSourceName(DS_NAME);

‎src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3SimpleDataSourceTest.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Tests JDBC3 non-pooling DataSource.
1111
*
1212
* @author Aaron Mulder (ammulder@chariotsolutions.com)
13-
* @version $Revision: 1.1 $
13+
* @version $Revision: 1.2 $
1414
*/
1515
publicclassJdbc3SimpleDataSourceTestextendsSimpleDataSourceTest {
1616
/**
@@ -29,16 +29,9 @@ protected void initializeDataSource()
2929
if (bds ==null)
3030
{
3131
bds =newJdbc3SimpleDataSource();
32-
Stringdb =TestUtil.getURL();
33-
if (db.indexOf('/') > -1)
34-
{
35-
db =db.substring(db.lastIndexOf('/') +1);
36-
}
37-
elseif (db.indexOf(':') > -1)
38-
{
39-
db =db.substring(db.lastIndexOf(':') +1);
40-
}
41-
bds.setDatabaseName(db);
32+
bds.setServerName(TestUtil.getServer());
33+
bds.setPortNumber(TestUtil.getPort());
34+
bds.setDatabaseName(TestUtil.getDatabase());
4235
bds.setUser(TestUtil.getUser());
4336
bds.setPassword(TestUtil.getPassword());
4437
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp