Search in sources :

Example 1 with EventContext

use of javax.slee.EventContext in project smscgateway by RestComm.

the class RxSmppServerSbbTest method testSubmitSm_test3_3.

@Test(groups = { "RxSmppServer" })
public void testSubmitSm_test3_3() throws Exception {
    if (!this.cassandraDbInited)
        return;
    ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
    SmsDef sd1 = new SmsDef();
    String s01 = "1234567890";
    StringBuilder sb = new StringBuilder();
    for (int i1 = 0; i1 < 20; i1++) {
        sb.append(s01);
    }
    sd1.msg = sb.toString();
    sd1.stored = true;
    lst.add(sd1);
    SmsDef sd2 = new SmsDef();
    sd2.msg = "Msg 2";
    sd2.stored = true;
    lst.add(sd2);
    SmsSet smsSet = prepareDatabase(lst);
    SmsSetEvent event = new SmsSetEvent();
    event.setSmsSet(smsSet);
    EventContext eventContext = null;
    ActivityContextInterface aci = new SmppTransactionProxy(esme);
    this.sbb.onDeliverSm(event, aci, eventContext);
    DeliverSmResp eventResp = new DeliverSmResp();
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
    eventResp = new DeliverSmResp();
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
    eventResp = new DeliverSmResp();
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
}
Also used : EventContext(javax.slee.EventContext) SmsSetEvent(org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent) ActivityContextInterface(javax.slee.ActivityContextInterface) ArrayList(java.util.ArrayList) SmsSet(org.mobicents.smsc.library.SmsSet) DeliverSmResp(com.cloudhopper.smpp.pdu.DeliverSmResp) Test(org.testng.annotations.Test)

Example 2 with EventContext

use of javax.slee.EventContext in project smscgateway by RestComm.

the class RxSmppServerSbbTest method testSubmitSm_test3_2.

@Test(groups = { "RxSmppServer" })
public void testSubmitSm_test3_2() throws Exception {
    if (!this.cassandraDbInited)
        return;
    ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
    SmsDef sd1 = new SmsDef();
    sd1.msg = "Msg 1";
    sd1.stored = true;
    lst.add(sd1);
    SmsDef sd2 = new SmsDef();
    sd2.msg = "Msg 2";
    sd2.stored = true;
    lst.add(sd2);
    SmsDef sd3 = new SmsDef();
    sd3.msg = "Msg 3";
    sd3.stored = true;
    lst.add(sd3);
    SmsSet smsSet = prepareDatabase(lst);
    SmsSetEvent event = new SmsSetEvent();
    event.setSmsSet(smsSet);
    EventContext eventContext = null;
    ActivityContextInterface aci = new SmppTransactionProxy(esme);
    this.sbb.onDeliverSm(event, aci, eventContext);
    DeliverSmResp eventResp = new DeliverSmResp();
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
    eventResp = new DeliverSmResp();
    // eventResp.setCommandStatus(2);
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    // eventResp.setSequenceNumber(10001);
    this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
    eventResp = new DeliverSmResp();
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    this.sbb.onPduRequestTimeoutParent(null, aci, eventContext);
// this.sbb.onDeliverSmResp(eventResp, aci, eventContext);
}
Also used : EventContext(javax.slee.EventContext) SmsSetEvent(org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent) ActivityContextInterface(javax.slee.ActivityContextInterface) ArrayList(java.util.ArrayList) SmsSet(org.mobicents.smsc.library.SmsSet) DeliverSmResp(com.cloudhopper.smpp.pdu.DeliverSmResp) Test(org.testng.annotations.Test)

Example 3 with EventContext

use of javax.slee.EventContext in project smscgateway by RestComm.

the class RxSmppServerSbbTest method testSubmitSm_test1_2.

@Test(groups = { "RxSmppServer" })
public void testSubmitSm_test1_2() throws Exception {
    if (!this.cassandraDbInited)
        return;
    ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
    SmsDef sd1 = new SmsDef();
    sd1.stored = true;
    lst.add(sd1);
    SmsSet smsSet = prepareDatabase(lst);
    SmsSetEvent event = new SmsSetEvent();
    event.setSmsSet(smsSet);
    EventContext eventContext = null;
    ActivityContextInterface aci = new SmppTransactionProxy(esme);
    this.sbb.onDeliverSm(event, aci, eventContext);
    DeliverSmResp eventResp = new DeliverSmResp();
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
}
Also used : EventContext(javax.slee.EventContext) SmsSetEvent(org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent) ActivityContextInterface(javax.slee.ActivityContextInterface) ArrayList(java.util.ArrayList) SmsSet(org.mobicents.smsc.library.SmsSet) DeliverSmResp(com.cloudhopper.smpp.pdu.DeliverSmResp) Test(org.testng.annotations.Test)

Example 4 with EventContext

use of javax.slee.EventContext in project smscgateway by RestComm.

the class RxSmppServerSbbTest method testSubmitSm_test1.

@Test(groups = { "RxSmppServer" })
public void testSubmitSm_test1() throws Exception {
    if (!this.cassandraDbInited)
        return;
    ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
    SmsDef sd1 = new SmsDef();
    lst.add(sd1);
    SmsSet smsSet = prepareDatabase(lst);
    SmsSetEvent event = new SmsSetEvent();
    event.setSmsSet(smsSet);
    EventContext eventContext = null;
    ActivityContextInterface aci = new SmppTransactionProxy(esme);
    this.sbb.onDeliverSm(event, aci, eventContext);
    DeliverSmResp eventResp = new DeliverSmResp();
    eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
    this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
}
Also used : EventContext(javax.slee.EventContext) SmsSetEvent(org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent) ActivityContextInterface(javax.slee.ActivityContextInterface) ArrayList(java.util.ArrayList) SmsSet(org.mobicents.smsc.library.SmsSet) DeliverSmResp(com.cloudhopper.smpp.pdu.DeliverSmResp) Test(org.testng.annotations.Test)

Aggregations

DeliverSmResp (com.cloudhopper.smpp.pdu.DeliverSmResp)4 ArrayList (java.util.ArrayList)4 ActivityContextInterface (javax.slee.ActivityContextInterface)4 EventContext (javax.slee.EventContext)4 SmsSet (org.mobicents.smsc.library.SmsSet)4 SmsSetEvent (org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent)4 Test (org.testng.annotations.Test)4