use of org.eclipse.jetty.websocket.common.frames.BinaryFrame in project jetty.project by eclipse.
the class TestABCase1 method testCase1_2_4.
/**
* Echo 127 byte BINARY message (uses medium 2 byte payload length)
* @throws Exception on test failure
*/
@Test
public void testCase1_2_4() throws Exception {
byte[] payload = new byte[127];
Arrays.fill(payload, (byte) 0xFE);
ByteBuffer buf = ByteBuffer.wrap(payload);
List<WebSocketFrame> send = new ArrayList<>();
send.add(new BinaryFrame().setPayload(buf));
send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
try (Fuzzer fuzzer = new Fuzzer(this)) {
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
}
use of org.eclipse.jetty.websocket.common.frames.BinaryFrame in project jetty.project by eclipse.
the class TestABCase1 method testCase1_2_6.
/**
* Echo 65535 byte BINARY message (uses medium 2 byte payload length)
* @throws Exception on test failure
*/
@Test
public void testCase1_2_6() throws Exception {
byte[] payload = new byte[65535];
Arrays.fill(payload, (byte) 0xFE);
ByteBuffer buf = ByteBuffer.wrap(payload);
List<WebSocketFrame> send = new ArrayList<>();
send.add(new BinaryFrame().setPayload(buf));
send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
try (Fuzzer fuzzer = new Fuzzer(this)) {
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
}
use of org.eclipse.jetty.websocket.common.frames.BinaryFrame in project jetty.project by eclipse.
the class TestABCase1 method testCase1_2_7.
/**
* Echo 65536 byte BINARY message (uses large 8 byte payload length)
* @throws Exception on test failure
*/
@Test
public void testCase1_2_7() throws Exception {
byte[] payload = new byte[65536];
Arrays.fill(payload, (byte) 0xFE);
ByteBuffer buf = ByteBuffer.wrap(payload);
List<WebSocketFrame> send = new ArrayList<>();
send.add(new BinaryFrame().setPayload(buf));
send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
try (Fuzzer fuzzer = new Fuzzer(this)) {
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
}
use of org.eclipse.jetty.websocket.common.frames.BinaryFrame in project jetty.project by eclipse.
the class TestABCase1 method testCase1_2_3.
/**
* Echo 126 byte BINARY message (uses medium 2 byte payload length)
* @throws Exception on test failure
*/
@Test
public void testCase1_2_3() throws Exception {
byte[] payload = new byte[126];
Arrays.fill(payload, (byte) 0xFE);
ByteBuffer buf = ByteBuffer.wrap(payload);
List<WebSocketFrame> send = new ArrayList<>();
send.add(new BinaryFrame().setPayload(buf));
send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
try (Fuzzer fuzzer = new Fuzzer(this)) {
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
}
use of org.eclipse.jetty.websocket.common.frames.BinaryFrame in project jetty.project by eclipse.
the class TestABCase1 method testCase1_2_5.
/**
* Echo 128 byte BINARY message (uses medium 2 byte payload length)
* @throws Exception on test failure
*/
@Test
public void testCase1_2_5() throws Exception {
byte[] payload = new byte[128];
Arrays.fill(payload, (byte) 0xFE);
ByteBuffer buf = ByteBuffer.wrap(payload);
List<WebSocketFrame> send = new ArrayList<>();
send.add(new BinaryFrame().setPayload(buf));
send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
List<WebSocketFrame> expect = new ArrayList<>();
expect.add(new BinaryFrame().setPayload(clone(buf)));
expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
try (Fuzzer fuzzer = new Fuzzer(this)) {
fuzzer.connect();
fuzzer.setSendMode(SendMode.BULK);
fuzzer.send(send);
fuzzer.expect(expect);
}
}
Aggregations