test_class.declarator: router = null
test_class.modifier: private
test_class.original_string: private Router router = null;
test_class.type: Router
test_class.var_name: router
test_class.declarator: sccpResource = null
test_class.modifier: private
test_class.original_string: private SccpResource sccpResource = null;
test_class.type: SccpResource
test_class.var_name: sccpResource
test_class.declarator: sccpStack = null
test_class.modifier: private
test_class.original_string: private SccpStackImpl sccpStack = null;
test_class.type: SccpStackImpl
test_class.var_name: sccpStack
test_class.declarator: sccpExecutor = null
test_class.modifier: private
test_class.original_string: private SccpExecutor sccpExecutor = null;
test_class.type: SccpExecutor
test_class.var_name: sccpExecutor
test_class.file: sccp/sccp-impl/src/test/java/org/mobicents/protocols/ss7/sccp/impl/oam/SccpExecutorTest.java
test_class.identifier: SccpExecutorTest
test_case.body: @Test(groups = { "oam", "functional.mgmt" })
      public void testManageRule() {
  
          String addressCmd = "sccp rule modify 4 K 18 0 146 0 1 4 * loadshared 2 backup-addressid 3 loadsharing-algo bit0";
          String result = this.sccpExecutor.execute(addressCmd.split(" "));
  
          addressCmd = "sccp address create 1 71 2 8 0 0 3 123456789";
          result = this.sccpExecutor.execute(addressCmd.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.ADDRESS_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
          assertEquals(this.router.getRoutingAddresses().size(), 1);
  
          String createRuleCmd = "sccp rule create 1 R 71 2 8 0 0 3 123456789 solitary 1";
  
          result = this.sccpExecutor.execute(createRuleCmd.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 1);
          assertEquals(this.router.getRules().get(1).getPrimaryAddressId(), 1);
  
          // test show
          createRuleCmd = "sccp rule show";
          result = this.sccpExecutor.execute(createRuleCmd.split(" "));
  
          assertEquals(
                  result,
                  "key=1  Rule=ruleId(1);ruleType(Solitary);originatingType(All);patternSccpAddress(pc=2,ssn=8,AI=71,gt=GlobalTitle0001Impl [digits=123456789, natureOfAddress=NATIONAL, encodingScheme=BCDOddEncodingScheme[type=BCD_ODD, code=1]]);paddress(1);saddress(-1);mask(R);networkId(0)\n");
  
          // TODO: this update for fixing "sccp rule create needs not zero pc"
  //        createRuleCmd = "sccp rule create 2 K 18 0 180 0 1 4 * solitary 1";
          createRuleCmd = "sccp rule create 2 K 18 1 180 0 1 4 * solitary 1";
          result = this.sccpExecutor.execute(createRuleCmd.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
  
          assertEquals(this.router.getRules().size(), 2);
  
          Rule rule = this.router.getRules().get(2);
          assertNotNull(rule);
          SccpAddress pattern = rule.getPattern();
          assertNotNull(pattern);
  //        assertEquals((int) pattern.getAddressIndicator().getValue(SccpProtocolVersion.ITU), 18);
          assertEquals((int) pattern.getAddressIndicator().getValue(SccpProtocolVersion.ITU), 19);
          assertEquals(pattern.getAddressIndicator().getRoutingIndicator(), RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE);
          assertEquals(
                  pattern.getGlobalTitle().getGlobalTitleIndicator(),
                  GlobalTitleIndicator.GLOBAL_TITLE_INCLUDES_TRANSLATION_TYPE_NUMBERING_PLAN_ENCODING_SCHEME_AND_NATURE_OF_ADDRESS);
          GlobalTitle0100 gt = (GlobalTitle0100) pattern.getGlobalTitle();
          assertEquals(gt.getTranslationType(), 0);
          assertEquals(gt.getNumberingPlan(), NumberingPlan.ISDN_TELEPHONY);
          assertEquals(gt.getNatureOfAddress(), NatureOfAddress.INTERNATIONAL);
          assertEquals(rule.getRuleType(), RuleType.SOLITARY);
  
          String sec_addressCmd = "sccp address create 2 71 3 8 0 0 3 123456789";
          result = this.sccpExecutor.execute(sec_addressCmd.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.ADDRESS_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
          assertEquals(this.router.getRoutingAddresses().size(), 2);
  
          String createRuleCmd2 = "sccp rule create 3 R 71 2 8 0 0 3 123456789 dominant 1 backup-addressid 2";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 3);
          assertEquals(this.router.getRule(3).getRuleType(), RuleType.DOMINANT);
  
          createRuleCmd2 = "sccp rule create 4 R 71 2 8 0 0 3 123456789 loadshared 1 backup-addressid 2 loadsharing-algo bit3";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 4);
          assertEquals(this.router.getRule(4).getRuleType(), RuleType.LOADSHARED);
          assertEquals(this.router.getRule(4).getLoadSharingAlgorithm(), LoadSharingAlgorithm.Bit3);
  
          createRuleCmd2 = "sccp rule create 11 R 71 2 8 0 0 3 123456789 dominant 1 backup-addressid 3";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertTrue(result.substring(0, 10).equals(SccpOAMMessage.NO_BACKUP_ADDRESS.substring(0, 10)));
          assertEquals(this.router.getRules().size(), 4);
  
          createRuleCmd2 = "sccp rule create 11 R 71 2 8 0 0 3 123456789 dominant 4 backup-addressid 3";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertTrue(result.substring(0, 10).equals(SccpOAMMessage.NO_PRIMARY_ADDRESS.substring(0, 10)));
          assertEquals(this.router.getRules().size(), 4);
  
          // Full rule command
          createRuleCmd2 = "sccp rule create 12 R 71 2 8 0 0 3 123456789 dominant 2 backup-addressid 1 loadsharing-algo bit3 newcgparty-addressid 1 origination-type remoteoriginated";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 5);
  
          rule = this.router.getRule(12);
          assertEquals(rule.getOriginationType(), OriginationType.REMOTE);
  
          // Test Modify Rule
  
          createRuleCmd2 = "sccp rule modify 1 R 71 2 8 0 0 3 123456789 loadshared 1 backup-addressid 2 loadsharing-algo bit4";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_MODIFIED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 5);
          assertEquals(this.router.getRule(1).getRuleType(), RuleType.LOADSHARED);
          assertEquals(this.router.getRule(1).getLoadSharingAlgorithm(), LoadSharingAlgorithm.Bit4);
  
          createRuleCmd2 = "sccp rule modify 1 R 71 2 8 0 0 3 123456789 dominant 1 backup-addressid 2";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_MODIFIED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 5);
          assertEquals(this.router.getRule(1).getRuleType(), RuleType.DOMINANT);
  
          createRuleCmd2 = "sccp rule modify 1 R 71 2 8 0 0 3 123456789 solitary 1 backup-addressid 2";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_MODIFIED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 5);
          assertEquals(this.router.getRule(1).getRuleType(), RuleType.SOLITARY);
  
          createRuleCmd2 = "sccp rule modify 1 R 71 2 8 0 0 3 123456789 dominant 1";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, SccpOAMMessage.RULETYPE_NOT_SOLI_SEC_ADD_MANDATORY);
          assertEquals(this.router.getRules().size(), 5);
          assertEquals(this.router.getRule(1).getRuleType(), RuleType.SOLITARY);
  
          createRuleCmd2 = "sccp rule modify 1 R 71 2 8 0 0 3 123456789 dominant 1 backup-addressid 3";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertTrue(result.substring(0, 10).equals(SccpOAMMessage.NO_BACKUP_ADDRESS.substring(0, 10)));
          assertEquals(this.router.getRules().size(), 5);
  
          createRuleCmd2 = "sccp rule modify 1 R 71 2 8 0 0 3 123456789 dominant 3 backup-addressid 3";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertTrue(result.substring(0, 10).equals(SccpOAMMessage.NO_PRIMARY_ADDRESS.substring(0, 10)));
          assertEquals(this.router.getRules().size(), 5);
  
          createRuleCmd2 = "sccp rule modify 15 R 71 2 8 0 0 3 123456789 dominant 1 backup-addressid 2";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_DOESNT_EXIST, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 5);
  
          createRuleCmd2 = "sccp rule delete 15";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_DOESNT_EXIST, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 5);
  
          createRuleCmd2 = "sccp rule delete 1";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.RULE_SUCCESSFULLY_REMOVED, this.sccpStack.getName()));
          assertEquals(this.router.getRules().size(), 4);
  
          createRuleCmd2 = "sccp rule show 2";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
  
          createRuleCmd2 = "sccp rule show";
          result = this.sccpExecutor.execute(createRuleCmd2.split(" "));
  
      }
test_case.class_method_signature: SccpExecutorTest.testManageRule()
test_case.full_signature: @Test(groups = { "oam", "functional.mgmt" }) public void testManageRule()
test_case.identifier: testManageRule
test_case.invocations: execute split execute split assertEquals format getName assertEquals size getRoutingAddresses execute split assertEquals format getName assertEquals size getRules assertEquals getPrimaryAddressId get getRules execute split assertEquals execute split assertEquals format getName assertEquals size getRules get getRules assertNotNull getPattern assertNotNull assertEquals getValue getAddressIndicator assertEquals getRoutingIndicator getAddressIndicator assertEquals getGlobalTitleIndicator getGlobalTitle getGlobalTitle assertEquals getTranslationType assertEquals getNumberingPlan assertEquals getNatureOfAddress assertEquals getRuleType execute split assertEquals format getName assertEquals size getRoutingAddresses execute split assertEquals format getName assertEquals size getRules assertEquals getRuleType getRule execute split assertEquals format getName assertEquals size getRules assertEquals getRuleType getRule assertEquals getLoadSharingAlgorithm getRule execute split assertTrue equals substring substring assertEquals size getRules execute split assertTrue equals substring substring assertEquals size getRules execute split assertEquals format getName assertEquals size getRules getRule assertEquals getOriginationType execute split assertEquals format getName assertEquals size getRules assertEquals getRuleType getRule assertEquals getLoadSharingAlgorithm getRule execute split assertEquals format getName assertEquals size getRules assertEquals getRuleType getRule execute split assertEquals format getName assertEquals size getRules assertEquals getRuleType getRule execute split assertEquals assertEquals size getRules assertEquals getRuleType getRule execute split assertTrue equals substring substring assertEquals size getRules execute split assertTrue equals substring substring assertEquals size getRules execute split assertEquals format getName assertEquals size getRules execute split assertEquals format getName assertEquals size getRules execute split assertEquals format getName assertEquals size getRules execute split execute split
test_case.modifiers: @Test(groups = { "oam", "functional.mgmt" }) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testManageRule()
focal_class.declarator: logger = Logger.getLogger(SccpExecutor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(SccpExecutor.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: sccpStacks = new FastMap<String, SccpStackImpl>()
focal_class.modifier: private
focal_class.original_string: private FastMap<String, SccpStackImpl> sccpStacks = new FastMap<String, SccpStackImpl>();
focal_class.type: FastMap<String, SccpStackImpl>
focal_class.var_name: sccpStacks
focal_class.declarator: sccpStack = null
focal_class.modifier: private
focal_class.original_string: private SccpStackImpl sccpStack = null;
focal_class.type: SccpStackImpl
focal_class.var_name: sccpStack
focal_class.file: sccp/sccp-impl/src/main/java/org/mobicents/protocols/ss7/sccp/impl/oam/SccpExecutor.java
focal_class.identifier: SccpExecutor
focal_class.interfaces: implements ShellExecutor
focal_class.class_method_signature: SccpExecutor.SccpExecutor()
focal_class.full_signature: public  SccpExecutor()
focal_class.identifier: SccpExecutor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  SccpExecutor()
focal_class.class_method_signature: SccpExecutor.setSccpStacks(Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.full_signature: public void setSccpStacks(Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.identifier: setSccpStacks
focal_class.modifiers: public
focal_class.parameters: (Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.return: void
focal_class.signature: void setSccpStacks(Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.class_method_signature: SccpExecutor.setDefaultValue()
focal_class.full_signature: private void setDefaultValue()
focal_class.identifier: setDefaultValue
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setDefaultValue()
focal_class.class_method_signature: SccpExecutor.getSccpStacks()
focal_class.full_signature: public Map<String, SccpStackImpl> getSccpStacks()
focal_class.identifier: getSccpStacks
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, SccpStackImpl>
focal_class.signature: Map<String, SccpStackImpl> getSccpStacks()
focal_class.class_method_signature: SccpExecutor.execute(String[] options)
focal_class.full_signature: public String execute(String[] options)
focal_class.identifier: execute
focal_class.modifiers: public
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String execute(String[] options)
focal_class.class_method_signature: SccpExecutor.manageRss(String[] options)
focal_class.full_signature: private String manageRss(String[] options)
focal_class.identifier: manageRss
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageRss(String[] options)
focal_class.class_method_signature: SccpExecutor.manageRsp(String[] options)
focal_class.full_signature: private String manageRsp(String[] options)
focal_class.identifier: manageRsp
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageRsp(String[] options)
focal_class.class_method_signature: SccpExecutor.manageAddress(String[] options)
focal_class.full_signature: private String manageAddress(String[] options)
focal_class.identifier: manageAddress
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageAddress(String[] options)
focal_class.class_method_signature: SccpExecutor.manageRule(String[] options)
focal_class.full_signature: private String manageRule(String[] options)
focal_class.identifier: manageRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageRule(String[] options)
focal_class.class_method_signature: SccpExecutor.createRule(String[] options)
focal_class.full_signature: private String createRule(String[] options)
focal_class.identifier: createRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String createRule(String[] options)
focal_class.class_method_signature: SccpExecutor.modifyRule(String[] options)
focal_class.full_signature: private String modifyRule(String[] options)
focal_class.identifier: modifyRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String modifyRule(String[] options)
focal_class.class_method_signature: SccpExecutor.deleteRule(String[] options)
focal_class.full_signature: private String deleteRule(String[] options)
focal_class.identifier: deleteRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String deleteRule(String[] options)
focal_class.class_method_signature: SccpExecutor.showRule(String[] options)
focal_class.full_signature: private String showRule(String[] options)
focal_class.identifier: showRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String showRule(String[] options)
focal_class.class_method_signature: SccpExecutor.createAddress(String[] options, int index, boolean isRule)
focal_class.full_signature: private SccpAddress createAddress(String[] options, int index, boolean isRule)
focal_class.identifier: createAddress
focal_class.modifiers: private
focal_class.parameters: (String[] options, int index, boolean isRule)
focal_class.return: SccpAddress
focal_class.signature: SccpAddress createAddress(String[] options, int index, boolean isRule)
focal_class.class_method_signature: SccpExecutor.manageLmr(String[] options)
focal_class.full_signature: private String manageLmr(String[] options)
focal_class.identifier: manageLmr
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageLmr(String[] options)
focal_class.class_method_signature: SccpExecutor.manageSap(String[] options)
focal_class.full_signature: private String manageSap(String[] options)
focal_class.identifier: manageSap
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageSap(String[] options)
focal_class.class_method_signature: SccpExecutor.manageDest(String[] options)
focal_class.full_signature: private String manageDest(String[] options)
focal_class.identifier: manageDest
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageDest(String[] options)
focal_class.class_method_signature: SccpExecutor.manageConcernedSpc(String[] options)
focal_class.full_signature: private String manageConcernedSpc(String[] options)
focal_class.identifier: manageConcernedSpc
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageConcernedSpc(String[] options)
focal_class.class_method_signature: SccpExecutor.manageSet(String[] options)
focal_class.full_signature: private String manageSet(String[] options)
focal_class.identifier: manageSet
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageSet(String[] options)
focal_class.class_method_signature: SccpExecutor.manageGet(String[] options)
focal_class.full_signature: private String manageGet(String[] options)
focal_class.identifier: manageGet
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageGet(String[] options)
focal_class.class_method_signature: SccpExecutor.handles(String command)
focal_class.full_signature: @Override public boolean handles(String command)
focal_class.identifier: handles
focal_class.modifiers: @Override public
focal_class.parameters: (String command)
focal_class.return: boolean
focal_class.signature: boolean handles(String command)
focal_method.body: private String manageRule(String[] options) throws Exception {
          // Minimum 3 needed. Show
          if (options.length < 3) {
              return SccpOAMMessage.INVALID_COMMAND;
          }
  
          String command = options[2];
  
          if (command == null) {
              return SccpOAMMessage.INVALID_COMMAND;
          }
  
          if (command.equals("create")) {
              return this.createRule(options);
          } else if (command.equals("modify")) {
              return this.modifyRule(options);
          } else if (command.equals("delete")) {
              return this.deleteRule(options);
          } else if (command.equals("show")) {
              return this.showRule(options);
          }
  
          return SccpOAMMessage.INVALID_COMMAND;
      }
focal_method.class_method_signature: SccpExecutor.manageRule(String[] options)
focal_method.full_signature: private String manageRule(String[] options)
focal_method.identifier: manageRule
focal_method.invocations: equals createRule equals modifyRule equals deleteRule equals showRule
focal_method.modifiers: private
focal_method.parameters: (String[] options)
focal_method.return: String
focal_method.signature: String manageRule(String[] options)