use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class DeflateFrameExtensionTest method testChrome20_Info.
@Test
public void testChrome20_Info() {
Tester tester = serverExtensions.newTester("deflate-frame");
tester.assertNegotiated("deflate-frame");
// Captured from Chrome 20.x - "info:" (sent from browser)
tester.parseIncomingHex(// example payload
"c187ca4def7f0081a4b47d4fef");
tester.assertHasFrames("info:");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class DeflateFrameExtensionTest method testChrome20_HelloThere.
@Test
public void testChrome20_HelloThere() {
Tester tester = serverExtensions.newTester("deflate-frame");
tester.assertNegotiated("deflate-frame");
// Captured from Chrome 20.x - "Hello" then "There" (sent from browser)
tester.parseIncomingHex(// "Hello"
"c1877b1971db8951bc12b21e71", // There
"c18759edc8f4532480d913e8c8");
tester.assertHasFrames("Hello", "There");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class DeflateFrameExtensionTest method testPyWebSocket_TimeTimeTime.
@Test
public void testPyWebSocket_TimeTimeTime() {
Tester tester = serverExtensions.newTester("deflate-frame");
tester.assertNegotiated("deflate-frame");
// Captured from Pywebsocket (r781) - "time:" sent 3 times.
tester.parseIncomingHex(// "time:"
"c1876b100104" + "41d9cd49de1201", // "time:"
"c1852ae3ff01" + "00e2ee012a", // "time:"
"c18435558caa" + "37468caa");
tester.assertHasFrames("time:", "time:", "time:");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class DeflateFrameExtensionTest method testBlockheadClient_HelloThere.
@Test
public void testBlockheadClient_HelloThere() {
Tester tester = serverExtensions.newTester("deflate-frame");
tester.assertNegotiated("deflate-frame");
// Captured from Blockhead Client - "Hello" then "There" via unit test
tester.parseIncomingHex(// "Hello"
"c18700000000f248cdc9c90700", // "There"
"c187000000000ac9482d4a0500");
tester.assertHasFrames("Hello", "There");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class PerMessageDeflateExtensionTest method testDraft21_Hello_UnCompressedBlock_Fragmented.
/**
* Decode payload example as seen in draft-ietf-hybi-permessage-compression-21.
* <p>
* Section 8.2.3.1: A message compressed using 1 compressed DEFLATE block (with fragmentation)
*/
@Test
public void testDraft21_Hello_UnCompressedBlock_Fragmented() {
Tester tester = clientExtensions.newTester("permessage-deflate");
tester.assertNegotiated("permessage-deflate");
// basic, 1 block, compressed with 0 compression level (aka, uncompressed).
tester.parseIncomingHex(// Fragment 1
"0x41 0x03 0xf2 0x48 0xcd", // Fragment 2
"0x80 0x04 0xc9 0xc9 0x07 0x00");
tester.assertHasFrames(new TextFrame().setPayload("He").setFin(false), new ContinuationFrame().setPayload("llo").setFin(true));
}
Aggregations