summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc
diff options
context:
space:
mode:
authorDave Cramer <davec@fastcrypt.com>2003-12-05 21:06:12 +0000
committerDave Cramer <davec@fastcrypt.com>2003-12-05 21:06:12 +0000
commitdfaf736bc7715cf31e6845364b0b6ca215d0ce1a (patch)
tree7d258a78943511da1d60ca3c327c62ba8211019b /src/interfaces/jdbc
parent88ae594bde5383b3ff6acf5d1a4bf5e6abcac1a4 (diff)
patch from Kris Jurka to allow the server end port to be specified when running
regression tests, this is a backpatch to 7.4
Diffstat (limited to 'src/interfaces/jdbc')
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/TestUtil.java24
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java15
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java15
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java15
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3ConnectionPoolTest.java15
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3PoolingDataSourceTest.java14
-rw-r--r--src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3SimpleDataSourceTest.java15
7 files changed, 48 insertions, 65 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/test/TestUtil.java b/src/interfaces/jdbc/org/postgresql/test/TestUtil.java
index 930215ed380..6b139435a54 100644
--- a/src/interfaces/jdbc/org/postgresql/test/TestUtil.java
+++ b/src/interfaces/jdbc/org/postgresql/test/TestUtil.java
@@ -13,6 +13,30 @@ public class TestUtil
*/
public static String getURL()
{
+ return "jdbc:postgresql://"+getServer()+":"+getPort()+"/"+getDatabase();
+ }
+
+ /*
+ * Returns the Test server
+ */
+ public static String getServer()
+ {
+ return System.getProperty("server");
+ }
+
+ /*
+ * Returns the Test port
+ */
+ public static int getPort()
+ {
+ return Integer.parseInt(System.getProperty("port"));
+ }
+
+ /*
+ * Returns the Test database
+ */
+ public static String getDatabase()
+ {
return System.getProperty("database");
}
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
index 8f84193990a..ef5823d18f5 100644
--- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
+++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
@@ -11,7 +11,7 @@ import java.sql.*;
* interface to the PooledConnection is through the CPDS.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.6.4.1 $
*/
public class ConnectionPoolTest extends BaseDataSourceTest
{
@@ -31,16 +31,9 @@ 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());
}
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java
index 9b08eca7d0c..701f835332e 100644
--- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java
+++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java
@@ -9,7 +9,7 @@ import org.postgresql.jdbc2.optional.BaseDataSource;
* Minimal tests for pooling DataSource. Needs many more.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.1.6.1 $
*/
public class PoolingDataSourceTest extends BaseDataSourceTest
{
@@ -40,16 +40,9 @@ 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);
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
index b5c3e100ecd..a33e6458a4e 100644
--- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
+++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
@@ -8,7 +8,7 @@ import org.postgresql.jdbc2.optional.SimpleDataSource;
* configuration logic.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.3.6.1 $
*/
public class SimpleDataSourceTest extends BaseDataSourceTest
{
@@ -28,16 +28,9 @@ 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());
}
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3ConnectionPoolTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3ConnectionPoolTest.java
index f679c48f77c..6fe6cc73df8 100644
--- a/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3ConnectionPoolTest.java
+++ b/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3ConnectionPoolTest.java
@@ -12,7 +12,7 @@ import javax.sql.PooledConnection;
* Tests JDBC3 implementation of ConnectionPoolDataSource.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.2.4.1 $
*/
public class Jdbc3ConnectionPoolTest extends ConnectionPoolTest
{
@@ -29,16 +29,9 @@ 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());
}
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3PoolingDataSourceTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3PoolingDataSourceTest.java
index 55374cb1b81..17220b39541 100644
--- a/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3PoolingDataSourceTest.java
+++ b/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3PoolingDataSourceTest.java
@@ -13,7 +13,7 @@ import org.postgresql.jdbc2.optional.PoolingDataSource;
* Minimal tests for JDBC3 pooling DataSource. Needs many more.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.1.6.1 $
*/
public class Jdbc3PoolingDataSourceTest extends PoolingDataSourceTest
{
@@ -42,15 +42,9 @@ 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);
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3SimpleDataSourceTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3SimpleDataSourceTest.java
index cef4c83f651..5bf45978f77 100644
--- a/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3SimpleDataSourceTest.java
+++ b/src/interfaces/jdbc/org/postgresql/test/jdbc3/Jdbc3SimpleDataSourceTest.java
@@ -10,7 +10,7 @@ import org.postgresql.jdbc3.*;
* Tests JDBC3 non-pooling DataSource.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.1.6.1 $
*/
public class Jdbc3SimpleDataSourceTest extends SimpleDataSourceTest {
/**
@@ -29,16 +29,9 @@ 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());
}