use of org.marre.wap.push.SmsMmsNotificationMessage 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 org.marre.wap.push.SmsMmsNotificationMessage in project SMSGate by Lihuanghe.
the class TestSMPP2CMPPDeliverCodec method testMMSPUSH.
@Test
public void testMMSPUSH() {
CmppDeliverRequestMessage 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);
msg.setMsgContent(mms);
mms.setTransactionId("ABC");
CmppDeliverRequestMessage result = testWapCodec(msg);
SmsMmsNotificationMessage smsmsg = (SmsMmsNotificationMessage) result.getSmsMessage();
Assert.assertEquals(smsmsg.getContentLocation_(), smsmsg.getContentLocation_());
}
use of org.marre.wap.push.SmsMmsNotificationMessage in project SMSGate by Lihuanghe.
the class TestSMPP2CMPPSubmitCodec 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 org.marre.wap.push.SmsMmsNotificationMessage in project SMSGate by Lihuanghe.
the class TestSerializeSmsMessage method test.
@Test
public void test() throws IOException, ClassNotFoundException {
List<SmsMessage> list = new ArrayList<SmsMessage>();
list.add(CMPPCommonUtil.buildTextMessage("test"));
list.add(new SmsPortAddressedTextMessage(SmsPort.NOKIA_CLI_LOGO, SmsPort.NOKIA_IAC, "testporttext"));
list.add(new SmsMmsNotificationMessage("http://www.baidu.com/abc/sfd", 50 * 1024));
WapSIPush si = new WapSIPush("http://www.baidu.com", "baidu");
SmsMessage siwap = new SmsWapPushMessage(si);
list.add(siwap);
WapSLPush sl = new WapSLPush("http://www.baidu.com");
SmsMessage slwap = new SmsWapPushMessage(sl);
list.add(slwap);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bos);
out.writeObject(list);
byte[] b = bos.toByteArray();
System.out.println(b.length);
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(b));
List<SmsMessage> result = (List<SmsMessage>) in.readObject();
Assert.assertEquals(((SmsTextMessage) list.get(0)).getText(), ((SmsTextMessage) result.get(0)).getText());
Assert.assertEquals(((SmsPortAddressedTextMessage) list.get(1)).getText(), ((SmsPortAddressedTextMessage) result.get(1)).getText());
Assert.assertEquals(((SmsPortAddressedTextMessage) list.get(1)).getDcs().getValue(), ((SmsPortAddressedTextMessage) result.get(1)).getDcs().getValue());
Assert.assertEquals(((SmsPortAddressedTextMessage) list.get(1)).getDestPort_(), ((SmsPortAddressedTextMessage) result.get(1)).getDestPort_());
Assert.assertEquals(((SmsPortAddressedTextMessage) list.get(1)).getOrigPort_(), ((SmsPortAddressedTextMessage) result.get(1)).getOrigPort_());
Assert.assertEquals(((SmsMmsNotificationMessage) list.get(2)).getContentLocation_(), ((SmsMmsNotificationMessage) result.get(2)).getContentLocation_());
Assert.assertEquals(((SmsMmsNotificationMessage) list.get(2)).getDestPort_(), ((SmsMmsNotificationMessage) result.get(2)).getDestPort_());
Assert.assertEquals(((SmsMmsNotificationMessage) list.get(2)).getOrigPort_(), ((SmsMmsNotificationMessage) result.get(2)).getOrigPort_());
Assert.assertEquals(((SmsWapPushMessage) list.get(3)).getDestPort_(), ((SmsWapPushMessage) result.get(3)).getDestPort_());
Assert.assertEquals(((SmsWapPushMessage) list.get(3)).getOrigPort_(), ((SmsWapPushMessage) result.get(3)).getOrigPort_());
Assert.assertEquals(((WapSIPush) ((SmsWapPushMessage) list.get(3)).getWbxml()).getUri(), ((WapSIPush) ((SmsWapPushMessage) result.get(3)).getWbxml()).getUri());
Assert.assertEquals(((SmsWapPushMessage) list.get(4)).getDestPort_(), ((SmsWapPushMessage) result.get(4)).getDestPort_());
Assert.assertEquals(((SmsWapPushMessage) list.get(4)).getOrigPort_(), ((SmsWapPushMessage) result.get(4)).getOrigPort_());
Assert.assertEquals(((WapSLPush) ((SmsWapPushMessage) list.get(4)).getWbxml()).getUri(), ((WapSLPush) ((SmsWapPushMessage) result.get(4)).getWbxml()).getUri());
}
use of org.marre.wap.push.SmsMmsNotificationMessage in project SMSGate by Lihuanghe.
the class TestCmppDeliverRequestMessageCodec method testMMSPUSH.
@Test
public void testMMSPUSH() {
CmppDeliverRequestMessage 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);
msg.setMsgContent(mms);
mms.setTransactionId("ABC");
CmppDeliverRequestMessage result = testWapCodec(msg);
SmsMmsNotificationMessage smsmsg = (SmsMmsNotificationMessage) result.getSmsMessage();
Assert.assertEquals(smsmsg.getContentLocation_(), smsmsg.getContentLocation_());
}
Aggregations