Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6410c22

Browse files
author
Dave Cramer
committed
changes for new Datasource
1 parent 6bdbe4c commit 6410c22

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

src/interfaces/jdbc/build.xml

Lines changed: 13 additions & 10 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.25 2002/07/23 03:59:54 barry Exp $
9+
$Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.26 2002/07/30 11:38:13 davec Exp $
1010
1111
-->
1212

@@ -21,8 +21,8 @@
2121
<property name="jardir" value="jars" />
2222
<property name="builddir" value="build" />
2323
<property name="package" value="org/postgresql" />
24-
<property name="debug" value="off" />
25-
24+
<property name="debug" value="on" />
25+
2626
<!--
2727
This is a simpler method than utils.CheckVersion
2828
It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
@@ -40,10 +40,10 @@
4040
<equals arg1="${ant.java.version}" arg2="1.2"/>
4141
<equals arg1="${ant.java.version}" arg2="1.3"/>
4242
</or>
43-
</condition>
43+
</condition>
4444
<condition property="jdbc3">
4545
<equals arg1="${ant.java.version}" arg2="1.4"/>
46-
</condition>
46+
</condition>
4747
<available property="datasource" classname="javax.sql.DataSource"/>
4848
<available property="junit" classname="junit.framework.Test" />
4949
</target>
@@ -88,15 +88,18 @@
8888
<exclude name="${package}/jdbc1/**" unless="jdbc1"/>
8989
<exclude name="${package}/jdbc2/**" unless="jdbc2"/>
9090
<exclude name="${package}/jdbc3/**" unless="jdbc3"/>
91-
91+
9292
<exclude name="${package}/largeobject/PGblob.java" if="jdbc1" />
9393
<exclude name="${package}/largeobject/PGclob.java" if="jdbc1" />
9494

95-
<exclude name="${package}/PostgresqlDataSource.java" unless="datasource" />
96-
<exclude name="${package}/xa/**" unless="datasource" />
95+
<exclude name="${package}/jdbc2/optional/**" unless="datasource" />
96+
97+
<exclude name="${package}/PostgresqlDataSource.java" />
98+
<exclude name="${package}/xa/**" />
9799

98100
<exclude name="${package}/test/**" unless="junit" />
99101
<exclude name="${package}/test/jdbc2/**" if="jdbc1" />
102+
<exclude name="${package}/test/jdbc2/optional/**" unless="datasource" />
100103
<exclude name="${package}/test/JDBC2Tests.java" if="jdbc1" />
101104
</javac>
102105
</target>
@@ -115,7 +118,7 @@
115118
<equals arg1="${jdbc2}" arg2="true"/>
116119
</condition>
117120
<condition property="edition" value="JDBC3">
118-
<equals arg1="${jdbc3}" arg2="true"/>
121+
<equals arg1="${jdbc3}" arg2="true"/>
119122
</condition>
120123
<condition property="edition" value="JDBC2 Enterprise">
121124
<and>
@@ -212,7 +215,7 @@
212215

213216
<!-- defaults for the tests - override these if required -->
214217
<property name="database" value="jdbc:postgresql:test" />
215-
<property name="username" value="test" />
218+
<property name="username" value="postgres" />
216219
<!-- Password must be something. Doesn't matter if trust is used! -->
217220
<property name="password" value="password" />
218221
<!-- junit.ui is one of textui, awtui, or swingui -->

src/interfaces/jdbc/org/postgresql/test/JDBC2Tests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import junit.framework.TestSuite;
44
import junit.framework.TestCase;
5+
import junit.framework.Test;
56

67
import org.postgresql.test.jdbc2.*;
78
import java.sql.*;
9+
import java.lang.reflect.Method;
810

911
/*
1012
* Executes all known tests for JDBC2 and includes some utility methods.
@@ -229,6 +231,16 @@ public static TestSuite suite()
229231
suite.addTestSuite( UpdateableResultTest.class );
230232

231233
suite.addTestSuite( CallableStmtTest.class );
234+
235+
// try to load the optional test classes
236+
try {
237+
Class cls = Class.forName("org.postgresql.test.jdbc2.optional.OptionalTestSuite");
238+
Method meth = cls.getMethod("suite", new Class[0]);
239+
suite.addTest((Test)meth.invoke(null, new Object[0]));
240+
} catch (Exception e) {
241+
System.err.println("Excluding JDBC 2 Optional Package (DataSource) tests");
242+
}
243+
232244
// That's all folks
233245
return suite;
234246
}

0 commit comments

Comments
 (0)