use of com.zx.sms.codec.cmpp.msg.CmppActiveTestRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppActiveTestRequestMessageCodec method testCodec.
@Test
public void testCodec() {
CmppActiveTestRequestMessage msg = createMsg();
ByteBuf buf = encode(msg);
ByteBuf copybuf = buf.copy();
Assert.assertEquals(12, buf.readableBytes());
Assert.assertEquals(12, buf.readInt());
Assert.assertEquals(msg.getPacketType().getCommandId(), buf.readInt());
Assert.assertEquals(msg.getHeader().getSequenceId(), buf.readInt());
CmppActiveTestRequestMessage result = decode(copybuf);
Assert.assertTrue(result instanceof CmppActiveTestRequestMessage);
Assert.assertEquals(msg.getHeader().getSequenceId(), ((CmppActiveTestRequestMessage) result).getHeader().getSequenceId());
System.out.println(msg.getHeader());
}
Aggregations