コード例 #1
0
ファイル: ResetTimerTest.java プロジェクト: nacerix/jss7
  @Test(groups = {"functional.decode", "circuitSwitchedCall"})
  public void testDecode() throws Exception {

    byte[] data = this.getData1();
    AsnInputStream ais = new AsnInputStream(data);
    ResetTimerRequestImpl elem = new ResetTimerRequestImpl();
    int tag = ais.readTag();
    elem.decodeAll(ais);
    assertEquals(elem.getTimerID(), TimerID.tssf);
    assertEquals(elem.getTimerValue(), 1000);
    assertTrue(CAPExtensionsTest.checkTestCAPExtensions(elem.getExtensions()));
    assertEquals((int) elem.getCallSegmentID(), 100);
  }
コード例 #2
0
  @Test(groups = {"functional.decode", "circuitSwitchedCall"})
  public void testDecode() throws Exception {

    byte[] data = this.getData1();
    AsnInputStream ais = new AsnInputStream(data);
    EstablishTemporaryConnectionRequestImpl elem =
        new EstablishTemporaryConnectionRequestImpl(false);
    int tag = ais.readTag();
    elem.decodeAll(ais);

    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNatureOfAddressIndicator(), 1);
    assertTrue(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getAddress().equals("1122"));
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNumberQualifierIndicator(), 1);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNumberingPlanIndicator(), 0);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress()
            .getGenericNumber()
            .getAddressRepresentationRestrictedIndicator(),
        0);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getScreeningIndicator(), 1);
    assertEquals(elem.getCorrelationID().getGenericDigits().getEncodingScheme(), 2);
    assertEquals(elem.getCorrelationID().getGenericDigits().getTypeOfDigits(), 0);
    assertTrue(
        Arrays.equals(
            elem.getCorrelationID().getGenericDigits().getEncodedDigits(),
            getCorrelationIDDigits()));
    assertTrue(Arrays.equals(elem.getScfID().getData(), getScfIDData()));
    assertEquals(
        elem.getServiceInteractionIndicatorsTwo().getBothwayThroughConnectionInd(),
        BothwayThroughConnectionInd.bothwayPathNotRequired);
    assertNull(elem.getCallSegmentID());
    assertEquals((int) elem.getNAOliInfo().getData(), 11);
    assertTrue(CAPExtensionsTest.checkTestCAPExtensions(elem.getExtensions()));
    assertNull(elem.getCarrier());
    assertNull(elem.getChargeNumber());
    assertNull(elem.getOriginalCalledPartyID());
    assertNull(elem.getCallingPartyNumber());

    data = this.getData2();
    ais = new AsnInputStream(data);
    elem = new EstablishTemporaryConnectionRequestImpl(true);
    tag = ais.readTag();
    elem.decodeAll(ais);

    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNatureOfAddressIndicator(), 1);
    assertTrue(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getAddress().equals("1122"));
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNumberQualifierIndicator(), 1);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNumberingPlanIndicator(), 0);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress()
            .getGenericNumber()
            .getAddressRepresentationRestrictedIndicator(),
        0);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getScreeningIndicator(), 1);
    assertEquals(elem.getCorrelationID().getGenericDigits().getEncodingScheme(), 2);
    assertEquals(elem.getCorrelationID().getGenericDigits().getTypeOfDigits(), 0);
    assertTrue(
        Arrays.equals(
            elem.getCorrelationID().getGenericDigits().getEncodedDigits(),
            getCorrelationIDDigits()));
    assertTrue(Arrays.equals(elem.getScfID().getData(), getScfIDData()));
    assertEquals(
        elem.getServiceInteractionIndicatorsTwo().getBothwayThroughConnectionInd(),
        BothwayThroughConnectionInd.bothwayPathNotRequired);
    assertEquals((int) elem.getCallSegmentID(), 8);
    assertEquals((int) elem.getNAOliInfo().getData(), 11);
    assertTrue(CAPExtensionsTest.checkTestCAPExtensions(elem.getExtensions()));
    assertNull(elem.getCarrier());
    assertNull(elem.getChargeNumber());
    assertNull(elem.getOriginalCalledPartyID());
    assertNull(elem.getCallingPartyNumber());

    data = this.getData3();
    ais = new AsnInputStream(data);
    elem = new EstablishTemporaryConnectionRequestImpl(true);
    tag = ais.readTag();
    elem.decodeAll(ais);

    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNatureOfAddressIndicator(), 1);
    assertTrue(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getAddress().equals("1122"));
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNumberQualifierIndicator(), 1);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getNumberingPlanIndicator(), 0);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress()
            .getGenericNumber()
            .getAddressRepresentationRestrictedIndicator(),
        0);
    assertEquals(
        elem.getAssistingSSPIPRoutingAddress().getGenericNumber().getScreeningIndicator(), 1);
    assertNull(elem.getCorrelationID());
    assertNull(elem.getScfID());
    assertNull(elem.getCallSegmentID());
    assertNull(elem.getNAOliInfo());
    assertNull(elem.getExtensions());
    assertEquals(elem.getCarrier().getData(), getCarrierData());
    assertEquals(
        elem.getChargeNumber().getLocationNumber().getNatureOfAddressIndicator(),
        LocationNumber._NAI_INTERNATIONAL_NUMBER);
    assertEquals(elem.getChargeNumber().getLocationNumber().getAddress(), "0000077777");
    assertEquals(
        elem.getOriginalCalledPartyID().getOriginalCalledNumber().getAddress(), "1111188888");
    assertEquals(elem.getCallingPartyNumber().getCallingPartyNumber().getAddress(), "2222288888");
  }