Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2012-08-06 16:55:55 -0400
committerJoakim Erdfelt2012-08-06 16:55:55 -0400
commit365f4d8448b327b3b7533d55c3882b49d06a188a (patch)
treea874f5b9b3bcee7c302c4f1eb72f4fbbde984b8e /jetty-websocket
parentb8fc39a53eaf26bb6ef7d1a42da065279643c72a (diff)
downloadorg.eclipse.jetty.project-365f4d8448b327b3b7533d55c3882b49d06a188a.tar.gz
org.eclipse.jetty.project-365f4d8448b327b3b7533d55c3882b49d06a188a.tar.xz
org.eclipse.jetty.project-365f4d8448b327b3b7533d55c3882b49d06a188a.zip
Adding TestABCase9 with @Stress enabled
Diffstat (limited to 'jetty-websocket')
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABServlet.java12
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABSocket.java21
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/AllTests.java1
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/Fuzzer.java22
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase9.java777
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java19
-rw-r--r--jetty-websocket/websocket-server/src/test/resources/jetty-logging.properties1
7 files changed, 839 insertions, 14 deletions
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABServlet.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABServlet.java
index dec50ed7ba..decad4ab05 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABServlet.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABServlet.java
@@ -15,10 +15,14 @@ public class ABServlet extends WebSocketServlet
@Override
public void registerWebSockets(WebSocketServerFactory factory)
{
- factory.register(ABSocket.class);
+ // Test cases 9.x uses BIG frame sizes, let policy handle them.
+ int bigFrameSize = 20 * MBYTE;
+
+ factory.getPolicy().setBufferSize(bigFrameSize);
+ factory.getPolicy().setMaxPayloadSize(bigFrameSize);
+ factory.getPolicy().setMaxTextMessageSize(bigFrameSize);
+ factory.getPolicy().setMaxBinaryMessageSize(bigFrameSize);
- factory.getPolicy().setBufferSize(2 * MBYTE);
- factory.getPolicy().setMaxTextMessageSize(2 * MBYTE);
- factory.getPolicy().setMaxBinaryMessageSize(2 * MBYTE);
+ factory.register(ABSocket.class);
}
}
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABSocket.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABSocket.java
index 9465270228..eeb0a57fb6 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABSocket.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/ABSocket.java
@@ -20,6 +20,15 @@ public class ABSocket
private WebSocketConnection conn;
+ private String abbreviate(String message)
+ {
+ if (message.length() > 80)
+ {
+ return '"' + message.substring(0,80) + "\"...";
+ }
+ return '"' + message + '"';
+ }
+
@OnWebSocketMessage
public void onBinary(byte buf[], int offset, int len)
{
@@ -45,7 +54,17 @@ public class ABSocket
@OnWebSocketMessage
public void onText(String message)
{
- LOG.debug("onText({})",message);
+ if (LOG.isDebugEnabled())
+ {
+ if (message == null)
+ {
+ LOG.debug("onText() msg=null");
+ }
+ else
+ {
+ LOG.debug("onText() size={}, msg={}",message.length(),abbreviate(message));
+ }
+ }
// echo the message back.
try
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/AllTests.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/AllTests.java
index e65f7e8eff..ade652d8df 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/AllTests.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/AllTests.java
@@ -17,6 +17,7 @@ import org.junit.runners.Suite;
TestABCase7.class,
TestABCase7_GoodStatusCodes.class,
TestABCase7_BadStatusCodes.class,
+ TestABCase9.class
})
// @formatter:on
public class AllTests
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/Fuzzer.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/Fuzzer.java
index f6a7bbceb0..e0e648dd87 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/Fuzzer.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/Fuzzer.java
@@ -12,6 +12,7 @@ import java.util.concurrent.TimeoutException;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
+import org.eclipse.jetty.websocket.api.WebSocketPolicy;
import org.eclipse.jetty.websocket.protocol.CloseInfo;
import org.eclipse.jetty.websocket.protocol.Generator;
import org.eclipse.jetty.websocket.protocol.OpCode;
@@ -33,6 +34,9 @@ public class Fuzzer
SLOW
}
+ private static final int KBYTE = 1024;
+ private static final int MBYTE = KBYTE * KBYTE;
+
private static final Logger LOG = Log.getLogger(Fuzzer.class);
// Client side framing mask
@@ -47,7 +51,16 @@ public class Fuzzer
public Fuzzer(AbstractABCase testcase) throws Exception
{
- this.client = new BlockheadClient(testcase.getServer().getServerUri());
+ WebSocketPolicy policy = WebSocketPolicy.newClientPolicy();
+
+ int bigMessageSize = 20 * MBYTE;
+
+ policy.setBufferSize(bigMessageSize);
+ policy.setMaxPayloadSize(bigMessageSize);
+ policy.setMaxTextMessageSize(bigMessageSize);
+ policy.setMaxBinaryMessageSize(bigMessageSize);
+
+ this.client = new BlockheadClient(policy,testcase.getServer().getServerUri());
this.generator = testcase.getLaxGenerator();
this.testname = testcase.testname.getMethodName();
}
@@ -89,10 +102,15 @@ public class Fuzzer
public void expect(List<WebSocketFrame> expect) throws IOException, TimeoutException
{
+ expect(expect,TimeUnit.MILLISECONDS,500);
+ }
+
+ public void expect(List<WebSocketFrame> expect, TimeUnit unit, int duration) throws IOException, TimeoutException
+ {
int expectedCount = expect.size();
// Read frames
- IncomingFramesCapture capture = client.readFrames(expect.size(),TimeUnit.MILLISECONDS,500);
+ IncomingFramesCapture capture = client.readFrames(expect.size(),unit,duration);
if (LOG.isDebugEnabled())
{
capture.dump();
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase9.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase9.java
new file mode 100644
index 0000000000..337fa0dd37
--- /dev/null
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase9.java
@@ -0,0 +1,777 @@
+package org.eclipse.jetty.websocket.server.ab;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.jetty.toolchain.test.AdvancedRunner;
+import org.eclipse.jetty.toolchain.test.annotation.Stress;
+import org.eclipse.jetty.util.StringUtil;
+import org.eclipse.jetty.websocket.api.StatusCode;
+import org.eclipse.jetty.websocket.protocol.CloseInfo;
+import org.eclipse.jetty.websocket.protocol.OpCode;
+import org.eclipse.jetty.websocket.protocol.WebSocketFrame;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Big frame/message tests
+ */
+@RunWith(AdvancedRunner.class)
+public class TestABCase9 extends AbstractABCase
+{
+ private static final int KBYTE = 1024;
+ private static final int MBYTE = KBYTE * KBYTE;
+
+ private void assertMultiFrameEcho(byte opcode, int overallMsgSize, int fragmentSize) throws Exception
+ {
+ byte msg[] = new byte[overallMsgSize];
+ Arrays.fill(msg,(byte)'M');
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ byte frag[];
+ int remaining = msg.length;
+ int offset = 0;
+ boolean fin;
+ byte op = opcode;
+ while (remaining > 0)
+ {
+ int len = Math.min(remaining,fragmentSize);
+ frag = new byte[len];
+ System.arraycopy(msg,offset,frag,0,len);
+ remaining -= len;
+ fin = (remaining <= 0);
+ send.add(new WebSocketFrame(op).setPayload(frag).setFin(fin));
+ offset += len;
+ op = OpCode.CONTINUATION;
+ }
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(new WebSocketFrame(opcode).setPayload(msg));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ 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
+ {
+ byte msg[] = new byte[overallMsgSize];
+ Arrays.fill(msg,(byte)'M');
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(new WebSocketFrame(opcode).setPayload(msg));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(new WebSocketFrame(opcode).setPayload(msg));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.SLOW);
+ fuzzer.setSlowSendSegmentSize(segmentSize);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,8);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 64KB text message (1 frame)
+ */
+ @Test
+ public void testCase9_1_1() throws Exception
+ {
+ byte utf[] = new byte[64 * KBYTE];
+ Arrays.fill(utf,(byte)'y');
+ String msg = StringUtil.toUTF8String(utf,0,utf.length);
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.text(msg));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.text(msg));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 256KB text message (1 frame)
+ */
+ @Test
+ public void testCase9_1_2() throws Exception
+ {
+ byte utf[] = new byte[256 * KBYTE];
+ Arrays.fill(utf,(byte)'y');
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.text().setPayload(utf));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.text().setPayload(utf));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,2);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 1MB text message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_1_3() throws Exception
+ {
+ byte utf[] = new byte[1 * MBYTE];
+ Arrays.fill(utf,(byte)'y');
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.text().setPayload(utf));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.text().setPayload(utf));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,4);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 4MB text message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_1_4() throws Exception
+ {
+ byte utf[] = new byte[4 * MBYTE];
+ Arrays.fill(utf,(byte)'y');
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.text().setPayload(utf));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.text().setPayload(utf));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,8);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 8MB text message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_1_5() throws Exception
+ {
+ byte utf[] = new byte[8 * MBYTE];
+ Arrays.fill(utf,(byte)'y');
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.text().setPayload(utf));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.text().setPayload(utf));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,16);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 16MB text message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_1_6() throws Exception
+ {
+ byte utf[] = new byte[16 * MBYTE];
+ Arrays.fill(utf,(byte)'y');
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.text().setPayload(utf));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.text().setPayload(utf));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,32);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 64KB binary message (1 frame)
+ */
+ @Test
+ public void testCase9_2_1() throws Exception
+ {
+ byte data[] = new byte[64 * KBYTE];
+ Arrays.fill(data,(byte)0x21);
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.binary(data));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.binary(data));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 256KB binary message (1 frame)
+ */
+ @Test
+ public void testCase9_2_2() throws Exception
+ {
+ byte data[] = new byte[256 * KBYTE];
+ Arrays.fill(data,(byte)0x22);
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.binary().setPayload(data));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.binary().setPayload(data));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,2);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 1MB binary message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_2_3() throws Exception
+ {
+ byte data[] = new byte[1 * MBYTE];
+ Arrays.fill(data,(byte)0x23);
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.binary().setPayload(data));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.binary().setPayload(data));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,4);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 4MB binary message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_2_4() throws Exception
+ {
+ byte data[] = new byte[4 * MBYTE];
+ Arrays.fill(data,(byte)0x24);
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.binary().setPayload(data));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.binary().setPayload(data));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,8);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 8MB binary message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_2_5() throws Exception
+ {
+ byte data[] = new byte[8 * MBYTE];
+ Arrays.fill(data,(byte)0x25);
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.binary().setPayload(data));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.binary().setPayload(data));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,16);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Echo 16MB binary message (1 frame)
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_2_6() throws Exception
+ {
+ byte data[] = new byte[16 * MBYTE];
+ Arrays.fill(data,(byte)0x26);
+
+ List<WebSocketFrame> send = new ArrayList<>();
+ send.add(WebSocketFrame.binary().setPayload(data));
+ send.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ List<WebSocketFrame> expect = new ArrayList<>();
+ expect.add(WebSocketFrame.binary().setPayload(data));
+ expect.add(new CloseInfo(StatusCode.NORMAL).asFrame());
+
+ Fuzzer fuzzer = new Fuzzer(this);
+ try
+ {
+ fuzzer.connect();
+ fuzzer.setSendMode(Fuzzer.SendMode.BULK);
+ fuzzer.send(send);
+ fuzzer.expect(expect,TimeUnit.SECONDS,32);
+ }
+ finally
+ {
+ fuzzer.close();
+ }
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_1() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,64);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_2() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,256);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_3() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,1 * KBYTE);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_4() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,4 * KBYTE);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_5() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,16 * KBYTE);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_6() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,64 * KBYTE);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_7() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,256 * KBYTE);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_8() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,1 * MBYTE);
+ }
+
+ /**
+ * Send 4MB text message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_3_9() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.TEXT,4 * MBYTE,4 * MBYTE);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_1() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,64);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_2() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,256);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_3() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,1 * KBYTE);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_4() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,4 * KBYTE);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_5() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,16 * KBYTE);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_6() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,64 * KBYTE);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_7() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,256 * KBYTE);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_8() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,1 * MBYTE);
+ }
+
+ /**
+ * Send 4MB binary message in multiple frames.
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_4_9() throws Exception
+ {
+ assertMultiFrameEcho(OpCode.BINARY,4 * MBYTE,4 * MBYTE);
+ }
+
+ /**
+ * Send 1MB text message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_5_1() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.TEXT,1 * MBYTE,64);
+ }
+
+ /**
+ * Send 1MB text message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_5_2() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.TEXT,1 * MBYTE,128);
+ }
+
+ /**
+ * Send 1MB text message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_5_3() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.TEXT,1 * MBYTE,256);
+ }
+
+ /**
+ * Send 1MB text message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_5_4() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.TEXT,1 * MBYTE,512);
+ }
+
+ /**
+ * Send 1MB text message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_5_5() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.TEXT,1 * MBYTE,1024);
+ }
+
+ /**
+ * Send 1MB text message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_5_6() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.TEXT,1 * MBYTE,2048);
+ }
+
+ /**
+ * Send 1MB binary message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_6_1() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.BINARY,1 * MBYTE,64);
+ }
+
+ /**
+ * Send 1MB binary message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_6_2() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.BINARY,1 * MBYTE,128);
+ }
+
+ /**
+ * Send 1MB binary message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_6_3() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.BINARY,1 * MBYTE,256);
+ }
+
+ /**
+ * Send 1MB binary message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_6_4() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.BINARY,1 * MBYTE,512);
+ }
+
+ /**
+ * Send 1MB binary message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_6_5() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.BINARY,1 * MBYTE,1024);
+ }
+
+ /**
+ * Send 1MB binary message in 1 frame, but slowly
+ */
+ @Test
+ @Stress("High I/O use")
+ public void testCase9_6_6() throws Exception
+ {
+ assertSlowFrameEcho(OpCode.BINARY,1 * MBYTE,2048);
+ }
+}
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java
index 1cdb235664..0f806da89d 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java
@@ -107,6 +107,11 @@ public class BlockheadClient implements IncomingFrames, OutgoingFrames
public BlockheadClient(URI destWebsocketURI) throws URISyntaxException
{
+ this(WebSocketPolicy.newClientPolicy(),destWebsocketURI);
+ }
+
+ public BlockheadClient(WebSocketPolicy policy, URI destWebsocketURI) throws URISyntaxException
+ {
Assert.assertThat("Websocket URI scheme",destWebsocketURI.getScheme(),anyOf(is("ws"),is("wss")));
this.destWebsocketURI = destWebsocketURI;
String scheme = "http";
@@ -116,15 +121,15 @@ public class BlockheadClient implements IncomingFrames, OutgoingFrames
}
this.destHttpURI = new URI(scheme,destWebsocketURI.getSchemeSpecificPart(),destWebsocketURI.getFragment());
- policy = WebSocketPolicy.newClientPolicy();
- bufferPool = new StandardByteBufferPool(policy.getBufferSize());
- generator = new Generator(policy,bufferPool);
- parser = new Parser(policy);
- parseCount = new AtomicInteger(0);
+ this.policy = policy;
+ this.bufferPool = new StandardByteBufferPool(policy.getBufferSize());
+ this.generator = new Generator(policy,bufferPool);
+ this.parser = new Parser(policy);
+ this.parseCount = new AtomicInteger(0);
- incomingFrames = new IncomingFramesCapture();
+ this.incomingFrames = new IncomingFramesCapture();
- extensionRegistry = new WebSocketExtensionRegistry(policy,bufferPool);
+ this.extensionRegistry = new WebSocketExtensionRegistry(policy,bufferPool);
}
public void addExtensions(String xtension)
diff --git a/jetty-websocket/websocket-server/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-server/src/test/resources/jetty-logging.properties
index 880ca590b8..ff2072e284 100644
--- a/jetty-websocket/websocket-server/src/test/resources/jetty-logging.properties
+++ b/jetty-websocket/websocket-server/src/test/resources/jetty-logging.properties
@@ -18,4 +18,5 @@ org.eclipse.jetty.websocket.server.helper.RFCSocket.LEVEL=OFF
# org.eclipse.jetty.websocket.protocol.Generator.LEVEL=INFO
# org.eclipse.jetty.websocket.protocol.Parser.LEVEL=DEBUG
# org.eclipse.jetty.websocket.server.ab.LEVEL=DEBUG
+# org.eclipse.jetty.websocket.server.ab.Fuzzer.LEVEL=DEBUG
# org.eclipse.jetty.websocket.server.blockhead.LEVEL=DEBUG \ No newline at end of file

Back to the top