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

    SupportedGADShapesImpl supportedLCSCapabilityTest =
        new SupportedGADShapesImpl(true, true, true, true, true, true, true);

    AsnOutputStream asnOS = new AsnOutputStream();
    supportedLCSCapabilityTest.encodeAll(asnOS);

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

    int tag = asn.readTag();
    SupportedGADShapesImpl supportedLCSCapabilityTest = new SupportedGADShapesImpl();
    supportedLCSCapabilityTest.decodeAll(asn);

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

    assertEquals((boolean) supportedLCSCapabilityTest.getEllipsoidArc(), true);
    assertEquals((boolean) supportedLCSCapabilityTest.getEllipsoidPoint(), true);
    assertEquals((boolean) supportedLCSCapabilityTest.getEllipsoidPointWithAltitude(), true);
    assertEquals(
        (boolean) supportedLCSCapabilityTest.getEllipsoidPointWithAltitudeAndUncertaintyElipsoid(),
        true);
    assertEquals(
        (boolean) supportedLCSCapabilityTest.getEllipsoidPointWithUncertaintyCircle(), true);
    assertEquals(
        (boolean) supportedLCSCapabilityTest.getEllipsoidPointWithUncertaintyEllipse(), true);
    assertEquals((boolean) supportedLCSCapabilityTest.getPolygon(), true);
  }