use of javax.slee.ActivityContextInterface 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);
}
use of javax.slee.ActivityContextInterface 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);
}
use of javax.slee.ActivityContextInterface 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);
}
use of javax.slee.ActivityContextInterface in project smscgateway by RestComm.
the class DeliveryCommonSbb method getSchedulerActivityContextInterface.
protected ActivityContextInterface getSchedulerActivityContextInterface() {
ActivityContextInterface[] acis = this.sbbContext.getActivities();
for (int count = 0; count < acis.length; count++) {
ActivityContextInterface aci = acis[count];
Object activity = aci.getActivity();
if (activity instanceof SchedulerActivity) {
return aci;
}
}
return null;
}
use of javax.slee.ActivityContextInterface in project smscgateway by RestComm.
the class TxSmppServerSbbTest method testUcs2Udh.
@Test(groups = { "TxSmppServer" })
public void testUcs2Udh() throws Exception {
if (!this.cassandraDbInited)
return;
this.smppSess = new SmppSessionsProxy();
this.sbb.setSmppServerSessions(smppSess);
int windowSize = SmppConstants.DEFAULT_WINDOW_SIZE;
long connectTimeout = SmppConstants.DEFAULT_CONNECT_TIMEOUT;
long requestExpiryTimeout = SmppConstants.DEFAULT_REQUEST_EXPIRY_TIMEOUT;
long clientBindTimeout = SmppConstants.DEFAULT_BIND_TIMEOUT;
long windowMonitorInterval = SmppConstants.DEFAULT_WINDOW_MONITOR_INTERVAL;
long windowWaitTimeout = SmppConstants.DEFAULT_WINDOW_WAIT_TIMEOUT;
Esme esme = new Esme("Esme_1", "Esme_systemId_1", "pwd", "host", 0, false, null, SmppInterfaceVersionType.SMPP34, -1, -1, null, SmppBindType.TRANSCEIVER, SmppSession.Type.CLIENT, windowSize, connectTimeout, requestExpiryTimeout, clientBindTimeout, windowMonitorInterval, windowWaitTimeout, "Esme_1", true, 30000, 0, 0, -1, -1, "^[0-9a-zA-Z]*", -1, -1, "^[0-9a-zA-Z]*", 0, false, 0, 0, 0, 0, -1, -1, 0, -1, -1, -1, -1);
ActivityContextInterface aci = new SmppTransactionProxy(esme);
SubmitSm event = new SubmitSm();
Date curDate = new Date();
this.fillSm(event, curDate, true);
event.setDataCoding((byte) 8);
event.setEsmClass((byte) 0x40);
event.setShortMessage(msgUcs2Udh);
long dueSlot = this.pers.c2_getDueSlotForTime(scheduleDeliveryTime);
PreparedStatementCollection psc = this.pers.getStatementCollection(scheduleDeliveryTime);
int b1 = this.pers.checkSmsExists(dueSlot, ta1.getTargetId());
long b2 = this.pers.c2_getDueSlotForTargetId(psc, ta1.getTargetId());
assertEquals(b1, 0);
assertEquals(b2, 0L);
TxSmppServerSbb.smscPropertiesManagement.setSmppEncodingForUCS2(SmppEncoding.Unicode);
this.sbb.onSubmitSm(event, aci);
b1 = this.pers.checkSmsExists(dueSlot, ta1.getTargetId());
assertEquals(b1, 1);
// SmsSet smsSet = this.pers.c2_getRecordListForTargeId(dueSlot, ta1.getTargetId());
// this.checkSmsSet(smsSet, curDate, true);
// Sms sms = smsSet.getSms(0);
// assertEquals(sms.getShortMessageText(), sMsg); // msgUcs2
// assertEquals(sms.getShortMessageBin(), udhCode);
//
// assertEquals(this.smppSess.getReqList().size(), 0);
// assertEquals(this.smppSess.getRespList().size(), 1);
//
// PduResponse resp = this.smppSess.getRespList().get(0);
// assertEquals(resp.getCommandStatus(), 0);
// assertEquals(resp.getOptionalParameterCount(), 0);
}
Aggregations