db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r397381 - /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java
Date Thu, 27 Apr 2006 04:10:27 GMT
Author: fuzzylogic
Date: Wed Apr 26 21:10:26 2006
New Revision: 397381

URL: http://svn.apache.org/viewcvs?rev=397381&view=rev
Log:
DERBY-1247: fix DerbyNetAutoStart test on systems with non-ASCII native
encoding. Merge of revision 397300 from trunk.

Modified:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java?rev=397381&r1=397380&r2=397381&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetAutoStart.java
Wed Apr 26 21:10:26 2006
@@ -31,6 +31,8 @@
 import java.io.IOException;
 import java.io.FileOutputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.PrintStream;
 import java.io.RandomAccessFile;
@@ -384,7 +386,7 @@
                     stopServer( serverProcess);
                     return;
                 }
-                if( !checkLog( logFile, new String[] {"An exception was thrown during network
server startup"}))
+                if( !checkLog( logFileName, new String[] {"An exception was thrown during
network server startup"}))
                 {
                     // Was the network server started? Print out the names of the threads
                     System.out.println( "Active threads:");
@@ -464,13 +466,15 @@
         serverProcess.destroy();
     } // end of stopServer
         
-    private static boolean checkLog( RandomAccessFile logFile, String[] expected) throws
IOException
+    private static boolean checkLog( String logFileName, String[] expected) throws IOException
     {
         boolean allFound = true;
         boolean[] found = new boolean[ expected.length];
-        while( logFile.getFilePointer() < logFile.length())
+        FileInputStream is = new FileInputStream(logFileName);
+        BufferedReader br = new BufferedReader(new InputStreamReader(is));
+        String logLine; 
+        while((logLine = br.readLine()) != null)            
         {
-            String logLine = logFile.readLine();
             for( int i = 0; i < expected.length; i++)
             {
                 if( (! found[i]) && logLine.indexOf( expected[i]) >= 0)



Mime
View raw message