Search in sources :

Example 1 with SmsPort

use of org.marre.sms.SmsPort 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());
}
Also used : Random(java.util.Random) SmsPort(org.marre.sms.SmsPort) CmppSubmitRequestMessage(com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage) SmsPortAddressedTextMessage(org.marre.sms.SmsPortAddressedTextMessage) Test(org.junit.Test)

Example 2 with SmsPort

use of org.marre.sms.SmsPort in project SMSGate by Lihuanghe.

the class TestSMPP2CMPPSubmitCodec 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());
}
Also used : Random(java.util.Random) SmsPort(org.marre.sms.SmsPort) CmppSubmitRequestMessage(com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage) SmsPortAddressedTextMessage(org.marre.sms.SmsPortAddressedTextMessage) Test(org.junit.Test)

Aggregations

CmppSubmitRequestMessage (com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage)2 Random (java.util.Random)2 Test (org.junit.Test)2 SmsPort (org.marre.sms.SmsPort)2 SmsPortAddressedTextMessage (org.marre.sms.SmsPortAddressedTextMessage)2