You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2006/04/04 20:47:38 UTC
svn commit: r391384 [1/6] - in /db/derby/code/trunk/java:
engine/org/apache/derby/impl/jdbc/
testing/org/apache/derbyTesting/functionTests/harness/
testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/
testing/org/apache/derbyTesting/fun...
Author: rhillegas
Date: Tue Apr 4 11:47:34 2006
New Revision: 391384
URL: http://svn.apache.org/viewcvs?rev=391384&view=rev
Log:
Checkin patch to DERBY-955 which uses Sed to mask out jdk1.6-specific test diffs introduced by the JDBC4 subclasses of SQLException. This eliminates a number of jdk1.6-specific canons.
Added:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/Stream.out (with props)
Removed:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/SURTest.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/Stream.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/TransactionTable.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/checkDataSource.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/checkDataSource30.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/compressTable.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/iepnegativetests.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/ieptests.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/importExportThruIJ.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/nestedCommit.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/outparams.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/parameterMapping.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/procedure.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/statementJdbc20.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/statementJdbc30.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/streamingColumn.out
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/ieptests.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/importExport.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/metadata.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/odbc_metadata.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/procedure.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/ieptests.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/importExport.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/metadata.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/odbc_metadata.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/parameterMapping.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/procedure.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/savepointJdbc30_JSR169.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/savepointJdbc30_XA.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java?rev=391384&r1=391383&r2=391384&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java Tue Apr 4 11:47:34 2006
@@ -221,12 +221,11 @@
public static SQLException notImplemented() {
- return newEmbedSQLException(SQLState.NOT_IMPLEMENTED,
- new Object[] {MessageService.getTextMessage(MessageId.CONN_NO_DETAILS)},
- StandardException.getSeverityFromIdentifier(SQLState.NOT_IMPLEMENTED));
+ return notImplemented( MessageService.getTextMessage(MessageId.CONN_NO_DETAILS) );
}
public static SQLException notImplemented(String feature) {
+
return newEmbedSQLException(SQLState.NOT_IMPLEMENTED,
new Object[] {feature},
StandardException.getSeverityFromIdentifier(SQLState.NOT_IMPLEMENTED));
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java?rev=391384&r1=391383&r2=391384&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java Tue Apr 4 11:47:34 2006
@@ -121,4 +121,20 @@
{
return minor;
}
+
+ /**
+ * <p>
+ * Return true if we are at least at the passed in version.
+ * </p>
+ */
+ public boolean atLeast( int baseMajor, int baseMinor )
+ {
+ if ( major < baseMajor ) { return false; }
+ if ( major > baseMajor ) { return true; }
+
+ // same major number
+
+ return ( minor >= baseMinor );
+ }
+
}
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?rev=391384&r1=391383&r2=391384&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java Tue Apr 4 11:47:34 2006
@@ -240,7 +240,9 @@
System.setProperties(sp);
}
- getProperties(sp);
+ JavaVersionHolder jvh = getProperties(sp);
+ boolean isJDBC4 = jvh.atLeast( 1, 6 );
+
// Setup the directories for the test and test output
setDirectories(scriptName,sp);
@@ -337,7 +339,7 @@
{
Sed sed = new Sed();
sed.exec(tmpOutFile,finalOutFile, isSed,
- NetServer.isClientConnection(framework), isI18N);
+ NetServer.isClientConnection(framework), isI18N, isJDBC4);
}
catch (ClassFormatError cfe)
{
@@ -829,7 +831,7 @@
(new BufferedWriter(new FileWriter(diffFile.getPath()), 4096), true);
}
- private static void getProperties(Properties sp)
+ private static JavaVersionHolder getProperties(Properties sp)
throws Exception
{
// Get any properties specified on the command line
@@ -1150,7 +1152,8 @@
String uscdb = sp.getProperty("useCommonDB");
if (uscdb != null && uscdb.equals("true"))
useCommonDB = true;
-
+
+ return jvh;
}
private static String createPropString()
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=391384&r1=391383&r2=391384&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 Apr 4 11:47:34 2006
@@ -39,6 +39,7 @@
public class Sed
{
+ private static final String SQL_EXCEPTION_FILTERED_SUBSTITUTION = "SQL Exception:";
public Sed()
{
@@ -51,11 +52,12 @@
}
File src = new File(args[0]);
File tgt = new File(args[1]);
- new Sed().exec(src,tgt,null, false, false);
+ new Sed().exec(src,tgt,null, false, false,false);
}
// The arguments should be the names of the input and output files
- public void exec(File srcFile, File dstFile, InputStream isSed, boolean isJCC, boolean isI18N)
+ public void exec
+ (File srcFile, File dstFile, InputStream isSed, boolean isJCC, boolean isI18N, boolean isJDBC4)
throws IOException
{
String hostName = TestUtil.getHostName();
@@ -171,6 +173,26 @@
// Filter out localhost, or hostName
searchStrings.addElement(hostName);
+ if ( isJDBC4 )
+ {
+ // Filters for the sql exception class names which appear in
+ // exception messages. These are different in JDBC3 and JDBC4.
+ searchStrings.addElement("java.sql.SQLDataException:");
+ searchStrings.addElement("java.sql.SQLDataSetSyncException:");
+ searchStrings.addElement("java.sql.SQLException:");
+ searchStrings.addElement("java.sql.SQLFeatureNotSupportedException:");
+ searchStrings.addElement("java.sql.SQLIntegrityConstraintViolationException:");
+ searchStrings.addElement("java.sql.SQLInvalidAuthorizationSpecException:");
+ searchStrings.addElement("java.sql.SQLNonTransientConnectionException:");
+ searchStrings.addElement("java.sql.SQLNonTransientException:");
+ searchStrings.addElement("java.sql.SQLRuntimeException:");
+ searchStrings.addElement("java.sql.SQLSyntaxErrorException:");
+ searchStrings.addElement("java.sql.SQLTimeoutException:");
+ searchStrings.addElement("java.sql.SQLTransactionRollbackException:");
+ searchStrings.addElement("java.sql.SQLTransientConnectionException:");
+ searchStrings.addElement("java.sql.SQLTransientException:");
+ }
+
Vector subStrings = new Vector();
subStrings.addElement("Transaction:(XXX)|");
subStrings.addElement("Read ... bytes");
@@ -209,7 +231,26 @@
subStrings.addElement("xxxFILTERED-SAX-EXCEPTIONxxx'.");
// Filter out localhost, or hostName
subStrings.addElement("xxxFILTERED_HOSTNAMExxx");
- doWork(srcFile, dstFile, null, deleteLines, searchStrings, subStrings, isSed, isI18N);
+
+ if ( isJDBC4 )
+ {
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ subStrings.addElement(SQL_EXCEPTION_FILTERED_SUBSTITUTION);
+ }
+
+ doWork(srcFile, dstFile, null, deleteLines, searchStrings, subStrings, isSed, isI18N);
} // end exec