@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);
    // test show
    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);
}