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 km...@apache.org on 2005/06/09 05:41:02 UTC

svn commit: r189696 - in /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/errorStream.out tests/lang/copyfiles.ant tests/lang/errorStream.java

Author: kmarsden
Date: Wed Jun  8 20:41:00 2005
New Revision: 189696

URL: http://svn.apache.org/viewcvs?rev=189696&view=rev
Log:
This patch modifies the test 
lang/errorStream.java introduced as part of Derby-205 to remove the 
intermittent failures seen (e.g. by Army). The failures happen due to 
slight variation in output merging of System.err and System.out, due 
to this test's expected output to System.err (for its negative test 
cases). 
		contributed by Dag Wanvik


Modified:
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/errorStream.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/errorStream.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/errorStream.out?rev=189696&r1=189695&r2=189696&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/errorStream.out (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/errorStream.out Wed Jun  8 20:41:00 2005
@@ -1,36 +1,9 @@
 Test errorStream starting
 shutdown ok: XJ015:Derby system shutdown.
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT Thread[main,5,main] java.io.FileNotFoundException: xxxFILTERED_PATHxxx VombatusUrsinusHirsutus-file-2.log
-----------------------------------------------------------------
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT:
- Booting Derby: xxxFILTERED_VERSIONxxx
-on database directory xxxFILTERED_PATHxxx VombatusUrsinusHirsutus-2 
-Database Class Loader started - derby.database.classpath=''
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT:
-Shutting down instance xxxxFILTERED-UUIDxxxx
-----------------------------------------------------------------
 shutdown ok: XJ015:Derby system shutdown.
 shutdown ok: XJ015:Derby system shutdown.
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT Thread[main,5,main] java.lang.NoSuchMethodException: org.apache.derbyTesting.functionTests.tests.lang.errorStream.nonExistingGetStream()
-----------------------------------------------------------------
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT:
- Booting Derby: xxxFILTERED_VERSIONxxx
-on database directory xxxFILTERED_PATHxxx VombatusUrsinusHirsutus-4 
-Database Class Loader started - derby.database.classpath=''
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT:
-Shutting down instance xxxxFILTERED-UUIDxxxx
-----------------------------------------------------------------
 shutdown ok: XJ015:Derby system shutdown.
 shutdown ok: XJ015:Derby system shutdown.
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT Thread[main,5,main] java.lang.NoSuchFieldException: nonExistingFieldStream
-----------------------------------------------------------------
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT:
- Booting Derby: xxxFILTERED_VERSIONxxx
-on database directory xxxFILTERED_PATHxxx VombatusUrsinusHirsutus-6 
-Database Class Loader started - derby.database.classpath=''
-xxxxxxFILTERED-TIMESTAMPxxxxxGMT:
-Shutting down instance xxxxFILTERED-UUIDxxxx
-----------------------------------------------------------------
 shutdown ok: XJ015:Derby system shutdown.
 shutdown ok: XJ015:Derby system shutdown.
 shutdown ok: XJ015:Derby system shutdown.

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant?rev=189696&r1=189695&r2=189696&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant Wed Jun  8 20:41:00 2005
@@ -76,7 +76,6 @@
 emptyStatistics.sql
 errorCode.sql
 errorCode_app.properties
-errorStream_sed.properties
 fk_nonSPS.sql
 fk_nonSPS_derby.properties
 floattypes.sql

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream.java?rev=189696&r1=189695&r2=189696&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream.java (original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream.java Wed Jun  8 20:41:00 2005
@@ -23,6 +23,7 @@
 import java.io.OutputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.PrintStream;
 import java.util.Properties;
 import java.sql.Connection;
 import java.sql.Driver;
@@ -93,6 +94,15 @@
    public static OutputStream fieldStream;
    private static File fieldStreamFile;
 
+   /*
+    * Field errStream used as redirection for System.err to be able
+    * to checks its (non-)use in the scenarios. We first tried to
+    * merge it with System.out and let the harness compare outputs,
+    * but this gave intermittent merging differences, so abandoned.
+    * Maps to file <database>-err-<runNo>.log
+    */
+   private static OutputStream errStream;
+   private static File errStreamFile;
 
    /*
     * Method getStream used by Derby when METHOD_PROP
@@ -123,6 +133,9 @@
          fieldStreamFile = new File(derbyHome, makeStreamFilename("field"));
          fieldStream = new FileOutputStream(fieldStreamFile);
 
+	 errStreamFile = new File(derbyHome, makeStreamFilename("err"));
+	 errStream =new FileOutputStream(errStreamFile);
+	 System.setErr(new PrintStream(errStream));
       }
       catch (IOException e) {
          System.out.println("Could not open stream files");
@@ -135,6 +148,9 @@
       try {
          methodStream.close();
          fieldStream.close();
+
+	 // reset until next scenario, no expected output
+	 System.setErr(System.out); 
       }
       catch (IOException e) {
          System.out.println("Could not close stream files");
@@ -190,8 +206,9 @@
          conn.close();
       }
       catch (SQLException e) {
-         System.out.println("Derby boot failed: " + ":" + 
-                            attrs.getProperty("databaseName"));
+         System.out.println("Derby boot failed: " +
+			    attrs.getProperty("databaseName") + " : " +
+			    e.getSQLState() + ": " + e.getMessage());
          throw e;
       }
    }
@@ -230,6 +247,7 @@
       assertNonEmpty(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertEmpty(errStreamFile);
    }
 
 
@@ -249,6 +267,7 @@
       assertNonExisting(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertNonEmpty(errStreamFile);
    }
 
 
@@ -269,6 +288,7 @@
       assertNonExisting(fileStreamFile);
       assertNonEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertEmpty(errStreamFile);
    }
 
 
@@ -289,6 +309,7 @@
       assertNonExisting(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertNonEmpty(errStreamFile);
    }
 
 
@@ -309,6 +330,7 @@
       assertNonExisting(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertNonEmpty(fieldStreamFile);
+      assertEmpty(errStreamFile);
    }
 
 
@@ -329,6 +351,7 @@
       assertNonExisting(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertNonEmpty(errStreamFile);
    }
 
    
@@ -350,6 +373,7 @@
       assertNonEmpty(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertEmpty(errStreamFile);
    }
 
 
@@ -371,6 +395,7 @@
       assertNonEmpty(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertEmpty(errStreamFile);
    }
 
 
@@ -396,6 +421,7 @@
       assertNonEmpty(fileStreamFile);
       assertEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertEmpty(errStreamFile);
    }
 
 
@@ -419,6 +445,7 @@
       assertNonExisting(fileStreamFile);
       assertNonEmpty(methodStreamFile);
       assertEmpty(fieldStreamFile);
+      assertEmpty(errStreamFile);
    }
 
 
@@ -436,7 +463,7 @@
 
          checkMethod();
          checkWrongMethod();
-
+	 
          checkField();
          checkWrongField();