use of org.webpieces.data.api.DataWrapper in project webpieces by deanhiller.
the class TestHttp2Priority method testParsePriorityFrame.
@Test
public void testParsePriorityFrame() {
DataWrapper data = Util.hexToBytes(priorityFrame());
parser.parse(memento, data);
PriorityFrame frame = (PriorityFrame) assertGood();
Assert.assertEquals(1, frame.getStreamId());
PriorityDetails details = frame.getPriorityDetails();
Assert.assertTrue(details.isStreamDependencyIsExclusive());
Assert.assertEquals(5, details.getWeight());
Assert.assertEquals(4, details.getStreamDependency());
}
use of org.webpieces.data.api.DataWrapper in project webpieces by deanhiller.
the class TestHttp2Settings method testParseAck.
@Test
public void testParseAck() {
DataWrapper data = Util.hexToBytes(ackFrame());
parser.parse(memento, data);
SettingsFrame frame = (SettingsFrame) assertGood();
Assert.assertEquals(0, frame.getStreamId());
Assert.assertTrue(frame.isAck());
Assert.assertEquals(frame.getSettings().size(), 0);
}
use of org.webpieces.data.api.DataWrapper in project webpieces by deanhiller.
the class TestHttp2Ping method testParsePongFrame.
@Test
public void testParsePongFrame() {
DataWrapper data = Util.hexToBytes(getPongFrame());
parser.parse(memento, data);
PingFrame frame = (PingFrame) assertGood();
Assert.assertEquals(0, frame.getStreamId());
Assert.assertTrue(frame.isPingResponse());
}
use of org.webpieces.data.api.DataWrapper in project webpieces by deanhiller.
the class TestHttp2Ping method testParsePingFrame.
@Test
public void testParsePingFrame() {
DataWrapper data = Util.hexToBytes(getPingFrame());
parser.parse(memento, data);
PingFrame frame = (PingFrame) assertGood();
Assert.assertEquals(0, frame.getStreamId());
Assert.assertFalse(frame.isPingResponse());
}
use of org.webpieces.data.api.DataWrapper in project webpieces by deanhiller.
the class TestHttp2Data method testParseEndOfStreamTrue.
@Test
public void testParseEndOfStreamTrue() {
DataWrapper data = Util.hexToBytes(endStreamDataFrame());
parser.parse(memento, data);
DataFrame frame = (DataFrame) assertGood();
Assert.assertEquals(1, frame.getStreamId());
Assert.assertEquals(8, frame.getData().getReadableSize());
Assert.assertEquals(0, frame.getPadding().getReadableSize());
Assert.assertTrue(frame.isEndOfStream());
}
Aggregations