From 843230a1cb41ee3c20003e5d9a653c20d308a743 Mon Sep 17 00:00:00 2001
From: str4d <str4d@mail.i2p>
Date: Sun, 26 Apr 2015 01:43:34 +0000
Subject: [PATCH] Fixed MessageInputStreamTest after constructor changes

---
 .../streaming/impl/MessageInputStreamTest.java     | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/apps/streaming/java/test/junit/net/i2p/client/streaming/impl/MessageInputStreamTest.java b/apps/streaming/java/test/junit/net/i2p/client/streaming/impl/MessageInputStreamTest.java
index 284bc193b6..f1f805bb65 100644
--- a/apps/streaming/java/test/junit/net/i2p/client/streaming/impl/MessageInputStreamTest.java
+++ b/apps/streaming/java/test/junit/net/i2p/client/streaming/impl/MessageInputStreamTest.java
@@ -20,11 +20,13 @@ import net.i2p.util.Log;
 public class MessageInputStreamTest extends TestCase {
     private I2PAppContext _context;
     private Log _log;
+    private ConnectionOptions _options;
     
     @Before
     public void setUp() {
         _context = I2PAppContext.getGlobalContext();
         _log = _context.logManager().getLog(MessageInputStreamTest.class);
+        _options = new ConnectionOptions();
     }
     
     @Test
@@ -32,7 +34,8 @@ public class MessageInputStreamTest extends TestCase {
         byte orig[] = new byte[256*1024];
         _context.random().nextBytes(orig);
         
-        MessageInputStream in = new MessageInputStream(_context);
+        MessageInputStream in = new MessageInputStream(_context, _options.getMaxMessageSize(),
+                                                       _options.getMaxWindowSize(), _options.getInboundBufferSize());
         for (int i = 0; i < orig.length / 1024; i++) {
             byte msg[] = new byte[1024];
             System.arraycopy(orig, i*1024, msg, 0, 1024);
@@ -58,7 +61,8 @@ public class MessageInputStreamTest extends TestCase {
         byte orig[] = new byte[256*1024];
         _context.random().nextBytes(orig);
         
-        MessageInputStream in = new MessageInputStream(_context);
+        MessageInputStream in = new MessageInputStream(_context, _options.getMaxMessageSize(),
+                                                       _options.getMaxWindowSize(), _options.getInboundBufferSize());
         ArrayList<Integer> order = new ArrayList<Integer>(32);
         for (int i = 0; i < orig.length / 1024; i++)
             order.add(new Integer(i));
@@ -90,7 +94,8 @@ public class MessageInputStreamTest extends TestCase {
         byte orig[] = new byte[256*1024];
         _context.random().nextBytes(orig);
         
-        MessageInputStream in = new MessageInputStream(_context);
+        MessageInputStream in = new MessageInputStream(_context, _options.getMaxMessageSize(),
+                                                       _options.getMaxWindowSize(), _options.getInboundBufferSize());
         for (int n = 0; n < 3; n++) {
             ArrayList<Integer> order = new ArrayList<Integer>(32);
             for (int i = 0; i < orig.length / 1024; i++)
@@ -125,7 +130,8 @@ public class MessageInputStreamTest extends TestCase {
         byte read[] = new byte[orig.length];
         _context.random().nextBytes(orig);
         
-        MessageInputStream in = new MessageInputStream(_context);
+        MessageInputStream in = new MessageInputStream(_context, _options.getMaxMessageSize(),
+                                                       _options.getMaxWindowSize(), _options.getInboundBufferSize());
         ArrayList<Integer> order = new ArrayList<Integer>(32);
         for (int i = 0; i < orig.length / 1024; i++)
             order.add(new Integer(i));
-- 
GitLab