From 956c9607ff22bc01809b2df8768c43f458cd5924 Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 6 Dec 2017 13:09:53 +0000 Subject: [PATCH] hopefully fix streaming test --- .../streaming/impl/MessageInputStreamTest.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 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 296309c4f..9578f58ef 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 @@ -87,21 +87,11 @@ public class MessageInputStreamTest { @Test public void testCanAccept_locallyClosed() { - // Fill the buffer - int numMsgs = _options.getInboundBufferSize() / _options.getMaxMessageSize(); - byte orig[] = new byte[_options.getInboundBufferSize()]; - _context.random().nextBytes(orig); - for (int i = 0; i < numMsgs; i++) { - byte msg[] = new byte[_options.getMaxMessageSize()]; - System.arraycopy(orig, i*_options.getMaxMessageSize(), msg, 0, _options.getMaxMessageSize()); - in.messageReceived(i, new ByteArray(msg)); - } - // Check that new messages won't be accepted - assertFalse(in.canAccept(numMsgs, 1)); // Close in.close(); - // Check that new messages will now be accepted - assertTrue(in.canAccept(numMsgs, 1)); + assertTrue(in.isLocallyClosed()); + // Check that new messages will not be accepted + assertFalse(in.canAccept(2, 1)); } @Test