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 ka...@apache.org on 2007/11/27 14:00:52 UTC

svn commit: r598626 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ErrorStreamTest.java

Author: kahatlen
Date: Tue Nov 27 05:00:50 2007
New Revision: 598626

URL: http://svn.apache.org/viewvc?rev=598626&view=rev
Log:
DERBY-3202:
Workaround for failure in ErrorStreamTest on Windows Vista and Sun JDK 1.4.2.

Contributed by Vemund Østgaard.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ErrorStreamTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ErrorStreamTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ErrorStreamTest.java?rev=598626&r1=598625&r2=598626&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ErrorStreamTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/ErrorStreamTest.java Tue Nov 27 05:00:50 2007
@@ -22,6 +22,7 @@
 package org.apache.derbyTesting.functionTests.tests.engine;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -95,6 +96,9 @@
     }
 
     public void setUp() throws Exception {
+        bootDerby();
+        // Shutdown engine so we can change properties for error stream
+        getTestConfiguration().shutdownEngine();
         openStreams();
     }
 
@@ -431,8 +435,13 @@
         try {
             AccessController.doPrivileged (new PrivilegedExceptionAction() {
                 public Object run() throws IOException {
-                    assertTrue("assertNotEmpty failed:" + f.getCanonicalPath(),
-                          f.exists() && (f.length() != 0));
+                    assertTrue("assertNotEmpty failed: " + f.getCanonicalPath()
+                          + " does not exist.", f.exists());
+                    FileInputStream fis = new FileInputStream(f);
+                    int result = fis.read();
+                    fis.close();
+                    assertTrue("assertNotEmpty failed: " + f.getCanonicalPath()
+                          + " is empty.", -1 != result);
                     return null;
                 }
             });