use of com.beanit.asn1bean.compiler.extension_test.extensible_with_access.ExtensibleAccessSequenceAndMore in project jasn1 by openmuc.
the class ExtensibilityImpliedTest method accessExtensionBytes.
@Test
void accessExtensionBytes() throws IOException {
ExtensibleAccessSequenceAndMore extensibleSequenceAndMore = new ExtensibleAccessSequenceAndMore();
extensibleSequenceAndMore.decode(new ByteArrayInputStream(extendedSequenceAndMoreCode));
Assertions.assertEquals(5, extensibleSequenceAndMore.getExtensibleSequence().getAge().value.intValue());
Assertions.assertEquals("more", extensibleSequenceAndMore.getMore().toString());
Assertions.assertArrayEquals(extensionCode, extensibleSequenceAndMore.getExtensibleSequence().getExtensionBytes());
}
use of com.beanit.asn1bean.compiler.extension_test.extensible_with_access.ExtensibleAccessSequenceAndMore 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());
}
Aggregations