Examples of assertHasFrame()


Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        IncomingFramesCapture capture = new IncomingFramesCapture();
        parser.setIncomingFramesHandler(capture);
        parser.parse(expected);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.PING,1);

        Frame pActual = capture.getFrames().poll();
        Assert.assertThat("PingFrame.payloadLength",pActual.getPayloadLength(),is(bytes.length));
        Assert.assertEquals("PingFrame.payload",bytes.length,pActual.getPayloadLength());
    }
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        IncomingFramesCapture capture = new IncomingFramesCapture();
        parser.setIncomingFramesHandler(capture);
        parser.parse(expected);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.PING,1);

        Frame pActual = capture.getFrames().poll();
        Assert.assertThat("PingFrame.payloadLength",pActual.getPayloadLength(),is(bytes.length));
        Assert.assertEquals("PingFrame.payload",bytes.length,pActual.getPayloadLength());
    }
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        IncomingFramesCapture capture = new IncomingFramesCapture();
        parser.setIncomingFramesHandler(capture);
        parser.parse(expected);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.PING,1);

        Frame pActual = capture.getFrames().poll();
        Assert.assertThat("PingFrame.payloadLength",pActual.getPayloadLength(),is(0));
        Assert.assertEquals("PingFrame.payload",0,pActual.getPayloadLength());
    }
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        IncomingFramesCapture capture = new IncomingFramesCapture();
        parser.setIncomingFramesHandler(capture);
        parser.parse(expected);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.PING,1);

        Frame pActual = capture.getFrames().poll();
        Assert.assertThat("PingFrame.payloadLength",pActual.getPayloadLength(),is(message.length()));
        Assert.assertEquals("PingFrame.payload",message.length(),pActual.getPayloadLength());
    }
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        parser.parse(ByteBuffer.wrap(raw));

        int len = expectedTextDatas.length;
        capture.assertFrameCount(len);
        capture.assertHasFrame(OpCode.TEXT, len);

        int i = 0;
        for (WebSocketFrame actual : capture.getFrames())
        {
            String prefix = "Frame[" + i + "]";
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        // Parse #2
        BufferUtil.flipToFlush(buf,0);
        parser.parse(buf);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.TEXT,1);
        capture.assertHasFrame(OpCode.CONTINUATION,1);

        WebSocketFrame txt = capture.getFrames().poll();
        String actual = BufferUtil.toUTF8String(txt.getPayload());
        Assert.assertThat("TextFrame[0].data",actual,is("Hel"));
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        String payload = "Are you there?";
        Frame ping = new PingFrame().setPayload(payload);
        ext.incomingFrame(ping);

        capture.assertFrameCount(1);
        capture.assertHasFrame(OpCode.PING, 1);
        WebSocketFrame actual = capture.getFrames().poll();

        Assert.assertThat("Frame.opcode", actual.getOpCode(), is(OpCode.PING));
        Assert.assertThat("Frame.fin", actual.isFin(), is(true));
        Assert.assertThat("Frame.rsv1", actual.isRsv1(), is(false));
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        BufferUtil.flipToFlush(buf,0);
        parser.parse(buf);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.TEXT,1);
        capture.assertHasFrame(OpCode.CONTINUATION,1);

        WebSocketFrame txt = capture.getFrames().poll();
        String actual = BufferUtil.toUTF8String(txt.getPayload());
        Assert.assertThat("TextFrame[0].data",actual,is("Hel"));
        txt = capture.getFrames().poll();
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

            ext.incomingFrame(frame);
        }

        int len = quote.size();
        capture.assertFrameCount(len);
        capture.assertHasFrame(OpCode.TEXT, len);

        String prefix;
        int i = 0;
        for (WebSocketFrame actual : capture.getFrames())
        {
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.IncomingFramesCapture.assertHasFrame()

        IncomingFramesCapture capture = new IncomingFramesCapture();
        parser.setIncomingFramesHandler(capture);
        parser.parse(buf);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.PONG,1);

        WebSocketFrame pong = capture.getFrames().poll();
        String actual = BufferUtil.toUTF8String(pong.getPayload());
        Assert.assertThat("PongFrame.payload",actual,is("Hello"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.