public class TextPayloadParserTest
{
@Test
public void testFrameTooLargeDueToPolicy() throws Exception
{
WebSocketPolicy policy = new WebSocketPolicy(WebSocketBehavior.SERVER);
// Artificially small buffer/payload
policy.setInputBufferSize(1024); // read buffer
policy.setMaxTextMessageBufferSize(1024); // streaming buffer (not used in this test)
policy.setMaxTextMessageSize(1024); // actual maximum text message size policy
byte utf[] = new byte[2048];
Arrays.fill(utf,(byte)'a');
Assert.assertThat("Must be a medium length payload",utf.length,allOf(greaterThan(0x7E),lessThan(0xFFFF)));