Search in sources :

Example 1 with ImplicitlyRetaggedTaggedChoice

use of org.openmuc.jasn1.compiler.tagging_test.ImplicitlyRetaggedTaggedChoice in project jasn1 by openmuc.

the class TaggingTest method implicitlyRetaggedTaggedChoiceTest.

@Test
public void implicitlyRetaggedTaggedChoiceTest() throws Exception {
    ImplicitlyRetaggedTaggedChoice choice = new ImplicitlyRetaggedTaggedChoice();
    choice.setMyInteger(new BerInteger(1));
    ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(1000);
    choice.encode(os);
    Assert.assertArrayEquals(DatatypeConverter.parseHexBinary("A303020101"), os.getArray());
}
Also used : ImplicitlyRetaggedTaggedChoice(org.openmuc.jasn1.compiler.tagging_test.ImplicitlyRetaggedTaggedChoice) BerInteger(org.openmuc.jasn1.ber.types.BerInteger) ReverseByteArrayOutputStream(org.openmuc.jasn1.ber.ReverseByteArrayOutputStream) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ReverseByteArrayOutputStream (org.openmuc.jasn1.ber.ReverseByteArrayOutputStream)1 BerInteger (org.openmuc.jasn1.ber.types.BerInteger)1 ImplicitlyRetaggedTaggedChoice (org.openmuc.jasn1.compiler.tagging_test.ImplicitlyRetaggedTaggedChoice)1