db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r470294 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LobLengthTest.java
Date Thu, 02 Nov 2006 09:43:04 GMT
Author: kahatlen
Date: Thu Nov  2 01:43:04 2006
New Revision: 470294

URL: http://svn.apache.org/viewvc?view=rev&rev=470294
Log:
DERBY-2027: JUnit suite All crashes with OutOfMemoryError when running
LobLengthTest

Use LoopingAlphabetStream instead of ByteArrayInputStream to reduce
memory usage. Patch contributed by Kristian Waagan.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LobLengthTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LobLengthTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LobLengthTest.java?view=diff&rev=470294&r1=470293&r2=470294
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LobLengthTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LobLengthTest.java
Thu Nov  2 01:43:04 2006
@@ -26,10 +26,9 @@
 import java.sql.Statement;
 import java.sql.SQLException;
 
-import java.io.ByteArrayInputStream;
-
 import junit.framework.Test;
 import junit.framework.TestSuite;
+import org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetStream;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
@@ -110,9 +109,9 @@
         // length of the test data must be specified as
         // at least 2^24 bytes (hence the '16800000' in
         // the next line).
-        byte [] bA = new byte[16800000];
+        int lobSize = 16800000;
         pSt.setBinaryStream(1,
-            new java.io.ByteArrayInputStream(bA), bA.length);
+            new LoopingAlphabetStream(lobSize), lobSize);
 
         // Now try the insert; this is where the server processes
         // the lob length.



Mime
View raw message