use of com.webpieces.http2parser.api.dto.PriorityFrame in project webpieces by deanhiller.
the class TestHttp2Priority method testMarshalPriorityFrame.
@Test
public void testMarshalPriorityFrame() {
PriorityFrame frame = new PriorityFrame();
frame.setStreamId(1);
PriorityDetails details = frame.getPriorityDetails();
details.setStreamDependency(4);
details.setStreamDependencyIsExclusive(true);
details.setWeight((short) 0x5);
byte[] data = parser.marshal(frame).createByteArray();
String hexFrame = Util.toHexString(data);
Assert.assertEquals(priorityFrame(), hexFrame);
}
use of com.webpieces.http2parser.api.dto.PriorityFrame in project webpieces by deanhiller.
the class TestHttp2Priority method testParsePriorityFrameMSB.
@Test
public void testParsePriorityFrameMSB() {
DataWrapper data = Util.hexToBytes(priorityFrameMSB());
parser.parse(memento, data);
PriorityFrame frame = (PriorityFrame) assertGood();
Assert.assertEquals(1, frame.getStreamId());
PriorityDetails details = frame.getPriorityDetails();
Assert.assertTrue(details.isStreamDependencyIsExclusive());
Assert.assertEquals(255, details.getWeight());
Assert.assertEquals(4, details.getStreamDependency());
}
Aggregations