db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r330103 [1/2] - in /db/derby/code/trunk: ./ java/build/org/apache/derbyBuild/ java/testing/ java/testing/org/apache/derbyTesting/functionTests/harness/ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derby...
Date Tue, 01 Nov 2005 18:11:23 GMT
Author: davidvc
Date: Tue Nov  1 10:10:31 2005
New Revision: 330103

URL: http://svn.apache.org/viewcvs?rev=330103&view=rev
Log:
Commiting the patch for DERBY-516, submitted by Rick Hillegas.

NOTE: AS OF THIS PATCH YOU NEED junit.jar IN YOUR CLASSPATH FOR
A SUCCESSFUL BUILD AND TEST RUN.  See BUILDING.txt for details.

This adds support for backward/forward client/server compatibility testing 
into our testing procedures.

>From Rick's patch comments:

1) BUILDING.txt has been amended to tell developers that they must
   download JUnit.

2) java/testing/README.htm has been amended to point at a web page
   which describes how to run the compatibility tests. It points at
   java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/README.html.

3) DerbyJUnitTest.java is a superclass for Derby JUnit tests. It is a
   useful place to put extra assertion machinery not included in the
   base JUnit classes.

4) JDBCDriverTest.java is the actual JUnit test which checks expected
   datatypes.

5) testScript.xml is an ant harness for running all combinations of
   the compatibility test. Hopefully, we can discard this harness when
   a more robust JUnit harness is checked into Derby.

6) CompatibilityTest.java is a thin wrapper which runs one
   configuration (embedded) of JDBCDriverTest inside the derbyall
   suite.

7) Sed.java has been amended to filter out JUnit diagnostics which
   derbyall interprets as noise. This filtering allows derbyall canons
   to be empty for JUnit tests. 



Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/CompatibilityTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/Pinger.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/README.html   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/build.xml   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/testScript.xml   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest_app.properties   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/DerbyJUnitTest.java   (with props)
Modified:
    db/derby/code/trunk/BUILDING.txt
    db/derby/code/trunk/build.xml
    db/derby/code/trunk/java/build/org/apache/derbyBuild/build.xml
    db/derby/code/trunk/java/testing/README.htm
    db/derby/code/trunk/java/testing/build.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml
    db/derby/code/trunk/tools/ant/properties/extrapath.properties

Modified: db/derby/code/trunk/BUILDING.txt
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/BUILDING.txt?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/BUILDING.txt (original)
+++ db/derby/code/trunk/BUILDING.txt Tue Nov  1 10:10:31 2005
@@ -11,13 +11,14 @@
 2     Downloads
 2.1   Download source code
 2.2   Download required software
-2.2.1 Download and install Apache Ant 1.6.x
+2.2.1 Download and install Apache Ant 1.6.x2
 2.2.2 Download and install Java Development Kit release 1.4.x
 2.2.3 Download and install Java Development Kit release 1.3.x
 2.2.4 Download extensions for Java Development Kit release 1.3.x
-2.2.5 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
-2.2.6 Download Jikes 1.14 (Optional)
-2.2.7 Download J2ME/CDC/FOundation 1.0 and JSR169 jars (Optional)
+2.2.5 Download and install JUnit 3.8.*
+2.2.6 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
+2.2.7 Download Jikes 1.14 (Optional)
+2.2.8 Download J2ME/CDC/FOundation 1.0 and JSR169 jars (Optional)
 
 3     Build instructions
 3.1   Set required environmental variables
@@ -126,7 +127,6 @@
     directory in the rest of this document. 
 
 
-
 2.2.2 Download and install Java Development Kit (JDK) release 1.4.x
 
 Skip steps 1-2 of this section if you already have JDK 1.4.x 
@@ -191,7 +191,20 @@
 
 
 
-2.2.5 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
+2.2.5 Download and install JUnit 3.8.*
+
+(1) JUnit is needed for some of Derby's tests. Download a JUnit 3.8.*
+    zip file from www.junit.org.
+    Note that Derby has been successfully built with JUnit 3.8.1
+    and we expect that other 3.8.* versions will work with our
+    build process. The 4.* series of JUnit releases may not work
+    until we fix the Derby build to accomodate the 1.5 extensions
+    to java.
+
+(2) Unzip the JUnit zip file and place junit.jar from the zip file into
+    ${derby.source}/tools/java.
+
+2.2.6 Download OSGi Service Platform release 3 (osgi.jar) (Optional)
 
 This is an optional section.
 The reason is that osgi.jar is required to only build the 
@@ -225,7 +238,7 @@
 ${derby.source}/tools/java/osgi.jar
 
 
-2.2.6 Download and Install Jikes 1.14 (Optional)
+2.2.7 Download and Install Jikes 1.14 (Optional)
 
 This is an optional section.
 
@@ -241,7 +254,7 @@
 referred to as the ${jikes.dir} directory in the rest of this 
 document. 
 
-2.2.7 Download J2ME/CDC/Foundation and JSR 169 jars
+2.2.8 Download J2ME/CDC/Foundation and JSR 169 jars
 
 This is an optional section.
 

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/build.xml?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Tue Nov  1 10:10:31 2005
@@ -13,7 +13,7 @@
   <property file="${properties.dir}/sane${sanity}.properties"/>
   <property file="${properties.dir}/defaultcompiler.properties"/>
   <property file="${properties.dir}/${build.compiler}.properties"/>
-  <!-- Compile-time classpath properties files -->
+  <!-- Compile-time classpath`< properties files -->
   <property file="${properties.dir}/extrapath.properties"/>
   <property file="${properties.dir}/compilepath.properties"/>
   <!-- Release and version info -->
@@ -29,6 +29,7 @@
 <!-- ==================================================================== -->
 
   <target name="init" unless="init.done">
+
     <tstamp/>
     <mkdir dir="${out.dir}"/>
     <!-- generate sanity state.properties if one does not exist -->

Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/build/org/apache/derbyBuild/build.xml?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/build.xml (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/build.xml Tue Nov  1 10:10:31 2005
@@ -21,6 +21,7 @@
 
   <target name="compile">
     <copy file="${derby.build.src.dir}/org/apache/derbyBuild/odbcgen_fragments.properties" tofile="${out.dir}/org/apache/derbyBuild/odbcgen_fragments.properties"/>
+
     <javac
       bootclasspath="${empty}"
       nowarn="on"

Modified: db/derby/code/trunk/java/testing/README.htm
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/README.htm?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/README.htm (original)
+++ db/derby/code/trunk/java/testing/README.htm Tue Nov  1 10:10:31 2005
@@ -68,6 +68,7 @@
 	<LI><P><A HREF="#props">4.12 Some test harness properties</A> 
 	</P>
 	<LI><P><A HREF="#security">4.13 SecuirtyManager testing by default</A></P>
+    <li><a href="./org/apache/derbyTesting/functionTests/tests/compatibility/README.html">5. Compatibility Tests</a> </li>
 </UL>
 <P><BR><BR>
 </P>
@@ -148,8 +149,10 @@
 		db2jcc_license_c.jar<BR></FONT>&nbsp;&nbsp;&nbsp; <FONT SIZE=2>IBM
 		Universal JDBC Driver classes. (See IBM <A HREF="http://www-106.ibm.com/developerworks/db2/downloads/jcc/">developerworks</A>
 		for download)</FONT></P>
-		<LI><P><FONT SIZE=2>derbyLocale_*.jar</FONT> &nbsp;&nbsp;&nbsp;
+		<LI><P><FONT SIZE=2>derbyLocale_*.jar</FONT> <BR>&nbsp;&nbsp;&nbsp;
 		<FONT SIZE=2>locale files holding translated messages.</FONT></P>
+        <li><P><FONT SIZE=2>junit.jar &nbsp;&nbsp;&nbsp;</li>
+        <BR>&nbsp;&nbsp;&nbsp; assertion-based test machinery.</FONT></p>
 	</UL>
 </UL>
 <P>For example:</P>
@@ -1236,4 +1239,4 @@
 <P STYLE="margin-bottom: 0in"><BR>
 </P>
 </BODY>
-</HTML>
\ No newline at end of file
+</HTML>

Modified: db/derby/code/trunk/java/testing/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/build.xml?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/build.xml (original)
+++ db/derby/code/trunk/java/testing/build.xml Tue Nov  1 10:10:31 2005
@@ -42,6 +42,7 @@
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/harness"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/testData"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/util"/> 
+    <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/compatibility"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/jdbcapi"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/lang"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/store"/> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java Tue Nov  1 10:10:31 2005
@@ -99,6 +99,11 @@
         deleteLines.addElement("^\\[.*db2jcc_license_c.jar\\] [1-9].[0-9] - .*$");	
         deleteLines.addElement("^XSDB.*$");
 
+		// JUnit noise
+        deleteLines.addElement("^\\.*$");
+        deleteLines.addElement("^Time: [0-9].*$");
+        deleteLines.addElement("^OK \\(.*$");
+
         // Vectors for substitutions
         Vector searchStrings = new Vector();
         searchStrings.addElement("^Transaction:\\(.*\\) *\\|"); 

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/CompatibilityTest.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/CompatibilityTest.out?rev=330103&view=auto
==============================================================================
    (empty)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall Tue Nov  1 10:10:31 2005
@@ -19,6 +19,7 @@
 derbynet/testij.java
 derbynet/timeslice.java
 derbynet/testSecMec.java
+jdbcapi/CompatibilityTest.java
 jdbcapi/autoGeneratedJdbc30.java
 jdbcapi/dbMetaDataJdbc30.java
 jdbcapi/metadata.java

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java?rev=330103&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java Tue Nov  1 10:10:31 2005
@@ -0,0 +1,1633 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.compatibility.JDBCDriverTest
+
+   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+/**
+ * <p>
+ * This JUnit test verifies the compatibility of Derby clients and
+ * servers across Derby version levels and supported VMs.
+ * </p>
+ *
+ * @author Rick
+ */
+
+package org.apache.derbyTesting.functionTests.tests.compatibility;
+
+import java.io.*;
+import java.math.*;
+import java.sql.*;
+import java.util.*;
+
+import junit.framework.*;
+
+import org.apache.derbyTesting.functionTests.util.DerbyJUnitTest;
+
+public	class	JDBCDriverTest	extends	DerbyJUnitTest
+{
+	/////////////////////////////////////////////////////////////
+	//
+	//	CONSTANTS
+	//
+	/////////////////////////////////////////////////////////////
+
+	/** If you set this startup property to true, you will get chatty output. */
+	public	static	final			String	DEBUG_FLAG = "drb.tests.debug";
+	
+	public	static	final			int		SUCCESS_EXIT = 0;
+	public	static	final			int		FAILURE_EXIT = 1;
+
+	//
+	// These are properties for the Derby connection URL.
+	//
+	private	static	final			String	VERSION_PROPERTY = "java.version";
+	private	static	final			String	SERVER_URL = "jdbc:derby://localhost:1527/";
+	private	static	final			String	CREATE_PROPERTY = "create=true";
+
+	private	static	final			String	ALL_TYPES_TABLE = "allTypesTable";
+	private	static	final			String	KEY_COLUMN = "keyCol";
+	
+	private	static	final			int		EXPECTED_CLIENT_COUNT = 1;
+
+	//
+	// Indexes into the array of client-specific strings. E.g., DB2JCC_CLIENT,
+	// DERBY_CLIENT, and EMBEDDED_CLIENT.
+	//
+	private	static	final			int		DATABASE_URL = 0;
+	private	static	final			int		DRIVER_NAME = DATABASE_URL + 1;
+
+	//
+	// Data values to be stuffed into columns of ALL_TYPES_TABLE.
+	//
+	private	static	final			byte[]	SAMPLE_BYTES =
+		new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5 };
+	private	static	final			String	SAMPLE_STRING = "hello";
+
+	//
+	// These funny constants are defined this way to make the salient
+	// facts of the COERCIONS table leap out at you.
+	//
+	private	static	final			boolean	Y = true;
+	private	static	final			boolean	_ = false;
+
+	// indexed by DATABASE_URL and DRIVER_NAME
+	private	static	final	String[]	DB2JCC_CLIENT =
+	{
+		"jdbc:derby:net://localhost:1527/",
+		"com.ibm.db2.jcc.DB2Driver"
+	};
+	private	static	final	String[]	DERBY_CLIENT =
+	{
+		"jdbc:derby://localhost:1527/",
+		"org.apache.derby.jdbc.ClientDriver"
+	};
+	private	static	final	String[]	EMBEDDED_CLIENT =
+	{
+		"jdbc:derby:",
+		"org.apache.derby.jdbc.EmbeddedDriver"
+	};
+
+	private	static	final	String[][]	LEGAL_CLIENTS =
+	{
+		DB2JCC_CLIENT,
+		DERBY_CLIENT,
+		EMBEDDED_CLIENT
+	};
+	
+	private	static	final	String	DEFAULT_USER_NAME = "APP";
+	private	static	final	String	DEFAULT_PASSWORD = "APP";
+
+	// Supported versions of the db2jcc client.
+	private	static	final	Version	IBM_2_4 = new Version( 2, 4 );
+
+	// Supported versions of Derby.
+	private	static	final	Version	DRB_10_0 = new Version( 10, 0 );
+	private	static	final	Version	DRB_10_1 = new Version( 10, 1 );
+	private	static	final	Version	DRB_10_2 = new Version( 10, 2 );
+
+	// Supported VM versions.
+	private	static	final	Version	VM_1_3 = new Version( 1, 3 );
+	private	static	final	Version	VM_1_4 = new Version( 1, 4 );
+	private	static	final	Version	VM_1_5 = new Version( 1, 5 );
+
+	//
+	// This table declares the datatypes supported by Derby and the earliest
+	// versions of the Derby and the db2jcc client which support these
+	// datatypes.
+	//
+	// If you add a type to this table, make sure you add a corresponding
+	// column to the following row table. Also add a corresponding row to the
+	// COERCIONS table.
+	//
+	private	static	final	TypeDescriptor[]	ALL_TYPES =
+	{
+		// 10.0 types
+		
+		new TypeDescriptor
+		( Types.BIGINT,			"bigint",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.BLOB,			"blob",							IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.CHAR,			"char(5)",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.BINARY,			"char(5) for bit data",			IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.CLOB,			"clob",							IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.DATE,			"date",							IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.DECIMAL,		"decimal",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.DOUBLE,			"double",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.DOUBLE,			"double precision",				IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.REAL,			"float(23)",					IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.DOUBLE,			"float",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.INTEGER,		"integer",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.LONGVARCHAR,	"long varchar",					IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.LONGVARBINARY,	"long varchar for bit data",	IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.NUMERIC,		"numeric",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.REAL,			"real",							IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.SMALLINT,		"smallint",						IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.TIME,			"time",							IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.TIMESTAMP,		"timestamp",					IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.VARCHAR,		"varchar(5)",					IBM_2_4,	DRB_10_0,	VM_1_3 ),
+		new TypeDescriptor
+		( Types.VARBINARY,		"varchar(5) for bit data",		IBM_2_4,	DRB_10_0,	VM_1_3 ),
+	};
+
+	//
+	// This table needs to have the same number of entries as ALL_TYPES.
+	// The testSanity() test case enforces this at run time.
+	//
+	private	static	final	Object[]	ROW_1 =
+	{
+		new Long( 1L ),
+		new MyBlob( SAMPLE_BYTES ),
+		SAMPLE_STRING,
+		SAMPLE_BYTES,
+		new MyClob( SAMPLE_STRING ),
+		new java.sql.Date( 1L ),
+		new BigDecimal( 1.0 ),
+		new Double( 1.0 ),
+		new Double( 1.0 ),
+		new Float( (float) 1.0 ),
+		new Double( 1.0 ),
+		new Integer( 1 ),
+		SAMPLE_STRING,
+		SAMPLE_BYTES,
+		new BigDecimal( 1.0 ),
+		new Float( (float) 1.0 ),
+		new Short( (short) 1 ),
+		new Time( 1L ),
+		new Timestamp( 1L ),
+		SAMPLE_STRING,
+		SAMPLE_BYTES,
+	};
+
+	//
+	// This table needs to have the same number of rows as ALL_TYPES.
+	// Each row in this table needs to have the same number of columns as
+	// rows in ALL_TYPES. The testSanity() test case enforces this at run time.
+	// Note how the funny synonyms for true and false
+	// make the salient facts of this table leap out at you.
+	//
+	// The ugly class name T_CN is an abbreviation which makes it possible to
+	// squeeze this table onto a readable screen.
+	//
+	// Please read the introductory comment top-to-bottom. 'Y' means a coercion
+	// is legal; '_' means it isn't.
+	//
+	private	static	final	T_CN[]	COERCIONS =
+	{
+		//												  B|B|C|B|C|D|D|D|R|I|L|L|N|R|S|T|T|V|V
+		//												  I|L|H|I|L|A|E|O|E|N|O|O|U|E|M|I|I|A|A
+		//												  G|O|A|N|O|T|C|U|A|T|N|N|M|A|A|M|M|R|R
+		//												  I|B|R|A|B|E|I|B|L|E|G|G|E|L|L|E|E|C|B
+		//												  N|-|-|R|-|-|M|L|-|G|V|V|R|-|L|-|S|H|I
+		//												  T|-|-|Y|-|-|A|E|-|E|A|A|I|-|I|-|T|A|N
+		//												  -|-|-|-|-|-|L|-|-|R|R|R|C|-|N|-|A|R|A
+		//												  -|-|-|-|-|-|-|-|-|-|C|B|-|-|T|-|M|-|R
+		//												  -|-|-|-|-|-|-|-|-|-|H|I|-|-|-|-|P|-|Y
+		//												  -|-|-|-|-|-|-|-|-|-|A|N|-|-|-|-|-|-|-
+		//												  -|-|-|-|-|-|-|-|-|-|R|A|-|-|-|-|-|-|-
+		//												  -|-|-|-|-|-|-|-|-|-|-|R|-|-|-|-|-|-|-
+		//												  -|-|-|-|-|-|-|-|-|-|-|Y|-|-|-|-|-|-|-
+		new T_CN( Types.BIGINT, new boolean[]			{ Y,_,Y,_,_,_,_,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.BLOB, new boolean[] 			{ _,Y,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_, } ),
+		new T_CN( Types.CHAR, new boolean[]				{ _,_,Y,_,_,_,_,_,_,_,Y,_,_,_,_,_,_,Y,_, } ),
+		new T_CN( Types.BINARY, new boolean[]			{ _,_,_,Y,_,_,_,_,_,_,_,Y,_,_,_,_,_,_,Y, } ),
+		new T_CN( Types.CLOB, new boolean[]				{ _,_,_,_,Y,_,_,_,_,_,_,_,_,_,_,_,_,_,_, } ),
+		new T_CN( Types.DATE, new boolean[]				{ _,_,_,_,_,Y,_,_,_,_,_,_,_,_,_,_,_,_,_, } ),
+		new T_CN( Types.DECIMAL, new boolean[]			{ Y,_,_,_,_,_,Y,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.DOUBLE, new boolean[]			{ Y,_,_,_,_,_,Y,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.REAL, new boolean[]				{ Y,_,Y,_,_,_,Y,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.INTEGER, new boolean[]			{ Y,_,Y,_,_,_,Y,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.LONGVARCHAR, new boolean[]		{ _,_,Y,_,_,_,_,_,_,_,Y,_,_,_,_,_,_,Y,_, } ),
+		new T_CN( Types.LONGVARBINARY, new boolean[]	{ _,_,_,_,_,_,_,_,_,_,_,Y,_,_,_,_,_,_,Y, } ),
+		new T_CN( Types.NUMERIC, new boolean[]			{ Y,_,Y,_,_,_,Y,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.REAL, new boolean[]				{ Y,_,Y,_,_,_,Y,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.SMALLINT, new boolean[]			{ Y,_,Y,_,_,_,Y,Y,Y,Y,Y,_,Y,Y,Y,_,_,Y,_, } ),
+		new T_CN( Types.TIME, new boolean[]				{ _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,Y,_,_,_, } ),
+		new T_CN( Types.TIMESTAMP, new boolean[]		{ _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,Y,_,_, } ),
+		new T_CN( Types.VARCHAR, new boolean[]			{ _,_,Y,_,_,_,_,_,_,_,Y,_,_,_,_,_,_,Y,_, } ),
+		new T_CN( Types.VARBINARY, new boolean[]		{ _,_,_,_,_,_,_,_,_,_,_,Y,_,_,_,_,_,_,Y, } ),
+	};
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	STATE
+	//
+	/////////////////////////////////////////////////////////////
+
+	private	static	boolean		_debug;					// if true, we print chatty diagnostics
+	
+	private	static	PrintStream	_outputStream = System.out;	// where to print debug output
+
+	private	static	String[]	_defaultClientSettings;	// one of the clients in LEGAL_CLIENTS
+	private	static	Driver		_driver;				// the corresponding jdbc driver
+	private	static	String		_databaseName;			// sandbox for tests
+	private	static	Version		_clientVMLevel;			// level of client-side vm
+	private	static	Version		_driverLevel;			// client rev level
+	private	static	Version		_serverLevel;			// server rev level
+
+	// map derby type name to type descriptor
+	private	static	HashMap		_types = new HashMap();	// maps Derby type names to TypeDescriptors
+
+	// map jdbc type to index into COERCIONS
+	private	static	HashMap		_coercionIndex = new HashMap();	// maps jdbc types to legal coercions
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	CONSTRUCTOR
+	//
+	/////////////////////////////////////////////////////////////
+	
+	public	JDBCDriverTest() {}
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	JUnit BEHAVIOR
+	//
+	/////////////////////////////////////////////////////////////
+
+	/**
+	 * <p>
+	 * JUnit boilerplate which adds as test cases all public methods
+	 * whose names start with the string "test".
+	 * </p>
+	 */
+	public static Test suite()
+	{ 
+		return new TestSuite( JDBCDriverTest.class ); 
+	}
+
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	ENTRY POINT
+	//
+	/////////////////////////////////////////////////////////////
+
+	/**
+	 * <p>
+	 * Run JDBC compatibility tests using either the specified client or
+	 * the client that is visible
+	 * on the classpath. If there is more than one client on the classpath,
+	 * exits with an error.
+	 * </p>
+	 *
+	 * <ul>
+	 * <li>arg[ 0 ] = required name of database to connect to</li>
+	 * <li>arg[ 1 ] = optional driver to use. if not specified, we'll look for a
+	 *                client on the classpath</li>
+	 * </ul>
+	 */
+	public static void main( String args[] )
+		throws Exception
+	{
+		int			exitStatus = FAILURE_EXIT;
+		
+		if (
+			   parseDebug() &&
+			   parseArgs( args ) &&
+			   parseVMLevel() &&
+			   findClient() &&
+			   findServer()
+		   )
+		{		
+			TestResult	result = junit.textui.TestRunner.run( suite() );
+			
+			exitStatus = result.errorCount() + result.failureCount();
+		}
+
+		Runtime.getRuntime().exit( exitStatus );
+	}
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	TEST ENTRY POINTS
+	//
+	/////////////////////////////////////////////////////////////
+
+	/**
+	 * <p>
+	 * Sanity check the integrity of this test suite.
+	 * </p>
+	 */
+	public	void	testSanity()
+	{
+		assertEquals( "ALL_TYPES.length == ROW_1.length", ALL_TYPES.length, ROW_1.length );
+
+		// make sure there we completely describe the coercibility of every jdbc type
+		int		coercionCount = COERCIONS.length;
+		for ( int i = 0; i < coercionCount; i++ )
+		{ assertEquals( "Coercion " + i, coercionCount, COERCIONS[ i ].getCoercions().length ); }
+	}
+
+	/**
+	 * <p>
+	 * Main test of jdbc drivers.
+	 * </p>
+	 */
+	public	void	testJDBCDriver()
+		throws Exception
+	{
+		Connection		conn = getConnection();
+		
+		dropSchema( conn );
+		createSchema( conn );
+
+		datatypesTest( conn );
+
+		close( conn );
+	}
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	TEST DATATYPES
+	//
+	/////////////////////////////////////////////////////////////
+
+	//
+	// Test that we can declare, insert, and select all datatypes that
+	// are legal on the server. Test the metadata for these datatypes.
+	//
+	private	void	datatypesTest( Connection conn )
+		throws Exception
+	{
+		Object[][]	rows = new Object[][] { makeNullRow(), ROW_1 };
+		
+		checkTypeDBMetadata( conn );
+		stuffAllTypesTable( conn, rows );
+		readAllTypesTable( conn, rows );
+	}
+	
+	//
+	// Verify that we get the correct DatabaseMetaData for all datatypes
+	// that are legal on the server.
+	//
+	private	void	checkTypeDBMetadata( Connection conn )
+		throws Exception
+	{
+		String				normalizedSchema = DEFAULT_USER_NAME.toUpperCase();
+		String				normalizedTable = ALL_TYPES_TABLE.toUpperCase();
+		DatabaseMetaData	dbmd = conn.getMetaData();
+
+		ResultSet			rs = dbmd.getColumns
+			( null, normalizedSchema, normalizedTable, "%" );
+
+		println( "Pawing through metadata for " + normalizedSchema + '.' + normalizedTable );
+		
+		while( rs.next() )
+		{
+			String			columnName = rs.getString( "COLUMN_NAME" );
+			int				actualJdbcType = rs.getInt( "DATA_TYPE" );
+			TypeDescriptor	typeDesc = getType( columnName );
+
+			if ( columnName.equals( KEY_COLUMN ) ) { continue; }
+
+			StringBuffer	buffer = new StringBuffer();
+
+			buffer.append( "[ " );
+			buffer.append( rs.getString( "COLUMN_NAME" ) );
+			buffer.append( ",\t" );
+			buffer.append( "type( " + rs.getInt( "DATA_TYPE" ) + " ),\t" );
+			buffer.append( rs.getString( "TYPE_NAME" ) );
+			buffer.append( " ]" );
+
+			println( buffer.toString() );
+			
+			assertEquals( columnName, typeDesc.getJdbcType(), actualJdbcType );
+		}
+
+		close( rs );
+	}
+
+	//
+	// Verify that we can insert all datatypes that are legal on the
+	// server.
+	//
+	private	void	stuffAllTypesTable( Connection conn, Object[][] rows )
+		throws Exception
+	{
+		StringBuffer	masterBuffer = new StringBuffer();
+		StringBuffer	columnBuffer = new StringBuffer();
+		StringBuffer	valuesBuffer = new StringBuffer();
+		int				columnNumber = 0;
+		int				valuesNumber = 0;
+		int				typeCount = ALL_TYPES.length;
+
+		beginColumnList( columnBuffer );
+		beginColumnList( valuesBuffer );
+
+		addColumn( columnBuffer, columnNumber++, doubleQuote( KEY_COLUMN ) );
+		addColumn( valuesBuffer, valuesNumber++, "?" );
+		
+		for ( int i = 0; i < typeCount; i++ )
+		{
+			TypeDescriptor	type = ALL_TYPES[ i ];
+			
+			if ( _serverLevel.atLeast( type.getDerbyVersion() ) )
+			{
+				String	typeName = type.getDerbyTypeName();
+				String	columnDesc = doubleQuote( typeName );
+				
+				addColumn( columnBuffer, columnNumber++, columnDesc );
+				addColumn( valuesBuffer, valuesNumber++, "?" );
+			}
+		}
+
+		endColumnList( columnBuffer );
+		endColumnList( valuesBuffer );
+
+		masterBuffer.append( "insert into " + ALL_TYPES_TABLE + "\n" );
+		masterBuffer.append( columnBuffer.toString() );
+		masterBuffer.append( "values\n" );
+		masterBuffer.append( valuesBuffer.toString() );
+
+		PreparedStatement	ps = prepare( conn, masterBuffer.toString() );
+		int					rowCount = rows.length;
+
+		for ( int i = 0; i < rowCount; i++ )
+		{
+			setRow( ps, i + 1, rows[ i ] );
+		}
+		
+		close( ps );
+	}
+
+	//
+	// Verify that we can select all datatypes that are legal on the server.
+	//
+	private	void	readAllTypesTable( Connection conn, Object[][] rows )
+		throws Exception
+	{
+		StringBuffer	buffer = new StringBuffer();
+		int				columnNumber = 0;
+		int				typeCount = ALL_TYPES.length;
+
+		buffer.append( "select \n" );
+
+		addColumn( buffer, columnNumber++, doubleQuote( KEY_COLUMN ) );
+		
+		for ( int i = 0; i < typeCount; i++ )
+		{
+			TypeDescriptor	type = ALL_TYPES[ i ];
+			
+			if ( _serverLevel.atLeast( type.getDerbyVersion() ) )
+			{
+				String	typeName = type.getDerbyTypeName();
+				String	columnDesc = doubleQuote( typeName );
+				
+				addColumn( buffer, columnNumber++, columnDesc );
+			}
+		}
+
+		buffer.append( "\nfrom " + ALL_TYPES_TABLE + "\n" );
+		buffer.append( "order by " + doubleQuote( KEY_COLUMN ) );
+
+		PreparedStatement	ps = prepare( conn, buffer.toString() );
+		ResultSet			rs = ps.executeQuery();
+
+		checkRSMD( rs );
+		checkRows( rs, rows );
+		
+		close( rs );
+		close( ps );
+	}
+
+	//
+	// Verify that we get the correct ResultSetMetaData for all datatypes
+	// which are legal on the server.
+	//
+	private	void	checkRSMD( ResultSet rs )
+		throws Exception
+	{
+		ResultSetMetaData	rsmd = rs.getMetaData();
+		int					columnCount = rsmd.getColumnCount();
+		int					firstTastyColumn = 0;
+
+		println( "Column count = " + columnCount );
+		
+		firstTastyColumn++;				// skip uninteresting key column
+
+		for ( int i = firstTastyColumn; i < columnCount; i++ )
+		{
+			int				columnID = i + 1;
+			String			columnName = rsmd.getColumnName( columnID );
+			TypeDescriptor	typeDesc = getType( columnName );
+			int				expectedType = rsmdTypeKludge( typeDesc.getJdbcType() );
+			int				actualType = rsmd.getColumnType( columnID );
+			
+			println( "Checking type of " + columnName );
+
+			assertEquals( columnName, expectedType, actualType );
+		}
+	}
+
+	//
+	// Verify that we select the values we
+	// originally inserted into a table.
+	//
+	private	void	checkRows( ResultSet rs, Object[][] rows )
+		throws Exception
+	{
+		int					rowCount = rows.length;
+
+		for ( int i = 0; i < rowCount; i++ )
+		{
+			rs.next();
+			checkRow( rs, rows[ i ] );
+		}
+	}
+
+	//
+	// Verify that we select the values we
+	// originally inserted into a row.
+	//
+	private	void	checkRow( ResultSet rs, Object[] row )
+		throws Exception
+	{
+		int				typeCount = ALL_TYPES.length;
+
+		for ( int i = 0; i < typeCount; i++ )
+		{
+			TypeDescriptor	type = ALL_TYPES[ i ];
+			
+			if ( _serverLevel.atLeast( type.getDerbyVersion() ) )
+			{
+				String	columnName = type.getDerbyTypeName();
+				Object	expectedValue = row[ i ];
+				Object	actualValue = getColumn( rs, columnName, type );
+
+				println( "Comparing column " + columnName + ": " + expectedValue + " to " + actualValue );
+				compareObjects( columnName, expectedValue, actualValue );
+
+				checkCoercions( rs, columnName, type );
+			}
+		}
+	}
+
+	//
+	// Verify all legal jdbc coercions of a data value.
+	//
+	private	void	checkCoercions( ResultSet rs, String columnName, TypeDescriptor type )
+		throws Exception
+	{
+		T_CN		coercionDesc = COERCIONS[ getCoercionIndex( type.getJdbcType() ) ];
+		boolean[]	coercions = coercionDesc.getCoercions();
+		int			count = coercions.length;
+		int			legalCoercions = 0;
+
+		println( "Checking coercions for " + columnName );
+		
+		for ( int i = 0; i < count; i++ )
+		{
+			if ( coercions[ i ] )
+			{
+				legalCoercions++;
+				
+				Object	retval = getColumn( rs, columnName, COERCIONS[ i ].getJdbcType() );
+			}
+		}
+
+		println( "   Checked " + legalCoercions + " coercions for " + columnName );
+	}
+	
+	//
+	// This kludge compensates for the fact that the DRDA clients report
+	// that NUMERIC columns are DECIMAL. See bug 584.
+	//
+	private	int	rsmdTypeKludge( int originalJDbcType )
+	{
+		// The embedded client does the right thing.
+		if ( _defaultClientSettings == EMBEDDED_CLIENT ) { return originalJDbcType; }
+		
+		switch( originalJDbcType )
+		{
+			case Types.NUMERIC:	return Types.DECIMAL;
+
+		    default:			return originalJDbcType;
+		}
+	}
+
+	//
+	// Insert a row into the ALL_TYPES table. The row contains all datatypes
+	// that are legal on the server.
+	//
+	private	void	setRow( PreparedStatement ps, int keyValue, Object[] row )
+		throws Exception
+	{
+		int				param = 1;
+		int				typeCount = ALL_TYPES.length;
+
+		ps.setInt( param++, keyValue );
+
+		for ( int i = 0; i < typeCount; i++ )
+		{
+			TypeDescriptor	type = ALL_TYPES[ i ];
+			Object			value = row[ i ];
+			
+			if ( _serverLevel.atLeast( type.getDerbyVersion() ) )
+			{
+				setParameter( ps, param++, type, value );
+			}
+		}
+
+		ps.execute();
+	}
+
+	private	Object[]	makeNullRow()
+	{
+		return new Object[ ALL_TYPES.length ];
+	}
+
+	//
+	// Index the TypeDescriptors by Derby type name.
+	//
+	private	void	buildTypeMap()
+	{
+		int				typeCount = ALL_TYPES.length;
+
+		for ( int i = 0; i < typeCount; i++ ) { putType( ALL_TYPES[ i ] ); }
+	}
+	private	void	putType( TypeDescriptor type )
+	{
+		_types.put( type.getDerbyTypeName(), type );
+	}
+
+	//
+	// Lookup TypeDescriptors by Derby tgype name.
+	//
+	private	TypeDescriptor	getType( String typeName )
+	{
+		if ( _types.size() == 0 ) { buildTypeMap(); }
+		
+		return (TypeDescriptor) _types.get( typeName );
+	}
+
+	//
+	// Index legal coercions by jdbc type.
+	//
+	private	void	buildCoercionMap()
+	{
+		int				count = COERCIONS.length;
+
+		for ( int i = 0; i < count; i++ ) { putCoercionIndex( i ); }
+	}
+	private	void	putCoercionIndex( int index )
+	{
+		_coercionIndex.put( new Integer( COERCIONS[ index ].getJdbcType() ), new Integer( index ) );
+	}
+
+	//
+	// Lookup the legal coercions for a given jdbc type.
+	//
+	private	int	getCoercionIndex( int jdbcType )
+	{
+		if ( _coercionIndex.size() == 0 ) { buildCoercionMap(); }
+		
+		return ((Integer) _coercionIndex.get( new Integer( jdbcType ) )).intValue();
+	}
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	MINIONS
+	//
+	/////////////////////////////////////////////////////////////
+	
+	///////////////////
+	//
+	//	TYPE MANAGEMENT
+	//
+	///////////////////
+	
+	//////////////////
+	//
+	//	SCHEMA MINIONS
+	//
+	//////////////////
+
+	//
+	// Create all the tables needed by our test cases.
+	//
+	private	void	createSchema( Connection conn )
+		throws Exception
+	{
+		createAllTypesTable( conn );
+	}
+
+	//
+	// Create the table for testing legal datatypes.
+	//
+	private	void	createAllTypesTable( Connection conn )
+		throws Exception
+	{
+		StringBuffer	buffer = new StringBuffer();
+		int				columnNumber = 0;
+		int				typeCount = ALL_TYPES.length;
+
+		buffer.append( "create table " + ALL_TYPES_TABLE + "\n" );
+		beginColumnList( buffer );
+
+		addColumn( buffer, columnNumber++, doubleQuote( KEY_COLUMN ) + "\tint" );
+		
+		for ( int i = 0; i < typeCount; i++ )
+		{
+			TypeDescriptor	type = ALL_TYPES[ i ];
+			
+			if ( _serverLevel.atLeast( type.getDerbyVersion() ) )
+			{
+				String	typeName = type.getDerbyTypeName();
+				String	columnDesc = doubleQuote( typeName ) + '\t' + typeName;
+				
+				addColumn( buffer, columnNumber++, columnDesc );
+			}
+		}
+
+		endColumnList( buffer );
+
+		PreparedStatement	ps = prepare( conn, buffer.toString() );
+
+		ps.execute();
+
+		close( ps );
+	}
+
+	//
+	// Helper methods for declaring a table.
+	//
+	private	void	beginColumnList( StringBuffer buffer )
+	{
+		buffer.append( "(\n" );
+	}
+	private	void	endColumnList( StringBuffer buffer )
+	{
+		buffer.append( "\n)\n" );
+	}
+	private	void	addColumn( StringBuffer buffer, int columnNumber, String text  )
+	{
+		if ( columnNumber > 0 ) { buffer.append( "," ); }
+
+		buffer.append( "\n\t" );
+		buffer.append( text );
+	}
+	
+	//
+	// Drop the tables used by our test cases.
+	//
+	private	void	dropSchema( Connection conn )
+	{
+		dropTable( conn, ALL_TYPES_TABLE );
+	}
+	private	void	dropTable( Connection conn, String tableName )
+	{
+		PreparedStatement	ps = null;
+		
+		try {
+			ps = prepare( conn, "drop table " + tableName );
+
+			ps.execute();
+		}
+		catch (SQLException e) {}
+
+		close( ps );
+	}
+
+	///////////////
+	//
+	//	SQL MINIONS
+	//
+	///////////////
+
+	/**
+	 * <p>
+	 * Create an empty database.
+	 * </p>
+	 */
+	public	void	createDB( String databaseName )
+		throws Exception
+	{
+		String[]	clientSettings = _defaultClientSettings;
+		String		dbURL = makeDatabaseURL( clientSettings, databaseName );
+
+		dbURL = dbURL + ';' + CREATE_PROPERTY;
+
+		Properties	properties = new Properties();
+
+		properties.put( "user", DEFAULT_USER_NAME );
+		properties.put( "password", DEFAULT_PASSWORD );
+
+		faultInDriver( clientSettings );
+
+		Connection		conn = DriverManager.getConnection( dbURL, properties );
+
+		conn.close();
+	}
+
+	// Get a connection to the server.
+	private	static	Connection	getConnection()
+		throws Exception
+	{
+		return getConnection( _defaultClientSettings, _databaseName, new Properties() );
+	}
+	private	static	Connection	getConnection
+	(
+	    String[]	clientSettings,
+		String		databaseName,
+		Properties	properties
+	)
+		throws Exception
+	{
+		faultInDriver( clientSettings );
+
+		properties.put( "user", DEFAULT_USER_NAME );
+		properties.put( "password", DEFAULT_PASSWORD );
+		properties.put( "retreiveMessagesFromServerOnGetMessage", "true" );
+
+		Connection		conn = DriverManager.getConnection
+			( makeDatabaseURL( clientSettings, databaseName ), properties );
+
+		println( "Connection is a " + conn.getClass().getName() );
+		
+		return conn;
+	}
+
+	// Build the connection URL.
+	private	static	String	makeDatabaseURL( String[] clientSettings, String databaseName )
+	{
+		return clientSettings[ DATABASE_URL ] + databaseName;
+	}
+
+	//
+	// Thin wrapper around jdbc layer to support debugging.
+	//
+	private	PreparedStatement	prepare( Connection conn, String text )
+		throws SQLException
+	{
+		println( "Preparing: " + text );
+
+		return conn.prepareStatement( text );
+	}
+
+	//
+	// Logic for stuffing a data value into a column, given its type.
+	//
+	private	void	setParameter( PreparedStatement ps, int param, TypeDescriptor type, Object value )
+		throws Exception
+	{
+		int		jdbcType = type.getJdbcType();
+
+		if ( value == null )
+		{
+			ps.setNull( param, jdbcType );
+
+			return;
+		}
+
+		switch( jdbcType )
+		{
+		    case Types.BIGINT:
+				ps.setLong( param, ((Long) value ).longValue() );
+				break;
+				
+		    case Types.BLOB:
+				ps.setBlob( param, ((Blob) value ) );
+				break;
+				
+		    case Types.CHAR:
+		    case Types.LONGVARCHAR:
+		    case Types.VARCHAR:
+				ps.setString( param, ((String) value ) );
+				break;
+				
+		    case Types.BINARY:
+		    case Types.LONGVARBINARY:
+		    case Types.VARBINARY:
+				ps.setBytes( param, (byte[]) value );
+				break;
+				
+		    case Types.CLOB:
+				ps.setClob( param, ((Clob) value ) );
+				break;
+				
+		    case Types.DATE:
+				ps.setDate( param, ((java.sql.Date) value ) );
+				break;
+				
+		    case Types.DECIMAL:
+		    case Types.NUMERIC:
+				ps.setBigDecimal( param, ((BigDecimal) value ) );
+				break;
+				
+		    case Types.DOUBLE:
+				ps.setDouble( param, ((Double) value ).doubleValue() );
+				break;
+				
+		    case Types.REAL:
+				ps.setFloat( param, ((Float) value ).floatValue() );
+				break;
+				
+		    case Types.INTEGER:
+				ps.setInt( param, ((Integer) value ).intValue() );
+				break;
+				
+		    case Types.SMALLINT:
+				ps.setShort( param, ((Short) value ).shortValue() );
+				break;
+				
+		    case Types.TIME:
+				ps.setTime( param, (Time) value );
+				break;
+				
+		    case Types.TIMESTAMP:
+				ps.setTimestamp( param, (Timestamp) value );
+				break;
+				
+		    default:
+				fail( "Unknown jdbc type for Derby type: " + type.getDerbyTypeName() );
+				break;
+		}
+	}
+	
+	//
+	// Get a data value from a column, given its type.
+	//
+	private	Object	getColumn( ResultSet rs, String columnName, TypeDescriptor type )
+		throws Exception
+	{
+		int			jdbcType = type.getJdbcType();
+
+		return getColumn( rs, columnName, jdbcType );
+	}
+	private	Object	getColumn( ResultSet rs, String columnName, int jdbcType )
+		throws Exception
+	{
+		Object		retval = null;
+
+		switch( jdbcType )
+		{
+		    case Types.BIGINT:
+				retval = new Long( rs.getLong( columnName ) );
+				break;
+				
+		    case Types.BLOB:
+				retval = rs.getBlob( columnName );
+				break;
+				
+		    case Types.CHAR:
+		    case Types.LONGVARCHAR:
+		    case Types.VARCHAR:
+				retval = rs.getString( columnName );
+				break;
+				
+		    case Types.BINARY:
+		    case Types.LONGVARBINARY:
+		    case Types.VARBINARY:
+				retval = rs.getBytes( columnName );
+				break;
+				
+		    case Types.CLOB:
+				retval = rs.getClob( columnName );
+				break;
+				
+		    case Types.DATE:
+				retval = rs.getDate( columnName );
+				break;
+				
+		    case Types.DECIMAL:
+		    case Types.NUMERIC:
+				retval = rs.getBigDecimal( columnName );
+				break;
+				
+		    case Types.DOUBLE:
+				retval = new Double( rs.getDouble( columnName ) );
+				break;
+				
+		    case Types.REAL:
+				retval = new Float( rs.getFloat( columnName ) );
+				break;
+				
+		    case Types.INTEGER:
+				retval = new Integer( rs.getInt( columnName ) );
+				break;
+				
+		    case Types.SMALLINT:
+				retval = new Short( rs.getShort( columnName ) );
+				break;
+				
+		    case Types.TIME:
+				retval = rs.getTime( columnName );
+				break;
+				
+		    case Types.TIMESTAMP:
+				retval = rs.getTimestamp( columnName );
+				break;
+				
+		    default:
+				fail( "Unknown jdbc type " + jdbcType + " used to retrieve column: " + columnName );
+				break;
+		}
+
+		if ( rs.wasNull() ) { retval = null; }
+
+		return retval;
+	}
+
+	//
+	// SQL code generation minions 
+	//
+	private	String	doubleQuote( String text )
+	{
+		return '"' + text + '"';
+	}
+
+	//
+	// Swallow uninteresting exceptions when disposing of jdbc objects.
+	//
+	private	void	close( ResultSet rs )
+	{
+		try {
+			if ( rs != null ) { rs.close(); }
+		}
+		catch (SQLException e) {}
+	}	
+	private	void	close( Statement statement )
+	{
+		try {
+			if ( statement != null ) { statement.close(); }
+		}
+		catch (SQLException e) {}
+	}
+	private	void	close( Connection conn )
+	{
+		try {
+			if ( conn != null ) { conn.close(); }
+		}
+		catch (SQLException e) {}
+	}
+
+	///////////////////
+	//
+	//	GENERAL MINIONS
+	//
+	///////////////////
+	
+	// Debug code to print chatty informational messages.
+	private	static	void	println( String text )
+	{
+		if ( _debug )
+		{
+			_outputStream.println( text );
+			_outputStream.flush();
+		}
+	}
+
+	// Print out a stack trace
+	private	static	void	printStackTrace( Throwable t )
+	{
+		while ( t != null )
+		{
+			t.printStackTrace( _outputStream );
+
+			if ( t instanceof SQLException )	{ t = ((SQLException) t).getNextException(); }
+			else { break; }
+		}
+	}
+
+	//
+	// Return a meaningful exit status so that calling scripts can take
+	// evasive action.
+	//
+	private	void	exit( int exitStatus )
+	{
+		Runtime.getRuntime().exit( exitStatus );
+	}
+
+	//////////////////////////
+	//
+	//	INITIALIZATION MINIONS
+	//
+	//////////////////////////
+	
+	//
+	// Initialize client settings based on the client found.
+	// Return true if one and only one client found, false otherwise.
+	// We allow for the special case when we're running the embedded client
+	// off the current compiled class tree rather than off product jars.
+	//
+	private	static	boolean	findClient()
+		throws Exception
+	{
+		//
+		// The client may have been specified on the command line.
+		// In that case, we don't bother looking for a client on
+		// the classpath.
+		//
+		if ( _defaultClientSettings != null ) { faultInDriver( _defaultClientSettings ); }
+		else
+		{
+			String	currentClientName = null;
+			int		legalCount = LEGAL_CLIENTS.length;
+			int		foundCount = 0;
+
+			for ( int i = 0; i < legalCount; i++ )
+			{
+				String[]	candidate = LEGAL_CLIENTS[ i ];
+
+				if ( faultInDriver( candidate ) )
+				{
+					_defaultClientSettings = candidate;
+					foundCount++;
+				}
+			}
+
+			if ( foundCount != EXPECTED_CLIENT_COUNT )
+			{
+				throw new Exception( "Wrong number of drivers: " + foundCount );
+			}
+		}
+
+		// Now make sure that the JDBC driver is what we expect
+
+		try {
+			_driver = DriverManager.getDriver( _defaultClientSettings[ DATABASE_URL ] );
+			_driverLevel = new Version( _driver.getMajorVersion(), _driver.getMinorVersion() );
+		}
+		catch (SQLException e)
+		{
+			printStackTrace( e );
+			
+			throw new Exception
+				( "Driver doesn't understand expected URL: " + _defaultClientSettings[ DATABASE_URL ] );
+		}
+
+		println
+			(
+			    "Driver " + _driver.getClass().getName() +
+				" Version = " + _driverLevel
+			);
+		
+		return true;
+	}
+
+	//
+	// Initialize server settings. Assumes that you have called
+	// findClient().
+	//
+	private	static	boolean	findServer()
+		throws Exception
+	{
+		try {
+			Connection			conn = getConnection();
+			DatabaseMetaData	dmd = conn.getMetaData();
+			String				dbProductVersion = dmd.getDatabaseProductVersion();
+
+			_serverLevel = new Version( dbProductVersion );
+		}
+		catch (Exception e)
+		{
+			printStackTrace( e );
+			
+			throw new Exception( "Error lookup up server info: " + e.getMessage() );
+		}
+		
+		println( "Server Version = " + _serverLevel );
+
+		return true;
+	}
+
+	private	static	boolean	faultInDriver( String[] clientSettings )
+	{
+		String	currentClientName = clientSettings[ DRIVER_NAME ];
+		
+		try {
+			Class.forName( currentClientName );
+
+			return true;
+		}
+		catch (Exception e)
+		{
+			println( "Could not find " + currentClientName );
+			return false;
+		}
+	}
+
+	private	static	boolean	parseDebug()
+	{
+		_debug = Boolean.getBoolean( DEBUG_FLAG );
+
+		return true;
+	}
+		
+	private	static	boolean	parseVMLevel()
+		throws Exception
+	{
+		String				vmVersion = System.getProperty( VERSION_PROPERTY );
+
+		try {
+			_clientVMLevel = new Version( vmVersion );
+		}
+		catch (NumberFormatException e)
+		{
+			throw new Exception( "Badly formatted vm version: " + vmVersion );
+		}
+
+		println( "VM Version = " + _clientVMLevel );
+
+		return true;
+	}
+
+	private	static	boolean	parseArgs( String args[] )
+		throws Exception
+	{
+		if ( ( args == null ) || (args.length == 0 ) )
+		{ throw new Exception( "Missing database name." ); }
+		
+		_databaseName = args[ 0 ];
+
+		if ( (args.length > 1) && !"".equals( args[ 1 ] ) )
+		{
+			String	desiredClientName = args[ 1 ];
+			int		count = LEGAL_CLIENTS.length;
+
+			for ( int i = 0; i < count; i++ )
+			{
+				String[]	candidate = LEGAL_CLIENTS[ i ];
+
+				if ( desiredClientName.equals( candidate[ DRIVER_NAME ] ) )
+				{
+					_defaultClientSettings = candidate;
+					break;
+				}
+			}
+
+			if ( _defaultClientSettings == null )
+			{
+				throw new Exception
+					( "Could not find client " + desiredClientName + " on the classpath." );
+			}
+		}
+			
+		return true;
+	}
+
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	INNER CLASSES
+	//
+	/////////////////////////////////////////////////////////////
+
+	/**
+	 * <p>
+	 * This helper class exposes an entry point for creating an empty database.
+	 * </p>
+	 */
+	public	static	final	class	Creator
+	{
+		private	static	JDBCDriverTest	_driver = new JDBCDriverTest();
+		
+		/**
+		 * <p>
+		 * Wait for server to come up, then create the database.
+		 * </p>
+		 *
+		 * <ul>
+		 * <li>args[ 0 ] = name of database to create.</li>
+		 * </ul>
+		 */
+		public	static	void	main( String[] args )
+			throws Exception
+		{
+			String		databaseName = args[ 0 ];
+
+			JDBCDriverTest.findClient();
+			
+			_driver.createDB( databaseName );
+		}
+		
+	}
+
+	/**
+	 * <p>
+	 * A class for storing a major and minor version number. This class
+	 * assumes that more capable versions compare greater than less capable versions.
+	 * </p>
+	 */
+	public	static	final	class	Version	implements	Comparable
+	{
+		private	int	_major;
+		private	int	_minor;
+
+		public	Version( int major, int minor )
+		{
+			constructorMinion( major, minor );
+		}
+
+		public	Version( String desc )
+			throws NumberFormatException
+		{
+			StringTokenizer		tokens = new StringTokenizer( desc, "." );
+
+			constructorMinion
+				(
+				    java.lang.Integer.parseInt( tokens.nextToken() ),
+					java.lang.Integer.parseInt( tokens.nextToken() )
+				);
+		}
+
+		private	void	constructorMinion( int major, int minor )
+		{
+			_major = major;
+			_minor = minor;
+		}
+
+		/**
+		 * <p>
+		 * Returns true if this Version is at least as advanced
+		 * as that Version.
+		 * </p>
+		 */
+		public	boolean	atLeast( Version that )
+		{
+			return this.compareTo( that ) > -1;
+		}
+
+
+		////////////////////////////////////////////////////////
+		//
+		//	Comparable BEHAVIOR
+		//
+		////////////////////////////////////////////////////////
+
+		public	int	compareTo( Object other )
+		{
+			if ( other == null ) { return -1; }
+			if ( !( other instanceof Version ) ) { return -1; }
+
+			Version	that = (Version) other;
+
+			if ( this._major < that._major ) { return -1; }
+			if ( this._major > that._major ) { return 1; }
+
+			return this._minor - that._minor;
+		}
+
+		////////////////////////////////////////////////////////
+		//
+		//	Object OVERLOADS
+		//
+		////////////////////////////////////////////////////////
+		
+		public	String	toString()
+		{
+			return Integer.toString( _major ) + '.' + Integer.toString( _minor );
+		}
+
+		public	boolean	equals( Object other )
+		{
+			return (compareTo( other ) == 0);
+		}
+
+		public	int	hashCode()
+		{
+			return _major ^ _minor;
+		}
+		
+	}
+
+	/**
+	 * <p>
+	 * This helper class describes a legal datatype and the version of Derby
+	 * and db2jcc where the datatype first appears.
+	 * </p>
+	 */
+	public	static	final	class	TypeDescriptor
+	{
+		private	int		_jdbcType;
+		private	String	_derbyTypeName;
+		private	Version	_db2jccVersion;		// first db2jcc version which supports this type
+		private	Version	_derbyVersion;		// first derby version which supports this type
+		private	Version	_vmVersion;			// first vm (jdbc) version which supports this type
+
+		public	TypeDescriptor
+		(
+		    int		jdbcType,
+			String	derbyTypeName,
+			Version	db2jccVersion,
+			Version	derbyVersion,
+			Version	vmVersion
+		)
+		{
+			_jdbcType = jdbcType;
+			_derbyTypeName = derbyTypeName;
+			_db2jccVersion = db2jccVersion;
+			_derbyVersion = derbyVersion;
+			_vmVersion = vmVersion;
+		}
+
+		public	int		getJdbcType() 					{ return _jdbcType; }
+		public	String	getDerbyTypeName()				{ return _derbyTypeName; }
+		public	Version	getDb2jccVersion()				{ return _db2jccVersion; }
+		public	Version	getDerbyVersion()				{ return _derbyVersion; }
+		public	Version	getVMVersion()					{ return _vmVersion; }
+	}
+
+	/**
+	 * <p>
+	 * This helper class captures TypeCoercion logic. I have abbreviated it to
+	 * this ugly class name so that the COERCIONS table will fit on a readable screen.
+	 * </p>
+	 */
+	public	static	final	class	T_CN
+	{
+		private	int			_jdbcType;
+		private	boolean[]	_coercions;
+
+		public	T_CN( int jdbcType, boolean[] coercions )
+		{
+			_jdbcType = jdbcType;
+			_coercions = coercions;
+		}
+
+		public	int			getJdbcType() 					{ return _jdbcType; }
+		public	boolean[]	getCoercions() 					{ return _coercions; }
+	}
+	
+	/**
+	 * <p>
+	 * A crude Blob implementation for datatype testing.
+	 * </p>
+	 */
+	public	static	final	class	MyBlob	implements	Blob
+	{
+		private	byte[]	_bytes;
+
+		public	MyBlob( byte[] bytes )
+		{
+			_bytes = bytes;
+		}
+
+		public	InputStream	getBinaryStream()
+		{
+			return new ByteArrayInputStream( _bytes );
+		}
+
+		public	byte[]	getBytes( long position, int length ) { return _bytes; }
+
+		public	long	length() { return (long) _bytes.length; }
+
+		public	long	position( Blob pattern, long start ) { return 0L; }
+		public	long	position( byte[] pattern, long start ) { return 0L; }
+
+		public	boolean	equals( Object other )
+		{
+			if ( other == null ) { return false; }
+			if ( !( other instanceof Blob ) ) { return false; }
+
+			Blob	that = (Blob) other;
+
+			try {
+				if ( this.length() != that.length() ) { return false; }
+
+				InputStream	thisStream = this.getBinaryStream();
+				InputStream	thatStream = that.getBinaryStream();
+
+				while( true )
+				{
+					int		nextByte = thisStream.read();
+
+					if ( nextByte < 0 ) { break; }
+					if ( nextByte != thatStream.read() ) { return false; }
+				}
+			}
+			catch (Exception e)
+			{
+				System.err.println( e.getMessage() );
+				e.printStackTrace();
+				return false;
+			}
+
+			return true;
+		}
+
+	}
+
+	/**
+	 * <p>
+	 * A crude Clob implementation for datatype testing.
+	 * </p>
+	 */
+	public	static	final	class	MyClob	implements	Clob
+	{
+		private	String	_contents;
+
+		public	MyClob( String contents )
+		{
+			_contents = contents;
+		}
+
+		public	InputStream	getAsciiStream()
+		{
+			try {
+				return new ByteArrayInputStream( _contents.getBytes( "UTF-8" ) );
+			}
+			catch (Exception e) { return null; }
+		}
+
+		public	Reader	getCharacterStream()
+		{
+			return new CharArrayReader( _contents.toCharArray() );
+		}
+
+		public	String	getSubString( long position, int length )
+		{
+			return _contents.substring( (int) position, length );
+		}
+		
+		public	long	length() { return (long) _contents.length(); }
+
+		public	long	position( Clob searchstr, long start ) { return 0L; }
+		public	long	position( String searchstr, long start ) { return 0L; }
+
+		public	boolean	equals( Object other )
+		{
+			if ( other == null ) { return false; }
+			if ( !( other instanceof Clob ) ) { return false; }
+
+			Clob	that = (Clob) other;
+
+			try {
+				if ( this.length() != that.length() ) { return false; }
+			
+				InputStream	thisStream = this.getAsciiStream();
+				InputStream	thatStream = that.getAsciiStream();
+
+				while( true )
+				{
+					int		nextByte = thisStream.read();
+
+					if ( nextByte < 0 ) { break; }
+					if ( nextByte != thatStream.read() ) { return false; }
+				}
+			}
+			catch (Exception e)
+			{
+				System.err.println( e.getMessage() );
+				e.printStackTrace();
+				return false;
+			}
+
+			return true;
+		}
+
+	}
+
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/Pinger.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/Pinger.java?rev=330103&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/Pinger.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/Pinger.java Tue Nov  1 10:10:31 2005
@@ -0,0 +1,131 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.compatibility.JDBCDriverTest
+
+   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+/**
+ * <p>
+ * Ping the server, waiting till it comes up.
+ * </p>
+ *
+ * @author Rick
+ */
+package org.apache.derbyTesting.functionTests.tests.compatibility;
+
+import org.apache.derby.drda.NetworkServerControl;
+
+public	class	Pinger
+{
+	/////////////////////////////////////////////////////////////
+	//
+	//	CONSTANTS
+	//
+	/////////////////////////////////////////////////////////////
+
+	public	static	final			long	SLEEP_TIME_MILLIS = 5000L;
+
+	public	static	final			int		SUCCESS_EXIT = 0;
+	public	static	final			int		FAILURE_EXIT = 1;
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	STATE
+	//
+	/////////////////////////////////////////////////////////////
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	CONSTRUCTOR
+	//
+	/////////////////////////////////////////////////////////////
+	
+	public	Pinger() {}
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	ENTRY POINT
+	//
+	/////////////////////////////////////////////////////////////
+	
+	public	static	void	main( String[] args )
+		throws Exception
+	{
+		Pinger	me = new Pinger();
+		
+		me.ping( 5 );
+	}	
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	MINIONS
+	//
+	/////////////////////////////////////////////////////////////
+	
+	private	void	println( String text )
+	{
+		System.err.println( text );
+		System.err.flush();
+	}
+
+	private	void	exit( int exitStatus )
+	{
+		Runtime.getRuntime().exit( exitStatus );
+	}
+
+	/////////////////////
+	//
+	//	SERVER MANAGEMENT
+	//
+	/////////////////////
+
+	/**
+	 * <p>
+	 * Checks to see that the server is up. If the server doesn't
+	 * come up in a reasonable amount of time, brings down the VM.
+	 * </p>
+	 */
+	public	void	ping( int iterations )
+		throws Exception
+	{
+		ping( new NetworkServerControl(), iterations );
+	}
+
+
+	private	void	ping( NetworkServerControl controller, int iterations )
+		throws Exception
+	{
+		Exception	finalException = null;
+		
+		for ( int i = 0; i < iterations; i++ )
+		{
+			try {
+				controller.ping();
+
+				return;
+			}
+			catch (Exception e) { finalException = e; }
+			
+			Thread.sleep( SLEEP_TIME_MILLIS );
+		}
+
+		println( "Server did not come up: " + finalException.getMessage() );
+		exit( FAILURE_EXIT );
+	}
+
+
+}
+

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/Pinger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/README.html
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/README.html?rev=330103&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/README.html (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/README.html Tue Nov  1 10:10:31 2005
@@ -0,0 +1,160 @@
+<html>
+<title>Derby Compatibility Tests</title>
+<body>
+
+<center><h1>Derby Compatibility Tests</h1></center>
+
+<TABLE border="2">
+  <TBODY>
+
+    <TR>
+      <TD><b>Revision</b></TD>
+      <TD><b>Author</b></TD>
+      <TD><b>Date</b></TD>
+      <TD><b>Comment</b></TD>
+    </TR>
+
+    <TR>
+      <TD>1.0</TD>
+      <TD>Rick Hillegas</TD>
+      <TD>06 September 2005</TD>
+      <TD>First cut.</TD>
+    </TR>
+
+  </TBODY>
+</TABLE>
+
+<ul>
+  <li><a href="#Overview">Overview</a></li>
+  <li><a href="#Test Setup">Test Setup</a></li>
+  <li><a href="#Running the Tests">Running the Tests</a></li>
+  <li><a href="#Analyzing Failures">Analyzing Failures</a></li>
+</ul>
+
+<h2><a name="Overview">Overview</a></h2>
+
+<p>
+This web page describes how to setup and run the Derby Compatibility
+Tests. These tests stress the compatibility of Derby clients and
+servers running at different rev levels and on different VMs. We
+currently test the following combinations:
+</p>
+
+<blockquote>
+
+<h3><a name="Clients">Clients</a></h2>
+
+<TABLE border="2">
+  <TBODY>
+
+    <TR><TD>Derby 10.1</TD></TR>
+    <TR><TD>Derby 10.2</TD></TR>
+    <TR><TD>DB2JCC 2.4</TD></TR>
+
+  </TBODY>
+</TABLE>
+
+<h3><a name="Servers">Servers</a></h2>
+
+<TABLE border="2">
+  <TBODY>
+
+    <TR><TD>Derby 10.1</TD></TR>
+    <TR><TD>Derby 10.2</TD></TR>
+
+  </TBODY>
+</TABLE>
+
+<h3><a name="VMs">VMs</a></h2>
+
+<TABLE border="2">
+  <TBODY>
+
+    <TR><TD>jdk1.3</TD></TR>
+    <TR><TD>jdk1.4</TD></TR>
+    <TR><TD>jdk1.5</TD></TR>
+
+  </TBODY>
+</TABLE>
+
+</blockquote>
+
+<h2><a name="Test Setup">Test Setup</a></h2>
+
+<p>
+To run these tests, you will need to download various VMs and Derby
+releases. You will also need to edit ant.properties in your home
+directory, adding variables which point at these VMs and releases. For
+a complete description of this setup, run the following command,
+invoking testScript.xml (which lives in the same directory as this web page):
+</p>
+
+<blockquote><pre>
+ant -buildfile testScript.xml -projecthelp
+</pre></blockquote>
+
+<h2><a name="Running the Tests">Running the Tests</a></h2>
+
+<p>
+To run the tests, you will need to do the following:
+</p>
+
+<ul>
+<li><b>mkdir</b> - Create a directory to hold the test output.</li>
+<li><b>ant</b> - Run ant against the compatibility test script.</li>
+</ul>
+
+<p>
+Something like the following should work:
+</p>
+
+<blockquote><pre>
+#! /usr/bin/bash
+#
+# Run the compatibility tests.
+#
+# $1    directory to hold output, e.g., c:/cygwin/home/aliceBToklas/derby/mainline/testRun
+# $2    location of derby trunk, e.g., c:/cygwin/home/aliceBToklas/derby/mainline/testRun/trunk
+
+outDir=$1
+trunkDir=$2
+COMPAT_DIR=$trunkDir/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility
+
+rm -rf $outDir
+mkdir $outDir
+
+ant -buildfile $COMPAT_DIR/testScript.xml -DoutDir=$outDir
+</pre></blockquote>
+
+<p>
+When the tests startup, they defensively bring down the Derby network
+server in case it was running. Generally, it won't be, and you can
+expect to see a couple vacuous diagnostics, which you may ignore:
+</p>
+
+<blockquote><pre>
+_stopServer:
+     [exec] Could not connect to Derby Network Server on host localhost, port 1527.
+     [exec] Result: 1
+</pre></blockquote>
+
+<h2><a name="Analyzing Failures">Analyzing Failures</a></h2>
+
+<p>
+If the tests succeed, ant will happily report:
+</p>
+
+<blockquote><pre>
+BUILD SUCCESSFUL
+</pre></blockquote>
+
+<p>
+Otherwise, ant will report a failure. In this case, the output
+directory will hold a file called SUMMARY_COMPAT.txt. This file will
+identify which test run failed. More specifically, SUMMARY_COMPAT.txt
+will hold the name of an output file which describes the specific test failures.
+</p>
+
+
+</body>
+</html>

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/README.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/build.xml?rev=330103&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/build.xml (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/build.xml Tue Nov  1 10:10:31 2005
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+
+<!-- ==================================================================== -->
+<!--                       Derby build file                          -->
+<!-- ==================================================================== -->
+
+<project default="FTOtestsubdir" basedir="../../../../../../../.." >
+
+  <!-- User settings -->
+  <property file="${user.home}/ant.properties"/>
+
+  <!-- Set property lib dir -->
+  <property name="properties.dir" value="tools/ant/properties" />
+
+  <!-- Significant dirs -->
+  <property file="${properties.dir}/dirs.properties"/>
+  <property file="${properties.dir}/derbytesting.properties"/>
+
+  <!-- Compiler settings -->
+  <property file="${properties.dir}/sane${sanity}.properties"/>
+  <property file="${properties.dir}/defaultcompiler.properties"/>
+  <property file="${properties.dir}/${build.compiler}.properties"/>
+
+  <!-- Parser properties -->
+  <!--property file="${properties.dir}/parser.properties"/-->
+
+  <!-- Compile-time classpath properties files -->
+  <property file="${properties.dir}/extrapath.properties"/>
+  <property file="${properties.dir}/compilepath.properties"/>
+
+  <!-- Release and Version info -->
+  <property file="${properties.dir}/release.properties"/>
+
+  <!-- derby testing specific properties files -->
+  <property file="${ant.home}/properties/derbytesting.properties"/>
+  <property file="${user.home}/properties/derbytesting.properties"/>
+  <property name="this.dir" value="${derby.testing.functest.dir}/tests/compatibility"/>
+
+<!--             ============ Begin Targets ==============                -->
+ 
+  <target name="FTOtestsubdir" depends="compilex"/>
+
+  <target name="compilex">
+    <javac
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}" 
+      srcdir="${derby.testing.src.dir}"
+      destdir="${out.dir}">
+      <classpath>
+        <pathelement path="${java13compile.classpath}"/>
+		<pathelement path="${junit}"/>
+      </classpath>
+      <include name="${this.dir}/*.java"/>
+    </javac>
+  </target>
+
+<!--             ============= End Targets ==============                -->
+
+<!--             ============= End Project ==============                -->
+
+</project>

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/testScript.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/testScript.xml?rev=330103&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/testScript.xml (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/testScript.xml Tue Nov  1 10:10:31 2005
@@ -0,0 +1,530 @@
+<?xml version="1.0"?>
+
+<!--
+   Derby - Script org/apache/derbyTesting/functionTests/tests/compatibility/testScript.xml
+
+   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+
+<project default="allTests" basedir="../../../../../../../..">
+  <description>
+	Driver for running compatibility tests, mixing and matching
+	clients and servers at different Derby rev levels on different
+	VMs. Invoke as follows:
+
+	ant -buildfile testScript.xml -DoutDir=OUTPUT_DIRECTORY [ -Ddrb.tests.debug=true ]
+
+	where    OUTPUT_DIRECTORY is the directory which will hold output files.
+	         drb.tests.debug=true coaxes extra diagnostics out of the tests.
+
+	This script assumes that you have set the following variables
+	in the ant.properties file in your user home directory:
+
+	j13lib          Set as you would to compile Derby (see trunk/BUILDING.txt).
+	j14lib          Set as you would to compile Derby (see trunk/BUILDING.txt).
+	jdk15           The JAVA_HOME of your 1.5 vm.
+
+	10.0.2.1_lib    Directory containing the released 10.0.2.1 jars.
+	10.1.1.0_lib    Directory containing the released 10.1.1.0 jars.
+	trunk_lib       Directory containing jars built from the development mainline (trunk).
+
+	db2jcc_lib      Directory containing the db2jcc jars (see trunk/java/testing/README.htm).
+
+	The basic loop runs as follows:
+
+		run compatibility tests against current embedded server in default VM
+
+		for each server VM
+		{
+			for each server version
+			{
+				bring up server
+				recreate database
+
+				for each client VM
+				{
+					for each client version
+					{
+						run compatibility tests
+					}
+				}
+
+				bring down server
+			}
+		}
+  </description>
+
+  <property file="${user.home}/ant.properties"/>
+  <property name="properties.dir" value="tools/ant/properties"/>
+  <property file="${properties.dir}/dirs.properties"/>
+  <property file="${properties.dir}/extrapath.properties"/>
+  <property name="summaryFile" value="${outDir}/SUMMARY_COMPAT.txt"/>
+  <property name="databaseName" value="compatDB"/>
+
+  <property name="VM_1.3" value="${j13lib}/../bin/java"/>
+  <property name="VM_1.4" value="${j14lib}/../bin/java"/>
+  <property name="VM_1.5" value="${jdk15}/bin/java"/>
+
+  <property name="SERVER_10.0.2.1" value="${10.0.2.1_lib}/derby.jar;${10.0.2.1_lib}/derbynet.jar"/>
+  <property name="SERVER_10.1.1.0" value="${10.1.1.0_lib}/derby.jar;${10.1.1.0_lib}/derbynet.jar"/>
+  <property name="SERVER_TRUNK" value="${trunk_lib}/derby.jar;${trunk_lib}/derbynet.jar"/>
+
+  <property name="CLIENT_DB2JCC" value="${db2jcc_lib}/db2jcc.jar;${db2jcc_lib}/db2jcc_license_c.jar"/>
+  <property name="CLIENT_10.1.1.0" value="${10.1.1.0_lib}/derbyclient.jar"/>
+  <property name="CLIENT_TRUNK" value="${trunk_lib}/derbyclient.jar"/>
+
+  <property name="TEST_JARS" value="${trunk_lib}/derbyTesting.jar;${junit}"/>
+  <property name="FULL_TRUNK" value="${SERVER_TRUNK};${CLIENT_TRUNK};${TEST_JARS}"/>
+
+  <property name="CLASSPATH_TRUNK" value="${basedir}/classes;${compile.classpath}"/>
+
+  <property name="VM_DEFAULT" value="${VM_1.4}"/>
+
+  <property name="JDBC_SUITE" value="org.apache.derbyTesting.functionTests.tests.compatibility.JDBCDriverTest"/>
+  <property name="EMBEDDED_CLIENT" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+
+  <!-- May be overridden on the command line -->
+  <property name="drb.tests.debug" value="false"/>
+
+<!--
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
+!! PUBLIC ENTRY POINTS
+!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+-->
+
+  <target
+    name="cleanup"
+    description="Brings down the server in case it is still running."
+  >
+
+	<antcall target="_stopServer"/>
+
+  </target>
+
+  <target
+    name="allTests"
+    description="Run all compatibility tests."
+  >
+
+    <antcall target="jdbcCompatibility"/>
+
+  </target>
+
+  <target
+    name="jdbcCompatibility"
+    depends="cleanup"
+    description="Run jdbc compatibility tests against all combinations."
+  >
+    <antcall target="embeddedTrunk"/>
+
+	<!-- Now loop through server VMs -->
+
+	<antcall target="_forServerVM">
+	  <param name="fsvVM" value="${VM_1.3}"/>
+	  <param name="fsvName" value="serverVM-1.3"/>
+    </antcall>
+
+	<antcall target="_forServerVM">
+	  <param name="fsvVM" value="${VM_1.4}"/>
+	  <param name="fsvName" value="serverVM-1.4"/>
+    </antcall>
+
+	<antcall target="_forServerVM">
+	  <param name="fsvVM" value="${VM_1.5}"/>
+	  <param name="fsvName" value="serverVM-1.5"/>
+    </antcall>
+
+	<!-- Done looping through server VMs -->
+
+	<antcall target="_checkSuccess"/>
+
+  </target>
+
+  <target
+    name="jdbcTrunk"
+    depends="cleanup"
+    description="Run compatibility tests against the latest client/server. This is a debugging entry point which gives developers a quick sanity test of one combination."
+  >
+	<antcall target="_startServer">
+	  <param name="svrVM" value="${VM_DEFAULT}"/>
+	  <param name="srvClasspath" value="${SERVER_TRUNK}"/>
+    </antcall>
+
+	<antcall target="_recreateDatabase"/>
+
+    <antcall target="_oneTest">
+	  <param name="otTestName" value="${JDBC_SUITE}"/>
+
+	  <param name="otClasspath" value="${CLIENT_TRUNK}"/>
+	  <param name="otOutfile" value="trunk_trunk"/>
+	  <param name="otVM" value="${VM_DEFAULT}"/>
+	  <param name="otClientName" value=""/>
+    </antcall>
+
+	<antcall target="_stopServer"/>
+
+	<antcall target="_checkSuccess"/>
+
+  </target>
+
+  <target
+    name="embeddedTrunk"
+    depends="cleanup"
+    description="Run compatibility tests against the latest embedded server. This combination tracks the compatibility of the embedded and network clients."
+  >
+	<antcall target="_recreateDatabaseGuts">
+	  <param name="codeline" value="${SERVER_TRUNK}"/>
+    </antcall>
+
+    <antcall target="_oneTest">
+	  <param name="otTestName" value="${JDBC_SUITE}"/>
+
+	  <param name="otClasspath" value="${SERVER_TRUNK}"/>
+	  <param name="otOutfile" value="embedded"/>
+	  <param name="otVM" value="${VM_DEFAULT}"/>
+	  <param name="otClientName" value="${EMBEDDED_CLIENT}"/>
+    </antcall>
+
+  </target>
+
+<!--
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
+!! LOOP MANAGEMENT
+!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+-->
+
+  <!--
+       Run tests for a given server VM.
+
+       fsvVM             VM to run server in
+       fsvName           Human-readable name for VM.
+  -->
+  <target name="_forServerVM">
+
+	<!-- Now loop through servers -->
+
+	<antcall target="_forServerVersion">
+	  <param name="fsvnVM" value="${fsvVM}"/>
+	  <param name="fsvnCP" value="${SERVER_TRUNK}"/>
+	  <param name="fsvnName" value="${fsvName}_serverTrunk"/>
+    </antcall>
+
+	<antcall target="_forServerVersion">
+	  <param name="fsvnVM" value="${fsvVM}"/>
+	  <param name="fsvnCP" value="${SERVER_10.1.1.0}"/>
+	  <param name="fsvnName" value="${fsvName}_server10.1.1.0"/>
+    </antcall>
+
+	<antcall target="_forServerVersion">
+	  <param name="fsvnVM" value="${fsvVM}"/>
+	  <param name="fsvnCP" value="${SERVER_10.0.2.1}"/>
+	  <param name="fsvnName" value="${fsvName}_server10.0.2.1"/>
+    </antcall>
+
+	<!-- Done looping through servers -->
+
+
+  </target>
+
+  <!--
+       Run tests for a given server version.
+
+       fsvnVM            VM to run server in
+       fsvnCP            Classpath of server
+       fsvnName          Human-readable name of VM/server combination
+  -->
+  <target name="_forServerVersion">
+
+	<antcall target="_startServer">
+	  <param name="svrVM" value="${fsvnVM}"/>
+	  <param name="srvClasspath" value="${fsvnCP}"/>
+    </antcall>
+
+	<antcall target="_recreateDatabase"/>
+
+	<!-- Now loop through client VMs -->
+
+	<antcall target="_forClientVM">
+	  <param name="fcvVM" value="${VM_1.3}"/>
+	  <param name="fcvName" value="${fsvnName}_clientVM-1.3"/>
+    </antcall>
+
+	<antcall target="_forClientVM">
+	  <param name="fcvVM" value="${VM_1.4}"/>
+	  <param name="fcvName" value="${fsvnName}_clientVM-1.4"/>
+    </antcall>
+
+	<antcall target="_forClientVM">
+	  <param name="fcvVM" value="${VM_1.5}"/>
+	  <param name="fcvName" value="${fsvnName}_clientVM-1.5"/>
+    </antcall>
+
+	<!-- Done looping through client VMs -->
+
+	<antcall target="_stopServer"/>
+
+  </target>
+
+  <!--
+       Run tests for a given client VM
+
+       fcvVM             VM to run client in
+       fcvName           Human-readable name of VM/server/VM combination
+  -->
+  <target name="_forClientVM">
+
+    <antcall target="_forClientVersion">
+	  <param name="fcvnVM" value="${fcvVM}"/>
+	  <param name="fcvnCP" value="${CLIENT_TRUNK}"/>
+	  <param name="fcvnName" value="${fcvName}_clientTrunk"/>
+    </antcall>
+
+    <antcall target="_forClientVersion">
+	  <param name="fcvnVM" value="${fcvVM}"/>
+	  <param name="fcvnCP" value="${CLIENT_10.1.1.0}"/>
+	  <param name="fcvnName" value="${fcvName}_clientDerby10.1.1.0"/>
+    </antcall>
+
+    <antcall target="_forClientVersion">
+	  <param name="fcvnVM" value="${fcvVM}"/>
+	  <param name="fcvnCP" value="${CLIENT_DB2JCC}"/>
+	  <param name="fcvnName" value="${fcvName}_clientDB2JCC"/>
+    </antcall>
+
+  </target>
+
+  <!--
+       Run tests for a given client version
+
+       fcvnVM            VM to run client in
+       fcvnCP            Classpath of client
+       fcvnName          Human-readable name of VM/server/VM/client
+                         combination. Used to construct output filename.
+
+  -->
+  <target name="_forClientVersion">
+
+    <antcall target="_oneTest">
+	  <param name="otTestName" value="${JDBC_SUITE}"/>
+
+	  <param name="otClasspath" value="${fcvnCP}"/>
+	  <param name="otOutfile" value="${fcvnName}"/>
+	  <param name="otVM" value="${fcvnVM}"/>
+	  <param name="otClientName" value=""/>
+    </antcall>
+
+  </target>
+
+<!--
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
+!! CLIENT WORKHORSE
+!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+-->
+
+  <!--
+       Run a single junit test.
+
+       otVM             VM to run test in
+       otClasspath      Classpath to use.
+       otTestname       Name of test class.
+       otOutFile        File to hold test's stdout and stderr.
+
+       Assumes that the test takes the following arguments:
+
+       arg[ 0 ]         Database name.
+  -->
+  <target name="_oneTest">
+
+    <exec
+	  executable="${otVM}"
+	  dir="${outDir}"
+	  output="${outDir}/${otOutfile}"
+	  resultproperty="testStatus"
+	>
+	  <arg value="-cp"/>
+	  <arg path="${otClasspath}:${TEST_JARS}:${javatools.dir}/jdbc2_0-stdext.jar"/>
+
+	  <arg value="-Ddrb.tests.debug=${drb.tests.debug}"/>
+
+	  <arg value="${otTestName}"/>
+
+	  <arg value="${databaseName}"/>
+
+	  <arg value="${otClientName}"/>
+
+	</exec>
+
+    <condition property="compatFailure">
+	  <not>
+	    <equals arg1="${testStatus}" arg2="0" />
+	  </not>
+	</condition>
+
+	<antcall target="_checkFailure">
+	  <param name="testrun" value="${otOutfile}"/>
+    </antcall>
+
+  </target>
+
+<!--
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
+!! SERVER MANAGEMENT
+!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+-->
+
+  <!--
+       Start up a server.
+
+       srvVM             VM to run server in.
+       srvClasspath      Classpath to use.
+  -->
+  <target name="_startServer">
+
+    <exec
+	  executable="${svrVM}"
+	  dir="${outDir}"
+	  spawn="true"
+	>
+	  <arg value="-cp"/>
+	  <arg path="${srvClasspath}"/>
+
+	  <arg value="org.apache.derby.drda.NetworkServerControl"/>
+	  <arg value="start"/>
+
+	</exec>
+
+	<!-- Pause until server comes up. -->
+	<antcall target="_pingServer"/>
+
+  </target>
+
+  <!--
+       Bring down server.
+  -->
+  <target name="_stopServer">
+
+    <exec
+	  executable="${VM_DEFAULT}"
+	  dir="${outDir}"
+	>
+	  <arg value="-cp"/>
+	  <arg path="${SERVER_TRUNK}"/>
+
+	  <arg value="org.apache.derby.drda.NetworkServerControl"/>
+      <arg value="shutdown"/>
+
+	</exec>
+
+  </target>
+
+  <!--
+       Check if server is alive.
+  -->
+  <target name="_pingServer">
+
+    <exec
+	  executable="${VM_DEFAULT}"
+	  dir="${outDir}"
+	>
+	  <arg value="-cp"/>
+	  <arg path="${FULL_TRUNK}"/>
+
+	  <arg value="org.apache.derbyTesting.functionTests.tests.compatibility.Pinger"/>
+
+	</exec>
+
+  </target>
+
+  <!--
+       Recreate database.
+  -->
+  <target name="_recreateDatabase">
+
+	<antcall target="_recreateDatabaseGuts">
+	  <param name="codeline" value="${CLIENT_DB2JCC}"/>
+    </antcall>
+
+  </target>
+
+  <target name="_recreateDatabaseGuts">
+
+    <delete dir="${outDir}/${databaseName}"/>
+
+    <exec
+	  executable="${VM_DEFAULT}"
+	  dir="${outDir}"
+	>
+	  <arg value="-cp"/>
+	  <arg path="${codeline};${TEST_JARS}"/>
+
+	  <arg value="${JDBC_SUITE}$Creator"/>
+	  <arg value="${databaseName}"/>
+
+	</exec>
+
+  </target>
+
+<!--
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
+!! SUMMARY MINIONS
+!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+-->
+
+
+  <!-- Check if all tests succeeded -->
+  <target name="_checkSuccess" unless="compatFailure">
+
+    <antcall target="_writeSummary">
+	  <param name="summaryMessage" value="SUCCESS!"/>
+    </antcall>
+
+  </target>
+
+  <!-- Check if a test failed -->
+  <target name="_checkFailure" if="compatFailure">
+
+    <antcall target="_writeSummary">
+	  <param name="summaryMessage" value="FAILURE: Check ${testrun} for details."/>
+    </antcall>
+
+	<antcall target="_stopServer"/>
+
+    <fail message="Testrun ${testrun} failed."/>
+
+  </target>
+
+  <!-- Write the summary file -->
+  <target name="_writeSummary">
+
+    <echo file="${summaryFile}"> 
+${summaryMessage}
+
+</echo>
+
+  </target>
+
+
+</project>

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/testScript.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest.java?rev=330103&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest.java Tue Nov  1 10:10:31 2005
@@ -0,0 +1,80 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.parameterMapping
+
+   Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+/**
+ * <p>
+ * Run the compatibility tests against the embedded server.
+ * </p>
+ *
+ * @author Rick
+ */
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.*;
+
+import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.tests.compatibility.JDBCDriverTest;
+
+public	class	CompatibilityTest
+{
+	/////////////////////////////////////////////////////////////
+	//
+	//	CONSTANTS
+	//
+	/////////////////////////////////////////////////////////////
+
+	public	static	final	String	DATABASE_NAME = "wombat";
+	public	static	final	String	NETWORK_CLIENT_NAME = "org.apache.derby.jdbc.ClientDriver";
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	STATE
+	//
+	/////////////////////////////////////////////////////////////
+
+	/////////////////////////////////////////////////////////////
+	//
+	//	CONSTRUCTOR
+	//
+	/////////////////////////////////////////////////////////////
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	ENTRY POINT
+	//
+	/////////////////////////////////////////////////////////////
+
+	public	static	final	void	main( String[] args )
+		throws Exception
+	{
+		// create database
+		ij.getPropertyArg( args );
+		Connection conn = ij.startJBMS();
+
+		JDBCDriverTest.main( new String[] { DATABASE_NAME, NETWORK_CLIENT_NAME } );
+	}
+	
+	/////////////////////////////////////////////////////////////
+	//
+	//	MINIONS
+	//
+	/////////////////////////////////////////////////////////////
+
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest_app.properties?rev=330103&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest_app.properties (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest_app.properties Tue Nov  1 10:10:31 2005
@@ -0,0 +1 @@
+usedefaults=true

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CompatibilityTest_app.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml Tue Nov  1 10:10:31 2005
@@ -64,6 +64,7 @@
       <classpath>
         <!--pathelement location="${oro}"/-->
         <pathelement path="${compile.classpath}"/>
+		<pathelement path="${junit}"/>
       </classpath>
       <include name="${this.dir}/*.java"/>
       <exclude name="${this.dir}/autoGeneratedJdbc30.java"/>

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant?rev=330103&r1=330102&r2=330103&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant Tue Nov  1 10:10:31 2005
@@ -1,3 +1,4 @@
+CompatibilityTest_app.properties
 aclob.txt
 autoGeneratedJdbc30_app.properties
 batchUpdate_app.properties



Mime
View raw message