Search in sources :

Example 1 with ExtensibleAccessSequence

use of com.beanit.asn1bean.compiler.extension_test.extensible_with_access.ExtensibleAccessSequence in project jasn1 by openmuc.

the class ExtensibilityImpliedTest method setExtensionBytes.

@Test
void setExtensionBytes() throws IOException {
    NonExtensibleSequence nonExtensibleSequence = new NonExtensibleSequence();
    nonExtensibleSequence.setAge(new BerInteger(5));
    ExtensibleAccessSequence extensibleSequence = new ExtensibleAccessSequence();
    extensibleSequence.setAge(new BerInteger(5));
    extensibleSequence.setExtensionBytes(extensionCode);
    ExtensibleAccessSequenceAndMore extensibleSequenceAndMore = new ExtensibleAccessSequenceAndMore();
    extensibleSequenceAndMore.setExtensibleSequence(extensibleSequence);
    extensibleSequenceAndMore.setMore(new BerVisibleString("more"));
    ReverseByteArrayOutputStream os = new ReverseByteArrayOutputStream(100, true);
    extensibleSequenceAndMore.encode(os);
    Assertions.assertArrayEquals(extendedSequenceAndMoreCode, os.getArray());
}
Also used : ExtensibleAccessSequence(com.beanit.asn1bean.compiler.extension_test.extensible_with_access.ExtensibleAccessSequence) ExtensibleAccessSequenceAndMore(com.beanit.asn1bean.compiler.extension_test.extensible_with_access.ExtensibleAccessSequenceAndMore) NonExtensibleSequence(com.beanit.asn1bean.compiler.extension_test.non_extensible.NonExtensibleSequence) BerVisibleString(com.beanit.asn1bean.ber.types.string.BerVisibleString) BerInteger(com.beanit.asn1bean.ber.types.BerInteger) ReverseByteArrayOutputStream(com.beanit.asn1bean.ber.ReverseByteArrayOutputStream) Test(org.junit.jupiter.api.Test)

Aggregations

ReverseByteArrayOutputStream (com.beanit.asn1bean.ber.ReverseByteArrayOutputStream)1 BerInteger (com.beanit.asn1bean.ber.types.BerInteger)1 BerVisibleString (com.beanit.asn1bean.ber.types.string.BerVisibleString)1 ExtensibleAccessSequence (com.beanit.asn1bean.compiler.extension_test.extensible_with_access.ExtensibleAccessSequence)1 ExtensibleAccessSequenceAndMore (com.beanit.asn1bean.compiler.extension_test.extensible_with_access.ExtensibleAccessSequenceAndMore)1 NonExtensibleSequence (com.beanit.asn1bean.compiler.extension_test.non_extensible.NonExtensibleSequence)1 Test (org.junit.jupiter.api.Test)1