Пример #1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((mSCNumber == null) ? 0 : mSCNumber.hashCode());
   result = prime * result + ((sGSNNumber == null) ? 0 : sGSNNumber.hashCode());
   return result;
 }
Пример #2
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   AdditionalNumberImpl other = (AdditionalNumberImpl) obj;
   if (mSCNumber == null) {
     if (other.mSCNumber != null) return false;
   } else if (!mSCNumber.equals(other.mSCNumber)) return false;
   if (sGSNNumber == null) {
     if (other.sGSNNumber != null) return false;
   } else if (!sGSNNumber.equals(other.sGSNNumber)) return false;
   return true;
 }
Пример #3
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   LCSLocationInfoImpl other = (LCSLocationInfoImpl) obj;
   if (additionalLCSCapabilitySets == null) {
     if (other.additionalLCSCapabilitySets != null) return false;
   } else if (!additionalLCSCapabilitySets.equals(other.additionalLCSCapabilitySets)) return false;
   if (additionalNumber == null) {
     if (other.additionalNumber != null) return false;
   } else if (!additionalNumber.equals(other.additionalNumber)) return false;
   if (extensionContainer == null) {
     if (other.extensionContainer != null) return false;
   } else if (!extensionContainer.equals(other.extensionContainer)) return false;
   if (gprsNodeIndicator != other.gprsNodeIndicator) {
     return false;
   }
   if (lmsi == null) {
     if (other.lmsi != null) return false;
   } else if (!lmsi.equals(other.lmsi)) return false;
   if (networkNodeNumber == null) {
     if (other.networkNodeNumber != null) return false;
   } else if (!networkNodeNumber.equals(other.networkNodeNumber)) return false;
   if (supportedLCSCapabilitySets == null) {
     if (other.supportedLCSCapabilitySets != null) return false;
   } else if (!supportedLCSCapabilitySets.equals(other.supportedLCSCapabilitySets)) return false;
   if (mmeName == null) {
     if (other.mmeName != null) return false;
   } else if (!mmeName.equals(other.mmeName)) return false;
   if (aaaServerName == null) {
     if (other.aaaServerName != null) return false;
   } else if (!aaaServerName.equals(other.aaaServerName)) return false;
   return true;
 }
Пример #4
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result =
       prime * result
           + ((additionalLCSCapabilitySets == null) ? 0 : additionalLCSCapabilitySets.hashCode());
   result = prime * result + ((additionalNumber == null) ? 0 : additionalNumber.hashCode());
   result = prime * result + ((extensionContainer == null) ? 0 : extensionContainer.hashCode());
   result = prime * result + ((gprsNodeIndicator) ? 1 : 0);
   result = prime * result + ((lmsi == null) ? 0 : lmsi.hashCode());
   result = prime * result + ((networkNodeNumber == null) ? 0 : networkNodeNumber.hashCode());
   result =
       prime * result
           + ((supportedLCSCapabilitySets == null) ? 0 : supportedLCSCapabilitySets.hashCode());
   result = prime * result + ((mmeName == null) ? 0 : mmeName.hashCode());
   result = prime * result + ((aaaServerName == null) ? 0 : aaaServerName.hashCode());
   return result;
 }
Пример #5
0
  @Test(groups = {"functional.decode"})
  public void testDecode() throws Exception {

    byte[] rawData = getEncodedData();
    AsnInputStream asn = new AsnInputStream(rawData);

    int tag = asn.readTag();
    UpdateLocationRequestImpl asc = new UpdateLocationRequestImpl(3);
    asc.decodeAll(asn);

    assertEquals(tag, Tag.SEQUENCE);
    assertEquals(asn.getTagClass(), Tag.CLASS_UNIVERSAL);
    assertEquals(asc.getMapProtocolVersion(), 3);

    IMSI imsi = asc.getImsi();
    assertTrue(imsi.getData().equals("1111122222"));

    assertNull(asc.getRoamingNumber());
    ISDNAddressString mscNumber = asc.getMscNumber();
    assertTrue(mscNumber.getAddress().equals("22228"));
    assertEquals(mscNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(mscNumber.getNumberingPlan(), NumberingPlan.ISDN);

    ISDNAddressString vlrNumber = asc.getVlrNumber();
    assertTrue(vlrNumber.getAddress().equals("22229"));
    assertEquals(vlrNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(vlrNumber.getNumberingPlan(), NumberingPlan.ISDN);

    VLRCapability vlrCap = asc.getVlrCapability();
    assertTrue(vlrCap.getSupportedLCSCapabilitySets().getCapabilitySetRelease98_99());
    assertFalse(vlrCap.getSupportedLCSCapabilitySets().getCapabilitySetRelease4());

    assertNull(asc.getLmsi());
    assertNull(asc.getExtensionContainer());

    assertFalse(asc.getInformPreviousNetworkEntity());
    assertFalse(asc.getCsLCSNotSupportedByUE());
    assertFalse(asc.getSkipSubscriberDataUpdate());
    assertFalse(asc.getRestorationIndicator());

    rawData = getEncodedData2();
    asn = new AsnInputStream(rawData);

    tag = asn.readTag();
    asc = new UpdateLocationRequestImpl(3);
    asc.decodeAll(asn);

    assertEquals(tag, Tag.SEQUENCE);
    assertEquals(asn.getTagClass(), Tag.CLASS_UNIVERSAL);
    assertEquals(asc.getMapProtocolVersion(), 3);

    imsi = asc.getImsi();
    assertTrue(imsi.getData().equals("1111122233"));

    assertNull(asc.getRoamingNumber());
    mscNumber = asc.getMscNumber();
    assertTrue(mscNumber.getAddress().equals("22228"));
    assertEquals(mscNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(mscNumber.getNumberingPlan(), NumberingPlan.ISDN);

    vlrNumber = asc.getVlrNumber();
    assertTrue(vlrNumber.getAddress().equals("22229"));
    assertEquals(vlrNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(vlrNumber.getNumberingPlan(), NumberingPlan.ISDN);

    vlrCap = asc.getVlrCapability();
    assertTrue(vlrCap.getSupportedLCSCapabilitySets().getCapabilitySetRelease98_99());
    assertFalse(vlrCap.getSupportedLCSCapabilitySets().getCapabilitySetRelease4());

    assertTrue(Arrays.equals(asc.getLmsi().getData(), getLmsiData()));
    assertTrue(MAPExtensionContainerTest.CheckTestExtensionContainer(asc.getExtensionContainer()));

    assertTrue(asc.getInformPreviousNetworkEntity());
    assertTrue(asc.getCsLCSNotSupportedByUE());
    assertTrue(asc.getSkipSubscriberDataUpdate());
    assertTrue(asc.getRestorationIndicator());

    rawData = getEncodedData3();
    asn = new AsnInputStream(rawData);

    tag = asn.readTag();
    asc = new UpdateLocationRequestImpl(3);
    asc.decodeAll(asn);

    assertEquals(tag, Tag.SEQUENCE);
    assertEquals(asn.getTagClass(), Tag.CLASS_UNIVERSAL);
    assertEquals(asc.getMapProtocolVersion(), 3);

    imsi = asc.getImsi();
    assertTrue(imsi.getData().equals("1111122233"));

    assertNull(asc.getRoamingNumber());
    mscNumber = asc.getMscNumber();
    assertTrue(mscNumber.getAddress().equals("22228"));
    assertEquals(mscNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(mscNumber.getNumberingPlan(), NumberingPlan.ISDN);

    vlrNumber = asc.getVlrNumber();
    assertTrue(vlrNumber.getAddress().equals("22229"));
    assertEquals(vlrNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(vlrNumber.getNumberingPlan(), NumberingPlan.ISDN);

    vlrCap = asc.getVlrCapability();
    assertTrue(vlrCap.getSupportedLCSCapabilitySets().getCapabilitySetRelease98_99());
    assertFalse(vlrCap.getSupportedLCSCapabilitySets().getCapabilitySetRelease4());

    assertTrue(Arrays.equals(asc.getLmsi().getData(), getLmsiData()));
    assertNull(asc.getExtensionContainer());

    assertTrue(asc.getInformPreviousNetworkEntity());
    assertTrue(asc.getCsLCSNotSupportedByUE());
    assertTrue(asc.getSkipSubscriberDataUpdate());
    assertTrue(asc.getRestorationIndicator());

    assertTrue(Arrays.equals(asc.getVGmlcAddress().getData(), getGSNAddressData()));
    assertTrue(asc.getADDInfo().getImeisv().getIMEI().equals("123456789009876"));
    assertFalse(asc.getADDInfo().getSkipSubscriberDataUpdate());
    assertEquals(asc.getPagingArea().getLocationAreas().size(), 1);
    assertEquals(asc.getPagingArea().getLocationAreas().get(0).getLAC().getLac(), 123);

    rawData = getEncodedData_V1();
    asn = new AsnInputStream(rawData);

    tag = asn.readTag();
    asc = new UpdateLocationRequestImpl(1);
    asc.decodeAll(asn);

    assertEquals(tag, Tag.SEQUENCE);
    assertEquals(asn.getTagClass(), Tag.CLASS_UNIVERSAL);
    assertEquals(asc.getMapProtocolVersion(), 1);

    imsi = asc.getImsi();
    assertTrue(imsi.getData().equals("1111122233"));

    assertNull(asc.getMscNumber());
    ISDNAddressString roamingNumber = asc.getRoamingNumber();
    assertTrue(roamingNumber.getAddress().equals("22220"));
    assertEquals(roamingNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(roamingNumber.getNumberingPlan(), NumberingPlan.ISDN);

    vlrNumber = asc.getVlrNumber();
    assertTrue(vlrNumber.getAddress().equals("22221"));
    assertEquals(vlrNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(vlrNumber.getNumberingPlan(), NumberingPlan.ISDN);

    assertNull(asc.getVlrCapability());
    assertNull(asc.getLmsi());
    assertNull(asc.getExtensionContainer());
    assertFalse(asc.getInformPreviousNetworkEntity());
    assertFalse(asc.getCsLCSNotSupportedByUE());
    assertFalse(asc.getSkipSubscriberDataUpdate());
    assertFalse(asc.getRestorationIndicator());
  }
Пример #6
0
  @Test(groups = {"functional.decode", "primitives"})
  public void testDecode() throws Exception {
    byte[] data = this.getData();
    AsnInputStream asn = new AsnInputStream(data);
    int tag = asn.readTag();
    ExtForwFeatureImpl prim = new ExtForwFeatureImpl();
    prim.decodeAll(asn);

    assertEquals(tag, Tag.SEQUENCE);
    assertEquals(asn.getTagClass(), Tag.CLASS_UNIVERSAL);

    MAPExtensionContainer extensionContainer = prim.getExtensionContainer();
    assertEquals(
        prim.getBasicService().getExtBearerService().getBearerServiceCodeValue(),
        BearerServiceCodeValue.padAccessCA_9600bps);
    assertNull(prim.getBasicService().getExtTeleservice());
    assertNotNull(prim.getSsStatus());
    assertTrue(prim.getSsStatus().getBitA());
    assertTrue(!prim.getSsStatus().getBitP());
    assertTrue(!prim.getSsStatus().getBitQ());
    assertTrue(prim.getSsStatus().getBitR());

    ISDNAddressString forwardedToNumber = prim.getForwardedToNumber();
    assertNotNull(forwardedToNumber);
    assertTrue(forwardedToNumber.getAddress().equals("22228"));
    assertEquals(forwardedToNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(forwardedToNumber.getNumberingPlan(), NumberingPlan.ISDN);

    assertTrue(
        Arrays.equals(
            prim.getForwardedToSubaddress().getData(), this.getISDNSubaddressStringData()));
    assertTrue(prim.getForwardingOptions().getNotificationToCallingParty());
    assertTrue(prim.getForwardingOptions().getNotificationToForwardingParty());
    assertTrue(!prim.getForwardingOptions().getRedirectingPresentation());
    assertEquals(
        prim.getForwardingOptions().getExtForwOptionsForwardingReason(),
        ExtForwOptionsForwardingReason.msBusy);
    assertNotNull(prim.getNoReplyConditionTime());
    assertEquals(prim.getNoReplyConditionTime().intValue(), 2);
    FTNAddressString longForwardedToNumber = prim.getLongForwardedToNumber();
    assertNotNull(longForwardedToNumber);
    assertTrue(longForwardedToNumber.getAddress().equals("22227"));
    assertEquals(longForwardedToNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(longForwardedToNumber.getNumberingPlan(), NumberingPlan.ISDN);
    assertNotNull(extensionContainer);
    assertTrue(MAPExtensionContainerTest.CheckTestExtensionContainer(extensionContainer));

    data = this.getData2();
    asn = new AsnInputStream(data);
    tag = asn.readTag();
    prim = new ExtForwFeatureImpl();
    prim.decodeAll(asn);

    assertEquals(tag, Tag.SEQUENCE);
    assertEquals(asn.getTagClass(), Tag.CLASS_UNIVERSAL);

    extensionContainer = prim.getExtensionContainer();
    assertEquals(
        prim.getBasicService().getExtTeleservice().getTeleserviceCodeValue(),
        TeleserviceCodeValue.allSpeechTransmissionServices);
    assertNull(prim.getBasicService().getExtBearerService());
    assertNotNull(prim.getSsStatus());
    assertTrue(prim.getSsStatus().getBitA());
    assertTrue(prim.getSsStatus().getBitP());
    assertTrue(prim.getSsStatus().getBitQ());
    assertTrue(prim.getSsStatus().getBitR());

    forwardedToNumber = prim.getForwardedToNumber();
    assertNotNull(forwardedToNumber);
    assertTrue(forwardedToNumber.getAddress().equals("999888777"));
    assertEquals(forwardedToNumber.getAddressNature(), AddressNature.international_number);
    assertEquals(forwardedToNumber.getNumberingPlan(), NumberingPlan.ISDN);

    assertNull(prim.getForwardedToSubaddress());
    assertFalse(prim.getForwardingOptions().getNotificationToCallingParty());
    assertFalse(prim.getForwardingOptions().getNotificationToForwardingParty());
    assertFalse(prim.getForwardingOptions().getRedirectingPresentation());
    assertEquals(
        prim.getForwardingOptions().getExtForwOptionsForwardingReason(),
        ExtForwOptionsForwardingReason.msNotReachable);
    assertNull(prim.getNoReplyConditionTime());
    longForwardedToNumber = prim.getLongForwardedToNumber();
    assertNull(longForwardedToNumber);
    assertNull(extensionContainer);
  }