Search in sources :

Example 1 with MsgId

use of com.zx.sms.codec.smgp.msg.MsgId in project SMSGate by Lihuanghe.

the class TestSMGPDeliverMessage method test2.

@Test
public void test2() {
    SMGPDeliverMessage msg = new SMGPDeliverMessage();
    msg.setDestTermId("13800138000");
    msg.setLinkId("1023rsd");
    msg.setMsgContent("第一种:通过注解@PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作,第一种:通过注解@PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作");
    msg.setMsgId(new MsgId());
    msg.setSrcTermId("10086988");
    testlongCodec(msg);
}
Also used : SMGPDeliverMessage(com.zx.sms.codec.smgp.msg.SMGPDeliverMessage) MsgId(com.zx.sms.codec.smgp.msg.MsgId) Test(org.junit.Test)

Example 2 with MsgId

use of com.zx.sms.codec.smgp.msg.MsgId in project SMSGate by Lihuanghe.

the class TestSMGPMsgIdUtil method testMsgid.

@Test
public void testMsgid() throws Exception {
    MsgId m = new MsgId();
    byte[] arr = SMGPMsgIdUtil.msgId2Bytes(m);
    System.out.println(m.toString());
    Assert.assertEquals(m, SMGPMsgIdUtil.bytes2MsgId(arr));
    arr = Hex.decodeHex("69643a6495c36ac4ea6b00000b7375623a30303120646c7672643a303031207375626d69745f646174653a3138303730353232303720646f6e655f646174653a3138303730353232303720737461743a44454c49565244206572723a303030207478743ad6d0b9fa306138616535".toCharArray());
    System.out.println(new String(Hex.decodeHex("20737461743a206572723a207478743a".toCharArray())));
    SMGPReportData tmpreport = new SMGPReportData();
    tmpreport.fromBytes(arr);
    System.out.println(tmpreport.toString());
}
Also used : SMGPReportData(com.zx.sms.codec.smgp.msg.SMGPReportData) MsgId(com.zx.sms.codec.smgp.msg.MsgId) Test(org.junit.Test)

Example 3 with MsgId

use of com.zx.sms.codec.smgp.msg.MsgId in project SMSGate by Lihuanghe.

the class TestSMGPMsgIdUtil method testSequenceNumber.

@Test
public void testSequenceNumber() throws Exception {
    com.zx.sms.common.util.MsgId msgid = new com.zx.sms.common.util.MsgId();
    SequenceNumber t = new SequenceNumber(msgid);
    System.out.println(msgid);
    System.out.println(t);
    Assert.assertEquals(msgid.toString().substring(0, 10), t.toString().subSequence(10, 20));
}
Also used : SequenceNumber(com.zx.sms.common.util.SequenceNumber) MsgId(com.zx.sms.codec.smgp.msg.MsgId) Test(org.junit.Test)

Example 4 with MsgId

use of com.zx.sms.codec.smgp.msg.MsgId in project SMSGate by Lihuanghe.

the class TestSMGPMsgIdUtil method testMsgid1.

@Test
public void testMsgid1() throws Exception {
    MsgId m = new MsgId("12345607091206000017");
    byte[] arr = SMGPMsgIdUtil.msgId2Bytes(m);
    Assert.assertEquals(m, SMGPMsgIdUtil.bytes2MsgId(arr));
    m = SMGPMsgIdUtil.bytes2MsgId(Hex.decodeHex("0000ff06121423277475"));
    arr = SMGPMsgIdUtil.msgId2Bytes(m);
    Assert.assertEquals(m, SMGPMsgIdUtil.bytes2MsgId(arr));
}
Also used : MsgId(com.zx.sms.codec.smgp.msg.MsgId) Test(org.junit.Test)

Example 5 with MsgId

use of com.zx.sms.codec.smgp.msg.MsgId in project SMSGate by Lihuanghe.

the class SMGPSubmitLongMessageHandler method response.

@Override
protected BaseMessage response(SMGPSubmitMessage msg) {
    // 短信片断未接收完全,直接给网关回复resp,等待其它片断
    SMGPSubmitRespMessage responseMessage = new SMGPSubmitRespMessage();
    responseMessage.setSequenceNo(msg.getSequenceNo());
    responseMessage.setStatus(0);
    responseMessage.setMsgId(new MsgId());
    return responseMessage;
}
Also used : SMGPSubmitRespMessage(com.zx.sms.codec.smgp.msg.SMGPSubmitRespMessage) MsgId(com.zx.sms.codec.smgp.msg.MsgId)

Aggregations

MsgId (com.zx.sms.codec.smgp.msg.MsgId)8 Test (org.junit.Test)7 SMGPDeliverMessage (com.zx.sms.codec.smgp.msg.SMGPDeliverMessage)4 SMGPReportData (com.zx.sms.codec.smgp.msg.SMGPReportData)2 SMGPSubmitRespMessage (com.zx.sms.codec.smgp.msg.SMGPSubmitRespMessage)1 SequenceNumber (com.zx.sms.common.util.SequenceNumber)1