hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1442476 - /hama/trunk/core/src/test/java/org/apache/hama/bsp/TestMessages.java
Date Tue, 05 Feb 2013 06:09:01 GMT
Author: edwardyoon
Date: Tue Feb  5 06:09:01 2013
New Revision: 1442476

URL: http://svn.apache.org/viewvc?rev=1442476&view=rev
Log:
HAMA-729: Fix OOM in unit test.

Modified:
    hama/trunk/core/src/test/java/org/apache/hama/bsp/TestMessages.java

Modified: hama/trunk/core/src/test/java/org/apache/hama/bsp/TestMessages.java
URL: http://svn.apache.org/viewvc/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestMessages.java?rev=1442476&r1=1442475&r2=1442476&view=diff
==============================================================================
--- hama/trunk/core/src/test/java/org/apache/hama/bsp/TestMessages.java (original)
+++ hama/trunk/core/src/test/java/org/apache/hama/bsp/TestMessages.java Tue Feb  5 06:09:01
2013
@@ -25,15 +25,14 @@ import org.apache.hama.util.Bytes;
 public class TestMessages extends TestCase {
 
   public void testByteMessage() {
-    int dataSize = (int) (Runtime.getRuntime().maxMemory() * 0.60);
+    int dataSize = 1234;
     ByteMessage msg = new ByteMessage(Bytes.toBytes("tag"), new byte[dataSize]);
     assertEquals(msg.getData().length, dataSize);
     msg = null;
-    
+
     byte[] dummyData = new byte[1024];
     ByteMessage msg2 = new ByteMessage(Bytes.tail(dummyData, 128), dummyData);
-    assertEquals(
-        Bytes.compareTo(msg2.getTag(), 0, 128, msg2.getData(),
-            msg2.getData().length - 128, 128), 0);
+    assertEquals(Bytes.compareTo(msg2.getTag(), 0, 128, msg2.getData(),
+        msg2.getData().length - 128, 128), 0);
   }
 }



Mime
View raw message