use of com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppSubmitRequestMessageCodec method testPortTextSMSH.
@Test
public void testPortTextSMSH() {
Random rnd_ = new Random();
CmppSubmitRequestMessage msg = createTestReq("");
SmsPortAddressedTextMessage textMsg = new SmsPortAddressedTextMessage(new SmsPort(rnd_.nextInt() & 0xffff, ""), new SmsPort(rnd_.nextInt() & 0xffff, ""), "这是一条端口文本短信");
msg.setMsgContent(textMsg);
CmppSubmitRequestMessage result = testWapCodec(msg);
SmsPortAddressedTextMessage smsmsg = (SmsPortAddressedTextMessage) result.getSmsMessage();
Assert.assertEquals(textMsg.getDestPort_(), smsmsg.getDestPort_());
Assert.assertEquals(textMsg.getOrigPort_(), smsmsg.getOrigPort_());
Assert.assertEquals(textMsg.getText(), smsmsg.getText());
}
use of com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppSubmitRequestMessageCodec method testMMSPUSH.
@Test
public void testMMSPUSH() {
CmppSubmitRequestMessage msg = createTestReq("");
SmsMmsNotificationMessage mms = new SmsMmsNotificationMessage("https://www.baidu.com/s?wd=SMPPv3.4%20%E9%95%BF%E7%9F%AD%E4%BF%A1&rsv_spt=1&rsv_iqid=0xdd4666100001e74c&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&rqlang=cn&tn=baiduhome_pg&rsv_enter=0&oq=SMPPv%2526lt%253B.4%2520ton%2520npi&rsv_t=50fdNrphqry%2FYfHh29wvp8KzJ9ogqigiPr33FT%2FpcGQu6X34vByQNu4O%2FLNZgIiXdd16&inputT=3203&rsv_pq=d576ead9000016eb&rsv_sug3=60&rsv_sug1=15&rsv_sug7=000&rsv_sug2=0&rsv_sug4=3937&rsv_sug=1", 50 * 1024);
mms.setFrom("10085");
mms.setSubject("这是一条测试彩信,彩信消息ID是:121241");
msg.setMsgContent(mms);
CmppSubmitRequestMessage result = testWapCodec(msg);
SmsMmsNotificationMessage smsmsg = (SmsMmsNotificationMessage) result.getSmsMessage();
Assert.assertEquals(mms.getSubject_(), smsmsg.getSubject_());
Assert.assertEquals(mms.getContentLocation_(), smsmsg.getContentLocation_());
Assert.assertEquals(mms.getFrom_(), smsmsg.getFrom_());
}
use of com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppSubmitRequestMessageCodec method testSLPUSH.
@Test
public void testSLPUSH() {
CmppSubmitRequestMessage msg = createTestReq("");
WapSLPush sl = new WapSLPush("http://www.baidu.com");
SmsMessage wap = new SmsWapPushMessage(sl);
msg.setMsgContent(wap);
CmppSubmitRequestMessage result = testWapCodec(msg);
SmsWapPushMessage smsmsg = (SmsWapPushMessage) result.getSmsMessage();
WapSLPush actsl = (WapSLPush) smsmsg.getWbxml();
Assert.assertEquals(sl.getUri(), actsl.getUri());
}
use of com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage in project SMSGate by Lihuanghe.
the class TestCmppSubmitRequestMessageCodec method testseptedMsg.
@Test
public void testseptedMsg() {
String origin = "112aaaasssss2334455@£$¥èéùìòçØøÅåΔ_ΦΓΛΩΠΨΣΘΞ^{}\\[~]|€ÆæßÉ!\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà";
CmppSubmitRequestMessage msg = createTestReq(origin);
msg.setMsgContent(new SmsTextMessage(origin));
CmppSubmitRequestMessage ret = testWapCodec(msg);
Assert.assertEquals(msg.getMsgContent(), ret.getMsgContent());
}
use of com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage in project SMSGate by Lihuanghe.
the class TestSMPP2CMPPSubmitCodec method testseptedMsg.
@Test
public void testseptedMsg() {
String origin = "112aaaasssss2334455@£$¥èéùìòçØøÅåΔ_ΦΓΛΩΠΨΣΘΞ^{}\\[~]|€ÆæßÉ!\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà";
System.out.println(origin);
CmppSubmitRequestMessage msg = createTestReq(origin);
msg.setMsgContent(new SmsTextMessage(origin));
CmppSubmitRequestMessage ret = testWapCodec(msg);
Assert.assertEquals(msg.getMsgContent(), ret.getMsgContent());
}
Aggregations