Search in sources :

Example 1 with AlertServiceCentreRequestImpl

use of org.mobicents.protocols.ss7.map.service.sms.AlertServiceCentreRequestImpl in project smscgateway by RestComm.

the class AlertTest method testAlert1_Gsm1.

@Test(groups = { "Alert" })
public void testAlert1_Gsm1() throws Exception {
    if (!this.cassandraDbInited)
        return;
    this.prepareDatabase();
    SmsSet smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    assertNull(smsSetX);
    Sms smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId);
    assertEquals(smsX.getSmsSet().getInSystem(), 0);
    // boolean b1 = this.pers.checkSmsSetExists(ta1);
    // assertTrue(b1);
    // SmsSet smsSet = this.pers.obtainSmsSet(ta1);
    // assertEquals(smsSet.getInSystem(), 1);
    // assertEquals(smsSet.getDueDate(), farDate);
    Thread.sleep(1000);
    Date curDate = new Date();
    ISDNAddressString msisdn = new ISDNAddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "5555");
    AddressString serviceCentreAddress = new AddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "1111");
    AlertServiceCentreRequest evt = new AlertServiceCentreRequestImpl(msisdn, serviceCentreAddress);
    MAPProviderProxy proxy = new MAPProviderProxy();
    MAPApplicationContext appCntx = MAPApplicationContext.getInstance(MAPApplicationContextName.shortMsgAlertContext, MAPApplicationContextVersion.version2);
    MAPDialogSmsProxy dialog = new MAPDialogSmsProxy(new MAPServiceSmsProxy(proxy), appCntx, null, null);
    evt.setMAPDialog(dialog);
    this.sbb.onAlertServiceCentreRequest(evt, null);
    smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    // assertNotNull(smsSetX);  TODO: this will work after alert is with direct Activities sending
    smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId);
// assertNull(smsX);
// b1 = this.pers.checkSmsSetExists(ta1);
// assertTrue(b1);
// smsSet = this.pers.obtainSmsSet(ta1);
// assertEquals(smsSet.getInSystem(), 1);
// this.testDateEq(smsSet.getDueDate(), curDate);
}
Also used : AlertServiceCentreRequestImpl(org.restcomm.protocols.ss7.map.service.sms.AlertServiceCentreRequestImpl) MAPServiceSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) Date(java.util.Date) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) MAPProviderProxy(org.mobicents.smsc.slee.resources.persistence.MAPProviderProxy) Sms(org.mobicents.smsc.library.Sms) AlertServiceCentreRequest(org.restcomm.protocols.ss7.map.api.service.sms.AlertServiceCentreRequest) SmsSet(org.mobicents.smsc.library.SmsSet) MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext) AddressStringImpl(org.restcomm.protocols.ss7.map.primitives.AddressStringImpl) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) Test(org.testng.annotations.Test)

Aggregations

Date (java.util.Date)1 Sms (org.mobicents.smsc.library.Sms)1 SmsSet (org.mobicents.smsc.library.SmsSet)1 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)1 MAPProviderProxy (org.mobicents.smsc.slee.resources.persistence.MAPProviderProxy)1 MAPServiceSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy)1 MAPApplicationContext (org.restcomm.protocols.ss7.map.api.MAPApplicationContext)1 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)1 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)1 AlertServiceCentreRequest (org.restcomm.protocols.ss7.map.api.service.sms.AlertServiceCentreRequest)1 AddressStringImpl (org.restcomm.protocols.ss7.map.primitives.AddressStringImpl)1 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)1 AlertServiceCentreRequestImpl (org.restcomm.protocols.ss7.map.service.sms.AlertServiceCentreRequestImpl)1 Test (org.testng.annotations.Test)1