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