db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r681302 - /db/derby/code/trunk/java/testing/org/apache/derby/impl/drda/ProtocolTest.java
Date Thu, 31 Jul 2008 08:42:10 GMT
Author: kristwaa
Date: Thu Jul 31 01:42:09 2008
New Revision: 681302

URL: http://svn.apache.org/viewvc?rev=681302&view=rev
Log:
DERBY-2031: Convert derbynet/testProtocol.java to JUnit.
Close opened readers/streams (caused failure on Windows).
Patch file: derby-2031-4a-close_streams.diff

Modified:
    db/derby/code/trunk/java/testing/org/apache/derby/impl/drda/ProtocolTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derby/impl/drda/ProtocolTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derby/impl/drda/ProtocolTest.java?rev=681302&r1=681301&r2=681302&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derby/impl/drda/ProtocolTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derby/impl/drda/ProtocolTest.java Thu Jul
31 01:42:09 2008
@@ -207,12 +207,16 @@
     private void processFile(String fileName, DDMReader reader,
                              DDMWriter writer, OutputStream monitorOs)
             throws DRDAProtocolException, IOException {
-       File incFile = SupportFilesSetup.getReadOnly(fileName);
-       assertTrue("Missing file: " + fileName,
+        File incFile = SupportFilesSetup.getReadOnly(fileName);
+        assertTrue("Missing file: " + fileName,
                PrivilegedFileOpsForTests.exists(incFile));
-       processCommands(new BufferedReader(
-               PrivilegedFileOpsForTests.getFileReader(incFile)),
-               reader, writer, monitorOs);
+        BufferedReader bIn = new BufferedReader(
+               PrivilegedFileOpsForTests.getFileReader(incFile));
+        try {
+            processCommands(bIn, reader, writer, monitorOs);
+        } finally {
+            bIn.close();
+        }
     }
 
     /**
@@ -889,6 +893,7 @@
             }
             currentLine++;
         }
+        bIn.close();
 
         // Copy the required include files.
         final String resourcePath = "functionTests/tests/derbynet";



Mime
View raw message