SccpExecutor implements ShellExecutor { public String execute(String[] options) { if (this.sccpStacks.size() == 0) { logger.warn("SCCP stack not set. Command will not be executed "); return SccpOAMMessage.SERVER_ERROR; } if (options == null || options.length < 2) { return SccpOAMMessage.INVALID_COMMAND; } String firstOption = options[1]; if (firstOption == null) { return SccpOAMMessage.INVALID_COMMAND; } try { if (firstOption.equals("rule")) { return this.manageRule(options); } else if (firstOption.equals("address")) { return this.manageAddress(options); } else if (firstOption.equals("rsp")) { return this.manageRsp(options); } else if (firstOption.equals("rss")) { return this.manageRss(options); } else if (firstOption.equals("lmr")) { return this.manageLmr(options); } else if (firstOption.equals("sap")) { return this.manageSap(options); } else if (firstOption.equals("dest")) { return this.manageDest(options); } else if (firstOption.equals("csp")) { return this.manageConcernedSpc(options); } else if (firstOption.equals("set")) { return this.manageSet(options); } else if (firstOption.equals("get")) { return this.manageGet(options); } } catch (Throwable t) { logger.error(String.format("Error while executing comand %s", Arrays.toString(options)), t); return t.getMessage(); } return SccpOAMMessage.INVALID_COMMAND; } SccpExecutor(); void setSccpStacks(Map<String, SccpStackImpl> sccpStacksTemp); Map<String, SccpStackImpl> getSccpStacks(); String execute(String[] options); @Override boolean handles(String command);  }
@Test(groups = { "oam", "functional.mgmt" }) public void testRsp() { String rspCmd = "sccp rsp create 1 11 0 0"; String res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getRemoteSpcs().size(), 1); RemoteSignalingPointCode spc = this.sccpResource.getRemoteSpc(1); assertEquals(spc.getRemoteSpc(), 11); rspCmd = "sccp rsp show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, "key=1 rsp=11 rsp-flag=0 mask=0 rsp-prohibited=false rsccp-prohibited=false\n"); rspCmd = "sccp rsp create 1 12 0 0"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.RSPC_ALREADY_EXIST)); assertEquals(this.sccpResource.getRemoteSpcs().size(), 1); spc = this.sccpResource.getRemoteSpc(1); assertEquals(spc.getRemoteSpc(), 11); rspCmd = "sccp rsp modify 2 12 0 0"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.RSPC_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.sccpResource.getRemoteSpcs().size(), 1); spc = this.sccpResource.getRemoteSpc(1); assertEquals(spc.getRemoteSpc(), 11); rspCmd = "sccp rsp modify 1 12 0 0"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getRemoteSpcs().size(), 1); spc = this.sccpResource.getRemoteSpc(1); assertEquals(spc.getRemoteSpc(), 12); rspCmd = "sccp rsp show 1"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp rsp show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp rsp delete 5"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.RSPC_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.sccpResource.getRemoteSpcs().size(), 1); spc = this.sccpResource.getRemoteSpc(1); assertEquals(spc.getRemoteSpc(), 12); rspCmd = "sccp rsp delete 1"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getRemoteSpcs().size(), 0); }
@Test(groups = { "oam", "functional.mgmt" }) public void testRss() { String rspCmd = "sccp rss create 2 11 8 0"; String res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getRemoteSsns().size(), 1); RemoteSubSystem rss = this.sccpResource.getRemoteSsn(2); assertEquals(rss.getRemoteSpc(), 11); assertEquals(rss.getRemoteSsn(), 8); assertFalse(rss.getMarkProhibitedWhenSpcResuming()); rspCmd = "sccp rss show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, "key=2 rsp=11 rss=8 rss-flag=0 rss-prohibited=false\n"); rspCmd = "sccp rss delete 5"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, String.format(SccpOAMMessage.RSS_DOESNT_EXIST, this.sccpStack.getName())); assertEquals(this.sccpResource.getRemoteSsns().size(), 1); rss = this.sccpResource.getRemoteSsn(2); assertEquals(rss.getRemoteSpc(), 11); rspCmd = "sccp rss delete 2"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getRemoteSsns().size(), 0); rspCmd = "sccp rss create 2 12 8 0 prohibitedwhenspcresuming true"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, String.format(SccpOAMMessage.RSS_SUCCESSFULLY_ADDED, this.sccpStack.getName())); assertEquals(this.sccpResource.getRemoteSsns().size(), 1); rss = this.sccpResource.getRemoteSsn(2); assertEquals(rss.getRemoteSpc(), 12); assertEquals(rss.getRemoteSsn(), 8); assertTrue(rss.getMarkProhibitedWhenSpcResuming()); rspCmd = "sccp rss create 2 12 8 0"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.RSS_ALREADY_EXIST)); assertEquals(this.sccpResource.getRemoteSsns().size(), 1); rss = this.sccpResource.getRemoteSsn(2); assertEquals(rss.getRemoteSpc(), 12); assertEquals(rss.getRemoteSsn(), 8); assertTrue(rss.getMarkProhibitedWhenSpcResuming()); rspCmd = "sccp rss modify 2 13 18 0"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getRemoteSsns().size(), 1); rss = this.sccpResource.getRemoteSsn(2); assertEquals(rss.getRemoteSpc(), 13); assertEquals(rss.getRemoteSsn(), 18); assertFalse(rss.getMarkProhibitedWhenSpcResuming()); rspCmd = "sccp rss modify 2 14 19 0 prohibitedwhenspcresuming true"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, String.format(SccpOAMMessage.RSS_SUCCESSFULLY_MODIFIED, this.sccpStack.getName())); assertEquals(this.sccpResource.getRemoteSsns().size(), 1); rss = this.sccpResource.getRemoteSsn(2); assertEquals(rss.getRemoteSpc(), 14); assertEquals(rss.getRemoteSsn(), 19); assertTrue(rss.getMarkProhibitedWhenSpcResuming()); rspCmd = "sccp rss modify 3 15 19 0 prohibitedwhenspcresuming true"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, String.format(SccpOAMMessage.RSS_DOESNT_EXIST, this.sccpStack.getName())); assertEquals(this.sccpResource.getRemoteSsns().size(), 1); rss = this.sccpResource.getRemoteSsn(2); assertEquals(rss.getRemoteSpc(), 14); assertEquals(rss.getRemoteSsn(), 19); assertTrue(rss.getMarkProhibitedWhenSpcResuming()); rspCmd = "sccp rss show 1"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp rss show 2"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp rss show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); }
@Test(groups = { "oam", "functional.mgmt" }) public void testConcernedSpc() { String rspCmd = "sccp csp create 3 21"; String res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getConcernedSpcs().size(), 1); ConcernedSignalingPointCode cspc = this.sccpResource.getConcernedSpc(3); assertEquals(cspc.getRemoteSpc(), 21); rspCmd = "sccp csp show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, "key=3 rsp=21\n"); rspCmd = "sccp csp create 3 22"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.CS_ALREADY_EXIST),res); assertEquals(this.sccpResource.getConcernedSpcs().size(), 1); cspc = this.sccpResource.getConcernedSpc(3); assertEquals(cspc.getRemoteSpc(), 21); rspCmd = "sccp csp modify 3 23"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getConcernedSpcs().size(), 1); cspc = this.sccpResource.getConcernedSpc(3); assertEquals(cspc.getRemoteSpc(), 23); rspCmd = "sccp csp modify 33 24"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.CS_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.sccpResource.getConcernedSpcs().size(), 1); cspc = this.sccpResource.getConcernedSpc(3); assertEquals(cspc.getRemoteSpc(), 23); rspCmd = "sccp csp show 3"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp csp show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp csp delete 33"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.CS_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.sccpResource.getConcernedSpcs().size(), 1); cspc = this.sccpResource.getConcernedSpc(3); assertEquals(cspc.getRemoteSpc(), 23); rspCmd = "sccp csp delete 3"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpResource.getConcernedSpcs().size(), 0); }
@Test(groups = { "oam", "functional.mgmt" }) public void testParameters() { String rspCmd = "sccp set xxx 200"; String res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, SccpOAMMessage.INVALID_COMMAND); rspCmd = "sccp set zMarginXudtMessage 200 stackname SccpExecutorTest"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, String.format(SccpOAMMessage.PARAMETER_SUCCESSFULLY_SET, this.sccpStack.getName())); assertEquals(this.sccpStack.getZMarginXudtMessage(), 200); rspCmd = "sccp set reassemblyTimerDelay 10000"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpStack.getReassemblyTimerDelay(), 10000); rspCmd = "sccp set maxDataMessage 3000"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpStack.getMaxDataMessage(), 3000); rspCmd = "sccp set removeSpc false"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpStack.isRemoveSpc(), false); rspCmd = "sccp set sstTimerDuration_Min 6000"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpStack.getSstTimerDuration_Min(), 6000); rspCmd = "sccp set sstTimerDuration_Max 1000000"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpStack.getSstTimerDuration_Max(), 1000000); rspCmd = "sccp set sstTimerDuration_IncreaseFactor 2.55"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.sccpStack.getSstTimerDuration_IncreaseFactor(), 2.55); rspCmd = "sccp get zMarginXudtMessage"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp get reassemblyTimerDelay"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp get maxDataMessage"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp get removeSpc"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp get sstTimerDuration_Min"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp get sstTimerDuration_Max"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp get sstTimerDuration_IncreaseFactor"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp get"; res = this.sccpExecutor.execute(rspCmd.split(" ")); }
@Test(groups = { "oam", "functional.mgmt" }) public void testMaskSectionsValidations() { String incorrect_prim_addressCmd = "sccp address create 1 71 6535 8 0 0 12 93707100007"; String incorrect_prim_address_deleteCmd = "sccp address delete 1"; String correct_prim_addressCmd = "sccp address create 1 71 6535 8 0 0 12 -/-"; String incorrectCreateRuleCmd = "sccp rule create 2 R/K 18 1 180 0 1 4 * solitary 1"; String correctCreateRuleCmd = "sccp rule create 2 R/K 18 1 180 0 1 4 937/* solitary 1"; String incorrect_sec_addressCmd = "sccp address create 3 71 6535 8 0 0 12 93707100007"; String correctCreateRuleCmdWithSecId = "sccp rule create 2 R/K 18 1 180 0 1 4 937/* solitary 1 backup-addressid 3"; String result = this.sccpExecutor.execute(incorrectCreateRuleCmd.split(" ")); assertEquals(result, SccpOAMMessage.SEC_MISMATCH_PATTERN); this.sccpExecutor.execute(incorrect_prim_addressCmd.split(" ")); result = this.sccpExecutor.execute(correctCreateRuleCmd.split(" ")); assertEquals(result, SccpOAMMessage.SEC_MISMATCH_PRIMADDRESS); this.sccpExecutor.execute(incorrect_prim_address_deleteCmd.split(" ")); this.sccpExecutor.execute(correct_prim_addressCmd.split(" ")); this.sccpExecutor.execute(incorrect_sec_addressCmd.split(" ")); result = this.sccpExecutor.execute(correctCreateRuleCmdWithSecId.split(" ")); assertEquals(result, SccpOAMMessage.SEC_MISMATCH_SECADDRESS); }
@Test(groups = { "oam", "functional.mgmt" }) public void testPrimAddress() { String rspCmd = "sccp address create 11 71 6535 8 0 0 12 93707100007"; String res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getRoutingAddresses().size(), 1); SccpAddress addr = this.router.getRoutingAddress(11); assertEquals(addr.getAddressIndicator().getValue(SccpProtocolVersion.ITU), 71); assertEquals(addr.getSignalingPointCode(), 6535); assertEquals(addr.getSubsystemNumber(), 8); assertTrue(addr.getGlobalTitle().getDigits().equals("93707100007")); rspCmd = "sccp address create 11 71 6536 8 0 0 12 93707100007"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.ADDRESS_ALREADY_EXIST)); assertEquals(this.router.getRoutingAddresses().size(), 1); addr = this.router.getRoutingAddress(11); assertEquals(addr.getSignalingPointCode(), 6535); rspCmd = "sccp address modify 11 71 6537 8 0 0 12 93707100007"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getRoutingAddresses().size(), 1); addr = this.router.getRoutingAddress(11); assertEquals(addr.getSignalingPointCode(), 6537); rspCmd = "sccp address modify 12 71 6538 8 0 0 12 93707100007"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.ADDRESS_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.router.getRoutingAddresses().size(), 1); addr = this.router.getRoutingAddress(11); assertEquals(addr.getSignalingPointCode(), 6537); rspCmd = "sccp address show 11"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp address show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp address delete 12"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.ADDRESS_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.router.getRoutingAddresses().size(), 1); rspCmd = "sccp address delete 11"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getRoutingAddresses().size(), 0); }
@Test(groups = { "oam", "functional.mgmt" }) public void testLmr() { String rspCmd = "sccp lmr create 1 11 12 udt"; String res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 1); LongMessageRule lmr = this.router.getLongMessageRule(1); assertEquals(lmr.getFirstSpc(), 11); assertEquals(lmr.getLastSpc(), 12); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.LONG_MESSAGE_FORBBIDEN); rspCmd = "sccp lmr show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, "key=1 firstSpc=11, lastSpc=12, ruleType=LONG_MESSAGE_FORBBIDEN\n"); rspCmd = "sccp lmr create 2 13 14 xudt"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 2); lmr = this.router.getLongMessageRule(2); assertEquals(lmr.getFirstSpc(), 13); assertEquals(lmr.getLastSpc(), 14); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.XUDT_ENABLED); rspCmd = "sccp lmr create 3 15 16 ludt"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 3); lmr = this.router.getLongMessageRule(3); assertEquals(lmr.getFirstSpc(), 15); assertEquals(lmr.getLastSpc(), 16); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.LUDT_ENABLED); rspCmd = "sccp lmr create 4 17 18 ludt_segm"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 4); lmr = this.router.getLongMessageRule(4); assertEquals(lmr.getFirstSpc(), 17); assertEquals(lmr.getLastSpc(), 18); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.LUDT_ENABLED_WITH_SEGMENTATION); rspCmd = "sccp lmr create 4 19 20 ludt_segm"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.LMR_ALREADY_EXIST)); assertEquals(this.router.getLongMessageRules().size(), 4); lmr = this.router.getLongMessageRule(4); rspCmd = "sccp lmr modify 4 21 22 udt"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 4); lmr = this.router.getLongMessageRule(4); assertEquals(lmr.getFirstSpc(), 21); assertEquals(lmr.getLastSpc(), 22); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.LONG_MESSAGE_FORBBIDEN); rspCmd = "sccp lmr modify 4 21 22 xudt"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 4); lmr = this.router.getLongMessageRule(4); assertEquals(lmr.getFirstSpc(), 21); assertEquals(lmr.getLastSpc(), 22); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.XUDT_ENABLED); rspCmd = "sccp lmr modify 4 21 22 ludt"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 4); lmr = this.router.getLongMessageRule(4); assertEquals(lmr.getFirstSpc(), 21); assertEquals(lmr.getLastSpc(), 22); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.LUDT_ENABLED); rspCmd = "sccp lmr modify 4 21 22 ludt_segm"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 4); lmr = this.router.getLongMessageRule(4); assertEquals(lmr.getFirstSpc(), 21); assertEquals(lmr.getLastSpc(), 22); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.LUDT_ENABLED_WITH_SEGMENTATION); rspCmd = "sccp lmr modify 5 23 24 udt"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.LMR_DOESNT_EXIST,this.sccpStack.getName() ))); assertEquals(this.router.getLongMessageRules().size(), 4); lmr = this.router.getLongMessageRule(4); assertEquals(lmr.getFirstSpc(), 21); assertEquals(lmr.getLastSpc(), 22); assertEquals(lmr.getLongMessageRuleType(), LongMessageRuleType.LUDT_ENABLED_WITH_SEGMENTATION); rspCmd = "sccp lmr show 1"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp lmr show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp lmr delete 10"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.LMR_DOESNT_EXIST,this.sccpStack.getName() ))); assertEquals(this.router.getLongMessageRules().size(), 4); rspCmd = "sccp lmr delete 4"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getLongMessageRules().size(), 3); }
@Test(groups = { "oam", "functional.mgmt" }) public void testSap() { String rspCmd = "sccp sap create 5 101 11 2"; String res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.MUP_DOESNT_EXIST)); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 0); rspCmd = "sccp sap create 5 1 11 2"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); Mtp3ServiceAccessPoint sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 11); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp sap show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(res, "key=5 mtp3Id=1, opc=11, ni=2, networkId=0, dpcList=[]\n"); rspCmd = "sccp sap create 5 1 11 2"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.SAP_ALREADY_EXIST)); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 11); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp sap modify 5 2 12 2"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.MUP_DOESNT_EXIST)); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 11); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp sap modify 5 1 13 2"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp sap modify 6 2 14 2"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.SAP_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp dest create 1 7 31 32 3 4 255"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.SAP_DOESNT_EXIST,this.sccpStack.getName()))); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp dest create 5 7 31 32 3 4 255"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 1); Mtp3Destination dest = sap.getMtp3Destination(7); assertEquals(dest.getFirstDpc(), 31); assertEquals(dest.getLastDpc(), 32); assertEquals(dest.getFirstSls(), 3); assertEquals(dest.getLastSls(), 4); assertEquals(dest.getSlsMask(), 255); rspCmd = "sccp dest create 5 7 33 34 3 4 255"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(SccpOAMMessage.DEST_ALREADY_EXIST)); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 1); dest = sap.getMtp3Destination(7); assertEquals(dest.getFirstDpc(), 31); rspCmd = "sccp dest modify 1 7 35 36 3 4 15"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.SAP_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 1); dest = sap.getMtp3Destination(7); assertEquals(dest.getFirstDpc(), 31); rspCmd = "sccp dest modify 5 9 38 39 3 4 15"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.DEST_DOESNT_EXIST,this.sccpStack.getName()))); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 1); dest = sap.getMtp3Destination(7); assertEquals(dest.getFirstDpc(), 31); rspCmd = "sccp dest modify 5 7 40 41 3 4 15"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 1); dest = sap.getMtp3Destination(7); assertEquals(dest.getFirstDpc(), 40); assertEquals(dest.getSlsMask(), 15); rspCmd = "sccp dest show 5 7"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp dest show 5"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp sap show 5"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp sap show"; res = this.sccpExecutor.execute(rspCmd.split(" ")); rspCmd = "sccp dest delete 1 7"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.SAP_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 1); dest = sap.getMtp3Destination(7); assertEquals(dest.getFirstDpc(), 40); rspCmd = "sccp dest delete 5 9"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.DEST_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 1); dest = sap.getMtp3Destination(7); assertEquals(dest.getFirstDpc(), 40); rspCmd = "sccp dest delete 5 7"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp sap delete 1"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertTrue(res.equals(String.format(SccpOAMMessage.SAP_DOESNT_EXIST, this.sccpStack.getName()))); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 1); sap = this.router.getMtp3ServiceAccessPoint(5); assertEquals(sap.getOpc(), 13); assertEquals(sap.getMtp3Destinations().size(), 0); rspCmd = "sccp sap delete 5"; res = this.sccpExecutor.execute(rspCmd.split(" ")); assertEquals(this.router.getMtp3ServiceAccessPoints().size(), 0); }