use of org.marre.wap.push.WapSIPush in project SMSGate by Lihuanghe.
the class TestSMPP2CMPPDeliverCodec method testSIPUSH.
@Test
public void testSIPUSH() {
CmppDeliverRequestMessage msg = createTestReq("");
WapSIPush si = new WapSIPush("http://www.baidu.com", "baidu");
SmsMessage wap = new SmsWapPushMessage(si);
msg.setMsgContent(wap);
CmppDeliverRequestMessage result = testWapCodec(msg);
SmsWapPushMessage smsmsg = (SmsWapPushMessage) result.getSmsMessage();
WapSIPush actsi = (WapSIPush) smsmsg.getWbxml();
Assert.assertEquals(si.getUri(), actsi.getUri());
Assert.assertEquals(si.getMessage(), actsi.getMessage());
}
use of org.marre.wap.push.WapSIPush in project SMSGate by Lihuanghe.
the class TestSMPP2CMPPSubmitCodec method testSIPUSH.
@Test
public void testSIPUSH() {
CmppSubmitRequestMessage msg = createTestReq("");
WapSIPush si = new WapSIPush("http://www.baidu.com", "baidu");
SmsMessage wap = new SmsWapPushMessage(si);
msg.setMsgContent(wap);
CmppSubmitRequestMessage result = testWapCodec(msg);
SmsWapPushMessage smsmsg = (SmsWapPushMessage) result.getSmsMessage();
WapSIPush actsi = (WapSIPush) smsmsg.getWbxml();
Assert.assertEquals(si.getUri(), actsi.getUri());
Assert.assertEquals(si.getMessage(), actsi.getMessage());
}
use of org.marre.wap.push.WapSIPush 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.WapSIPush in project SMSGate by Lihuanghe.
the class TestCmppDeliverRequestMessageCodec method testSIPUSH.
@Test
public void testSIPUSH() {
CmppDeliverRequestMessage msg = createTestReq("");
WapSIPush si = new WapSIPush("http://www.baidu.com", "baidu");
SmsMessage wap = new SmsWapPushMessage(si);
msg.setMsgContent(wap);
CmppDeliverRequestMessage result = testWapCodec(msg);
SmsWapPushMessage smsmsg = (SmsWapPushMessage) result.getSmsMessage();
WapSIPush actsi = (WapSIPush) smsmsg.getWbxml();
Assert.assertEquals(si.getUri(), actsi.getUri());
Assert.assertEquals(si.getMessage(), actsi.getMessage());
}
use of org.marre.wap.push.WapSIPush in project SMSGate by Lihuanghe.
the class TestCmppSubmitRequestMessageCodec method testSIPUSH.
@Test
public void testSIPUSH() {
CmppSubmitRequestMessage msg = createTestReq("");
WapSIPush si = new WapSIPush("http://www.baidu.com", "baidu");
SmsMessage wap = new SmsWapPushMessage(si);
msg.setMsgContent(wap);
CmppSubmitRequestMessage result = testWapCodec(msg);
SmsWapPushMessage smsmsg = (SmsWapPushMessage) result.getSmsMessage();
WapSIPush actsi = (WapSIPush) smsmsg.getWbxml();
Assert.assertEquals(si.getUri(), actsi.getUri());
Assert.assertEquals(si.getMessage(), actsi.getMessage());
}
Aggregations