use of org.restcomm.protocols.ss7.map.errors.MAPErrorMessageUnknownSubscriberImpl in project smscgateway by RestComm.
the class MtTest method testMProc_TempFail.
@Test(groups = { "Mt" })
public void testMProc_TempFail() throws Exception {
if (!this.cassandraDbInited)
return;
MProcManagement mProcManagement = MProcManagement.getInstance();
SmscManagement smscManagement = SmscManagement.getInstance("Test");
SmppManagement smppManagement = SmppManagement.getInstance("Test");
smscManagement.setSmppManagement(smppManagement);
mProcManagement.setSmscManagement(smscManagement);
smscManagement.registerRuleFactory(new MProcRuleFactoryDefault());
DBOperations.getInstance().stop();
smscManagement.start();
try {
mProcManagement.destroyMProcRule(1);
} catch (Exception e) {
}
try {
mProcManagement.destroyMProcRule(2);
} catch (Exception e) {
}
// mProcManagement.createMProcRule(1, MProcRuleFactoryDefault.RULE_CLASS_NAME,
// "networkidmask 0 newnetworkidaftertempfail 1");
mProcManagement.createMProcRule(1, MProcRuleFactoryDefault.RULE_CLASS_NAME, "networkidmask 0 newnetworkidafterpermfail 1");
MAPServiceSmsProxy serviceSri = (MAPServiceSmsProxy) this.sriSbb.mapProvider.getMAPServiceSms();
MAPServiceSmsProxy serviceMt = (MAPServiceSmsProxy) this.mtSbb.mapProvider.getMAPServiceSms();
MAPServiceSmsProxy serviceRsds = (MAPServiceSmsProxy) this.rsdsSbb.mapProvider.getMAPServiceSms();
SmscPropertiesManagement smscPropertiesManagement = SmscPropertiesManagement.getInstance();
MProcManagement.getInstance("Test");
ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
SmsDef sd1 = new SmsDef();
lst.add(sd1);
SmsSet smsSet = prepareDatabase(lst);
Sms sms1 = smsSet.getSms(0);
// UUID smsId = sms1.getDbId();
// SmsProxy smsx1 = this.pers.obtainArchiveSms(procDueSlot, smsSet.getDestAddr(), smsId);
// assertNull(smsx1);
// SmsSet smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
// assertNotNull(smsSetX);
// Sms smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
// assertEquals(smsX.getSmsSet().getInSystem(), 0);
// assertEquals(SmsSetCache.getInstance().getProcessingSmsSetSize(), 1);
// initial onSms message
SmsSetEvent event = new SmsSetEvent();
event.setSmsSet(smsSet);
this.sriSbb.onSms(event, null, null);
MAPDialogSmsProxy dlg = serviceSri.getLastMAPDialogSms();
// assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version1));
// assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version2));
// assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version3));
// assertFalse(this.mtSbb.isNegotiatedMapVersionUsing());
// SRI response
IMSI imsi = new IMSIImpl(imsiDig);
ISDNAddressString networkNodeNumber = new ISDNAddressStringImpl(AddressNature.international_number, org.restcomm.protocols.ss7.map.api.primitives.NumberingPlan.ISDN, nnnDig);
LocationInfoWithLMSI locationInfoWithLMSI = new LocationInfoWithLMSIImpl(networkNodeNumber, null, null, false, null);
SendRoutingInfoForSMResponse evt1 = new SendRoutingInfoForSMResponseImpl(imsi, locationInfoWithLMSI, null, null, null);
evt1.setMAPDialog(dlg);
// MAPErrorMessage mapErrorMessage = new MAPErrorMessageAbsentSubscriberSMImpl(null, null, null);
// ErrorComponent evt2 = new ErrorComponent(dlg, 0L, mapErrorMessage);
MAPErrorMessage mapErrorMessage = new MAPErrorMessageUnknownSubscriberImpl(null, null);
ErrorComponent evt2 = new ErrorComponent(dlg, 0L, mapErrorMessage);
this.sriSbb.onErrorComponent(evt2, null);
this.sriSbb.onDialogDelimiter(null, null);
// ....................
// assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version1));
// assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version2));
// assertTrue(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version3));
// assertFalse(this.mtSbb.isNegotiatedMapVersionUsing());
dlg = serviceMt.getLastMAPDialogSms();
// MAPApplicationContextVersion vers = dlg.getApplicationContext().getApplicationContextVersion();
// assertEquals(vers, MAPApplicationContextVersion.version3);
}
Aggregations