use of org.apache.directory.api.ldap.codec.decorators.SearchResultEntryDecorator in project directory-ldap-api by apache.
the class SearchResultEntryTest method testDecodeSearchResultEntryEmpty.
// Defensive tests
/**
* Test the decoding of an empty SearchResultEntry
*/
@Test
public void testDecodeSearchResultEntryEmpty() {
Asn1Decoder ldapDecoder = new Asn1Decoder();
ByteBuffer stream = ByteBuffer.allocate(0x07);
stream.put(new byte[] { // LDAPMessage ::=SEQUENCE {
0x30, // LDAPMessage ::=SEQUENCE {
0x05, 0x02, 0x01, // messageID MessageID
0x01, 0x64, // CHOICE { ..., searchResEntry SearchResultEntry,
0x00 // ...
});
stream.flip();
// Allocate a BindRequest Container
LdapMessageContainer<SearchResultEntryDecorator> ldapMessageContainer = new LdapMessageContainer<SearchResultEntryDecorator>(codec);
try {
ldapDecoder.decode(stream, ldapMessageContainer);
} catch (DecoderException de) {
assertTrue(true);
return;
}
fail("We should not reach this point");
}
Aggregations