use of org.openmuc.jasn1.compiler.tagging_test.RetaggedUntaggedChoice in project jasn1 by openmuc.
the class TaggingTest method retaggedChoiceTest.
@Test
public void retaggedChoiceTest() throws Exception {
RetaggedUntaggedChoice choice = new RetaggedUntaggedChoice();
choice.setMyInteger(new BerInteger(1));
ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(1000);
choice.encode(os);
Assert.assertArrayEquals(DatatypeConverter.parseHexBinary("BF2103830101"), os.getArray());
choice = new RetaggedUntaggedChoice();
choice.decode(new ByteArrayInputStream(os.getArray()));
Assert.assertNotNull(choice.getMyInteger());
Assert.assertNull(choice.getMyBoolean());
}
Aggregations