Ejemplo n.º 1
0
  @Test(groups = {"functional.encode", "service.sms"})
  public void testEncode() throws Exception {

    ReadyForSMResponseImpl impl =
        new ReadyForSMResponseImpl(MAPExtensionContainerTest.GetTestExtensionContainer());

    AsnOutputStream asnOS = new AsnOutputStream();

    impl.encodeAll(asnOS);

    byte[] encodedData = asnOS.toByteArray();
    byte[] rawData = getEncodedData();
    assertTrue(Arrays.equals(rawData, encodedData));
  }
Ejemplo n.º 2
0
  @Test(groups = {"functional.decode", "service.sms"})
  public void testDecode() throws Exception {

    byte[] rawData = getEncodedData();

    AsnInputStream asn = new AsnInputStream(rawData);

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

    ReadyForSMResponseImpl impl = new ReadyForSMResponseImpl();
    impl.decodeAll(asn);

    assertTrue(MAPExtensionContainerTest.CheckTestExtensionContainer(impl.getExtensionContainer()));
  }