use of com.zx.sms.codec.cmpp.msg.CmppDeliverRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppDeliverRequestMessageCodec method testchinesecode.
@Test
public void testchinesecode() {
CmppDeliverRequestMessage msg = createTestReq("1234567890123456789中01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
testlongCodec(msg);
}
use of com.zx.sms.codec.cmpp.msg.CmppDeliverRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppDeliverRequestMessageCodec method testlongCodec.
public void testlongCodec(CmppDeliverRequestMessage msg) {
channel().writeOutbound(msg);
ByteBuf buf = (ByteBuf) channel().readOutbound();
ByteBuf copybuf = Unpooled.buffer();
while (buf != null) {
copybuf.writeBytes(buf.copy());
int length = buf.readableBytes();
Assert.assertEquals(length, buf.readInt());
Assert.assertEquals(msg.getPacketType().getCommandId(), buf.readInt());
buf = (ByteBuf) channel().readOutbound();
}
CmppDeliverRequestMessage result = decode(copybuf);
System.out.println(result.getMsgContent());
Assert.assertEquals(msg.getMsgContent(), result.getMsgContent());
}
use of com.zx.sms.codec.cmpp.msg.CmppDeliverRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppDeliverRequestMessageCodec method testCodec.
@Test
public void testCodec() {
CmppDeliverRequestMessage msg = createTestReq("ad3 中");
test0(msg);
}
use of com.zx.sms.codec.cmpp.msg.CmppDeliverRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppDeliverRequestMessageCodec method testReportCodec.
@Test
public void testReportCodec() {
CmppDeliverRequestMessage msg = createTestReq("k k k ");
msg.setMsgContent((SmsMessage) null);
CmppReportRequestMessage reportRequestMessage = new CmppReportRequestMessage();
reportRequestMessage.setSmscSequence(0x1234L);
reportRequestMessage.setMsgId(new MsgId());
reportRequestMessage.setDestterminalId("13800138000");
reportRequestMessage.setStat("9876");
msg.setReportRequestMessage(reportRequestMessage);
test0(msg);
}
use of com.zx.sms.codec.cmpp.msg.CmppDeliverRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppDeliverRequestMessageCodec method testSLPUSH.
@Test
public void testSLPUSH() {
CmppDeliverRequestMessage msg = createTestReq("");
WapSLPush sl = new WapSLPush("http://www.baidu.com");
SmsMessage wap = new SmsWapPushMessage(sl);
msg.setMsgContent(wap);
CmppDeliverRequestMessage result = testWapCodec(msg);
SmsWapPushMessage smsmsg = (SmsWapPushMessage) result.getSmsMessage();
WapSLPush actsl = (WapSLPush) smsmsg.getWbxml();
Assert.assertEquals(sl.getUri(), actsl.getUri());
}
Aggregations