433262 - WebSocket / Advanced close use cases

+ Fixing bad assumptions in unit tests where the client would send a few
  frames to test the protocol behavior followed by the close frame.
  But the test expected the server to initiate the close, but this setup
  of the tests would mean that the client initiated the close.
This commit is contained in:
Joakim Erdfelt 2014-04-23 12:56:00 -07:00
parent 900dea3719
commit 2bc9accd98
15 changed files with 158 additions and 710 deletions

View File

@ -524,7 +524,13 @@ public class BlockheadClient implements IncomingFrames, OutgoingFrames, Connecti
return len;
}
@Deprecated
public IncomingFramesCapture readFrames(int expectedCount, TimeUnit timeoutUnit, int timeoutDuration) throws IOException, TimeoutException
{
return readFrames(expectedCount,timeoutDuration,timeoutUnit);
}
public IncomingFramesCapture readFrames(int expectedCount, int timeoutDuration, TimeUnit timeoutUnit) throws IOException, TimeoutException
{
LOG.debug("Read: waiting for {} frame(s) from server",expectedCount);

View File

@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.is;
/**
* Fuzzing utility for the AB tests.
*/
public class Fuzzer
public class Fuzzer implements AutoCloseable
{
public static enum CloseState
{
@ -117,8 +117,14 @@ public class Fuzzer
buf.flip();
return buf;
}
@Override
public void close() throws Exception
{
this.client.disconnect();
}
public void close()
public void disconnect()
{
this.client.disconnect();
}
@ -187,23 +193,6 @@ public class Fuzzer
// TODO Should test for no more frames. success if connection closed.
}
public void expectServerDisconnect(DisconnectMode mode)
{
client.expectServerDisconnect();
IOState ios = client.getIOState();
switch (mode)
{
case CLEAN:
Assert.assertTrue(ios.wasRemoteCloseInitiated());
Assert.assertTrue(ios.wasCleanClose());
break;
case UNCLEAN:
Assert.assertTrue(ios.wasRemoteCloseInitiated());
break;
}
}
public CloseState getCloseState()
{
IOState ios = client.getIOState();

View File

@ -18,14 +18,22 @@
package org.eclipse.jetty.websocket.server;
import static org.hamcrest.Matchers.*;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.websocket.api.StatusCode;
import org.eclipse.jetty.websocket.common.CloseInfo;
import org.eclipse.jetty.websocket.common.OpCode;
import org.eclipse.jetty.websocket.common.WebSocketFrame;
import org.eclipse.jetty.websocket.common.frames.TextFrame;
import org.eclipse.jetty.websocket.common.test.BlockheadClient;
import org.eclipse.jetty.websocket.common.test.IncomingFramesCapture;
import org.eclipse.jetty.websocket.server.helper.RFCSocket;
import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@ -83,8 +91,13 @@ public class IdleTimeoutTest
// The server could not read this frame, if it is in this half closed state
client.write(new TextFrame().setPayload("Hello"));
// Expect server to be disconnected at this point
client.expectServerDisconnect();
// Expect server to have closed due to its own timeout
IncomingFramesCapture capture = client.readFrames(1,500,TimeUnit.MILLISECONDS);
WebSocketFrame frame = capture.getFrames().poll();
Assert.assertThat("frame opcode",frame.getOpCode(),is(OpCode.CLOSE));
CloseInfo close = new CloseInfo(frame);
Assert.assertThat("close code",close.getStatusCode(),is(StatusCode.SHUTDOWN));
Assert.assertThat("close reason",close.getReason(),containsString("Timeout"));
}
finally
{

View File

@ -48,18 +48,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame());
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -81,18 +75,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -114,18 +102,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -147,18 +129,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -180,18 +156,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -213,18 +183,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -246,18 +210,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -284,19 +242,13 @@ public class TestABCase1 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.SLOW);
fuzzer.setSlowSendSegmentSize(segmentSize);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -314,18 +266,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame());
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -347,18 +293,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -380,18 +320,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -413,18 +347,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -446,18 +374,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -479,18 +401,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -512,18 +428,12 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
@ -550,19 +460,13 @@ public class TestABCase1 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(SendMode.SLOW);
fuzzer.setSlowSendSegmentSize(segmentSize);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
}

View File

@ -50,18 +50,13 @@ public class TestABCase2 extends AbstractABCase
WebSocketFrame expect = new PongFrame();
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -89,18 +84,13 @@ public class TestABCase2 extends AbstractABCase
send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -128,8 +118,7 @@ public class TestABCase2 extends AbstractABCase
send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -137,10 +126,6 @@ public class TestABCase2 extends AbstractABCase
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -159,18 +144,13 @@ public class TestABCase2 extends AbstractABCase
expect.add(new PongFrame().setPayload(copyOf(payload)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -179,8 +159,7 @@ public class TestABCase2 extends AbstractABCase
@Test
public void testCase2_3() throws Exception
{
byte payload[] = new byte[]
{ 0x00, (byte)0xFF, (byte)0xFE, (byte)0xFD, (byte)0xFC, (byte)0xFB, 0x00, (byte)0xFF };
byte payload[] = new byte[] { 0x00, (byte)0xFF, (byte)0xFE, (byte)0xFD, (byte)0xFC, (byte)0xFB, 0x00, (byte)0xFF };
List<WebSocketFrame> send = new ArrayList<>();
send.add(new PingFrame().setPayload(payload));
@ -190,18 +169,13 @@ public class TestABCase2 extends AbstractABCase
expect.add(new PongFrame().setPayload(copyOf(payload)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -221,18 +195,13 @@ public class TestABCase2 extends AbstractABCase
expect.add(new PongFrame().setPayload(copyOf(payload)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -241,32 +210,26 @@ public class TestABCase2 extends AbstractABCase
@Test
public void testCase2_5() throws Exception
{
try(StacklessLogging scope = new StacklessLogging(Parser.class))
try (StacklessLogging scope = new StacklessLogging(Parser.class))
{
byte payload[] = new byte[126]; // intentionally too big
Arrays.fill(payload,(byte)'5');
ByteBuffer buf = ByteBuffer.wrap(payload);
List<WebSocketFrame> send = new ArrayList<>();
// trick websocket frame into making extra large payload for ping
send.add(new BadFrame(OpCode.PING).setPayload(buf));
send.add(new CloseInfo(StatusCode.NORMAL,"Test 2.5").asFrame());
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.CLEAN);
}
finally
{
fuzzer.close();
}
}
}
@ -288,8 +251,7 @@ public class TestABCase2 extends AbstractABCase
expect.add(new PongFrame().setPayload(copyOf(payload)));
expect.add(new CloseInfo(StatusCode.NORMAL,"Test 2.6").asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -297,10 +259,6 @@ public class TestABCase2 extends AbstractABCase
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -316,18 +274,13 @@ public class TestABCase2 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -343,18 +296,13 @@ public class TestABCase2 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -372,17 +320,12 @@ public class TestABCase2 extends AbstractABCase
expect.add(new PongFrame().setPayload("our ping")); // our pong
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
}

View File

@ -51,18 +51,13 @@ public class TestABCase3 extends AbstractABCase
WebSocketFrame expect = new CloseInfo(StatusCode.PROTOCOL).asFrame();
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -80,18 +75,13 @@ public class TestABCase3 extends AbstractABCase
expect.add(new TextFrame().setPayload("small")); // echo on good frame
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -109,18 +99,13 @@ public class TestABCase3 extends AbstractABCase
expect.add(new TextFrame().setPayload("small")); // echo on good frame
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.PER_FRAME);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -138,8 +123,7 @@ public class TestABCase3 extends AbstractABCase
expect.add(new TextFrame().setPayload("small")); // echo on good frame
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -147,10 +131,6 @@ public class TestABCase3 extends AbstractABCase
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -168,18 +148,13 @@ public class TestABCase3 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -197,18 +172,13 @@ public class TestABCase3 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -230,17 +200,12 @@ public class TestABCase3 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
}

View File

@ -53,18 +53,13 @@ public class TestABCase4 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -82,18 +77,13 @@ public class TestABCase4 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -111,18 +101,13 @@ public class TestABCase4 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello")); // echo
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -132,7 +117,7 @@ public class TestABCase4 extends AbstractABCase
public void testCase4_1_4() throws Exception
{
ByteBuffer buf = ByteBuffer.wrap(StringUtil.getUtf8Bytes("bad"));
List<WebSocketFrame> send = new ArrayList<>();
send.add(new TextFrame().setPayload("hello"));
send.add(new BadFrame((byte)6).setPayload(buf)); // intentionally bad
@ -142,18 +127,13 @@ public class TestABCase4 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello")); // echo
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -163,7 +143,7 @@ public class TestABCase4 extends AbstractABCase
public void testCase4_1_5() throws Exception
{
ByteBuffer buf = ByteBuffer.wrap(StringUtil.getUtf8Bytes("bad"));
List<WebSocketFrame> send = new ArrayList<>();
send.add(new TextFrame().setPayload("hello"));
send.add(new BadFrame((byte)7).setPayload(buf)); // intentionally bad
@ -173,18 +153,13 @@ public class TestABCase4 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello")); // echo
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -199,18 +174,13 @@ public class TestABCase4 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -220,25 +190,20 @@ public class TestABCase4 extends AbstractABCase
public void testCase4_2_2() throws Exception
{
ByteBuffer buf = ByteBuffer.wrap(StringUtil.getUtf8Bytes("bad"));
List<WebSocketFrame> send = new ArrayList<>();
send.add(new BadFrame((byte)12).setPayload(buf)); // intentionally bad
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -256,18 +221,13 @@ public class TestABCase4 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello")); // echo
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -277,7 +237,7 @@ public class TestABCase4 extends AbstractABCase
public void testCase4_2_4() throws Exception
{
ByteBuffer buf = ByteBuffer.wrap(StringUtil.getUtf8Bytes("bad"));
List<WebSocketFrame> send = new ArrayList<>();
send.add(new TextFrame().setPayload("hello"));
send.add(new BadFrame((byte)14).setPayload(buf)); // intentionally bad
@ -287,18 +247,13 @@ public class TestABCase4 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello")); // echo
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -308,7 +263,7 @@ public class TestABCase4 extends AbstractABCase
public void testCase4_2_5() throws Exception
{
ByteBuffer buf = ByteBuffer.wrap(StringUtil.getUtf8Bytes("bad"));
List<WebSocketFrame> send = new ArrayList<>();
send.add(new TextFrame().setPayload("hello"));
send.add(new BadFrame((byte)15).setPayload(buf)); // intentionally bad
@ -318,17 +273,12 @@ public class TestABCase4 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello")); // echo
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
}

View File

@ -57,19 +57,14 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
}
/**
* Send continuation+fin, then text+fin (framewise)
@ -85,18 +80,13 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.PER_FRAME);
fuzzer.sendAndIgnoreBrokenPipe(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -113,8 +103,7 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -122,10 +111,6 @@ public class TestABCase5 extends AbstractABCase
fuzzer.sendAndIgnoreBrokenPipe(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -142,18 +127,13 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.sendAndIgnoreBrokenPipe(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -170,18 +150,13 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.PER_FRAME);
fuzzer.sendAndIgnoreBrokenPipe(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -198,8 +173,7 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -207,10 +181,6 @@ public class TestABCase5 extends AbstractABCase
fuzzer.sendAndIgnoreBrokenPipe(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -230,18 +200,13 @@ public class TestABCase5 extends AbstractABCase
expect.add(new TextFrame().setPayload("fragment1fragment2"));
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -262,18 +227,13 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.sendAndIgnoreBrokenPipe(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -294,18 +254,13 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -322,18 +277,13 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -365,8 +315,7 @@ public class TestABCase5 extends AbstractABCase
expect2.add(new TextFrame().setPayload("f1,f2,f3,f4,f5"));
expect2.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -382,10 +331,6 @@ public class TestABCase5 extends AbstractABCase
fuzzer.send(send2);
fuzzer.expect(expect2);
}
finally
{
fuzzer.close();
}
}
/**
@ -402,18 +347,13 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -442,8 +382,7 @@ public class TestABCase5 extends AbstractABCase
expect2.add(new TextFrame().setPayload("f1,f2,f3,f4,f5"));
expect2.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.PER_FRAME);
@ -456,10 +395,6 @@ public class TestABCase5 extends AbstractABCase
fuzzer.send(send2);
fuzzer.expect(expect2);
}
finally
{
fuzzer.close();
}
}
/**
@ -488,8 +423,7 @@ public class TestABCase5 extends AbstractABCase
expect2.add(new TextFrame().setPayload("f1,f2,f3,f4,f5"));
expect2.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -503,10 +437,6 @@ public class TestABCase5 extends AbstractABCase
fuzzer.send(send2);
fuzzer.expect(expect2);
}
finally
{
fuzzer.close();
}
}
/**
@ -524,18 +454,13 @@ public class TestABCase5 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello, world"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -553,18 +478,13 @@ public class TestABCase5 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello, world"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.PER_FRAME);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -582,8 +502,7 @@ public class TestABCase5 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello, world"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -591,10 +510,6 @@ public class TestABCase5 extends AbstractABCase
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -614,18 +529,13 @@ public class TestABCase5 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello, world"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -645,18 +555,13 @@ public class TestABCase5 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello, world"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.PER_FRAME);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -676,8 +581,7 @@ public class TestABCase5 extends AbstractABCase
expect.add(new TextFrame().setPayload("hello, world"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -685,10 +589,6 @@ public class TestABCase5 extends AbstractABCase
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -706,17 +606,12 @@ public class TestABCase5 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try(Fuzzer fuzzer = new Fuzzer(this);StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
}

View File

@ -90,18 +90,13 @@ public class TestABCase6 extends AbstractABCase
expect.add(new TextFrame());
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -120,18 +115,13 @@ public class TestABCase6 extends AbstractABCase
expect.add(new TextFrame());
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -150,18 +140,13 @@ public class TestABCase6 extends AbstractABCase
expect.add(new TextFrame().setPayload("middle"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -172,7 +157,7 @@ public class TestABCase6 extends AbstractABCase
{
String utf1 = "Hello-\uC2B5@\uC39F\uC3A4";
String utf2 = "\uC3BC\uC3A0\uC3A1-UTF-8!!";
ByteBuffer b1 = ByteBuffer.wrap(StringUtil.getUtf8Bytes(utf1));
ByteBuffer b2 = ByteBuffer.wrap(StringUtil.getUtf8Bytes(utf2));
@ -189,18 +174,13 @@ public class TestABCase6 extends AbstractABCase
expect.add(new TextFrame().setPayload(e1));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -220,18 +200,13 @@ public class TestABCase6 extends AbstractABCase
expect.add(new TextFrame().setPayload(ByteBuffer.wrap(msg)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -250,18 +225,13 @@ public class TestABCase6 extends AbstractABCase
expect.add(new TextFrame().setPayload(ByteBuffer.wrap(msg)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -279,18 +249,13 @@ public class TestABCase6 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.BAD_PAYLOAD).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -311,8 +276,7 @@ public class TestABCase6 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.BAD_PAYLOAD).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -325,10 +289,6 @@ public class TestABCase6 extends AbstractABCase
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -351,8 +311,7 @@ public class TestABCase6 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.BAD_PAYLOAD).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -363,10 +322,6 @@ public class TestABCase6 extends AbstractABCase
fuzzer.send(new ContinuationFrame().setPayload(ByteBuffer.wrap(part3)).setFin(true));
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -393,15 +348,13 @@ public class TestABCase6 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.BAD_PAYLOAD).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
ByteBuffer net = fuzzer.asNetworkBuffer(send);
int splits[] =
{ 17, 21, net.limit() };
int splits[] = { 17, 21, net.limit() };
ByteBuffer part1 = net.slice(); // Header + good UTF
part1.limit(splits[0]);
@ -419,12 +372,6 @@ public class TestABCase6 extends AbstractABCase
fuzzer.send(part3); // the rest (shouldn't work)
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.UNCLEAN);
}
finally
{
fuzzer.close();
}
}
}
@ -445,8 +392,7 @@ public class TestABCase6 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.BAD_PAYLOAD).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging scope = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging scope = new StacklessLogging(Parser.class))
{
fuzzer.connect();
@ -460,9 +406,5 @@ public class TestABCase6 extends AbstractABCase
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
}

View File

@ -163,18 +163,15 @@ public class TestABCase6_BadUTF extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.BAD_PAYLOAD).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging supress = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
fuzzer.expectServerDisconnect(Fuzzer.DisconnectMode.UNCLEAN);
}
finally
{
fuzzer.close();
try (StacklessLogging supress = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
}
}
}

View File

@ -139,17 +139,12 @@ public class TestABCase6_GoodUTF extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(msg)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
}

View File

@ -64,18 +64,13 @@ public class TestABCase7 extends AbstractABCase
expect.add(new TextFrame().setPayload("Hello World"));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -91,8 +86,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -100,10 +94,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -119,8 +109,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -128,10 +117,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -147,8 +132,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -156,10 +140,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -176,8 +156,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -185,10 +164,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -210,8 +185,7 @@ public class TestABCase7 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -219,10 +193,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -237,8 +207,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -246,10 +215,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -258,8 +223,7 @@ public class TestABCase7 extends AbstractABCase
@Test
public void testCase7_3_2() throws Exception
{
byte payload[] = new byte[]
{ 0x00 };
byte payload[] = new byte[] { 0x00 };
ByteBuffer buf = ByteBuffer.wrap(payload);
List<WebSocketFrame> send = new ArrayList<>();
@ -268,8 +232,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging scope = new StacklessLogging(Parser.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging scope = new StacklessLogging(Parser.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -277,10 +240,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -295,8 +254,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -304,10 +262,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -322,8 +276,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL,"Hic").asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -331,10 +284,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -353,8 +302,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.NORMAL,reason).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging logging = new StacklessLogging(AbstractWebSocketConnection.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging logging = new StacklessLogging(AbstractWebSocketConnection.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -362,10 +310,6 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -390,8 +334,7 @@ public class TestABCase7 extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.BAD_PAYLOAD).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try(StacklessLogging scope = new StacklessLogging(Parser.class,CloseInfo.class))
try (Fuzzer fuzzer = new Fuzzer(this); StacklessLogging scope = new StacklessLogging(Parser.class,CloseInfo.class))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -399,9 +342,5 @@ public class TestABCase7 extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
}

View File

@ -98,8 +98,7 @@ public class TestABCase7_BadStatusCodes extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -107,10 +106,6 @@ public class TestABCase7_BadStatusCodes extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -131,8 +126,7 @@ public class TestABCase7_BadStatusCodes extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseInfo(StatusCode.PROTOCOL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -140,9 +134,5 @@ public class TestABCase7_BadStatusCodes extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
}

View File

@ -93,8 +93,7 @@ public class TestABCase7_GoodStatusCodes extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseFrame().setPayload(clone(payload)));
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -102,10 +101,6 @@ public class TestABCase7_GoodStatusCodes extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
/**
@ -125,8 +120,7 @@ public class TestABCase7_GoodStatusCodes extends AbstractABCase
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new CloseFrame().setPayload(clone(payload)));
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
@ -134,9 +128,5 @@ public class TestABCase7_GoodStatusCodes extends AbstractABCase
fuzzer.expect(expect);
fuzzer.expectNoMoreFrames();
}
finally
{
fuzzer.close();
}
}
}

View File

@ -96,18 +96,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(toDataFrame(opcode).setPayload(copyOf(msg)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,8);
}
finally
{
fuzzer.close();
}
}
private void assertSlowFrameEcho(byte opcode, int overallMsgSize, int segmentSize) throws Exception
@ -124,8 +119,7 @@ public class TestABCase9 extends AbstractABCase
expect.add(toDataFrame(opcode).setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
@ -133,10 +127,6 @@ public class TestABCase9 extends AbstractABCase
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,8);
}
finally
{
fuzzer.close();
}
}
/**
@ -157,18 +147,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new TextFrame().setPayload(msg));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -189,18 +174,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -222,18 +202,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,4);
}
finally
{
fuzzer.close();
}
}
/**
@ -255,18 +230,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,8);
}
finally
{
fuzzer.close();
}
}
/**
@ -288,18 +258,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,16);
}
finally
{
fuzzer.close();
}
}
/**
@ -321,18 +286,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new TextFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,32);
}
finally
{
fuzzer.close();
}
}
/**
@ -352,18 +312,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(copyOf(data)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -384,18 +339,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
finally
{
fuzzer.close();
}
}
/**
@ -417,18 +367,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,4);
}
finally
{
fuzzer.close();
}
}
/**
@ -450,18 +395,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,8);
}
finally
{
fuzzer.close();
}
}
/**
@ -483,18 +423,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,16);
}
finally
{
fuzzer.close();
}
}
/**
@ -516,18 +451,13 @@ public class TestABCase9 extends AbstractABCase
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
Fuzzer fuzzer = new Fuzzer(this);
try
try(Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect,TimeUnit.SECONDS,32);
}
finally
{
fuzzer.close();
}
}
/**