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