use of com.beanit.asn1bean.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);
assertArrayEquals(toBytes("BF2103830101"), os.getArray());
choice = new RetaggedUntaggedChoice();
choice.decode(new ByteArrayInputStream(os.getArray()));
assertNotNull(choice.getMyInteger());
assertNull(choice.getMyBoolean());
}
Aggregations