* (&(&(a=b)(c=d))(&(e=f)))
*/
@Test
public void testDecodeSearchRequestAnd_AndEqEq_AndEq()
{
Asn1Decoder ldapDecoder = new Asn1Decoder();
ByteBuffer stream = ByteBuffer.allocate( 0x3B );
stream.put( new byte[]
{ 0x30, 0x39, // LDAPMessage ::=SEQUENCE {
0x02,
0x01,
0x01, // messageID MessageID
0x63,
0x34, // CHOICE { ...,
// searchRequest SearchRequest, ...
// SearchRequest ::= APPLICATION[3] SEQUENCE {
0x04,
0x03, // baseObject LDAPDN,
'a',
'=',
'b',
0x0A,
0x01,
0x01, // scope ENUMERATED {
// baseObject (0),
// singleLevel (1),
// wholeSubtree (2) },
0x0A,
0x01,
0x03, // derefAliases ENUMERATED {
// neverDerefAliases (0),
// derefInSearching (1),
// derefFindingBaseObj (2),
// derefAlways (3) },
0x02,
0x01,
0x00, // sizeLimit INTEGER (0 .. maxInt), (0)
0x02,
0x01,
0x00, // timeLimit INTEGER (0 .. maxInt), (1000)
0x01,
0x01,
( byte ) 0xFF,// typesOnly BOOLEAN, (TRUE)
// filter Filter,
( byte ) 0xA0,
0x1C, // Filter ::= CHOICE { and [0] SET OF Filter,
( byte ) 0xA0,
0x10, // Filter ::= CHOICE { and [0] SET OF Filter,
( byte ) 0xA3,
0x06,// equalityMatch [3] Assertion,
// Assertion ::= SEQUENCE {
0x04,
0x01,
'a', // attributeDesc AttributeDescription (LDAPString),
0x04,
0x01,
'b', // assertionValue AssertionValue (OCTET STRING) }
( byte ) 0xA3,
0x06,// equalityMatch [3] Assertion,
// Assertion ::= SEQUENCE {
0x04,
0x01,
'c', // attributeDesc AttributeDescription (LDAPString),
0x04,
0x01,
'd', // assertionValue AssertionValue (OCTET STRING) }
( byte ) 0xA0,
0x08, // Filter ::= CHOICE { and [0] SET OF Filter,
( byte ) 0xA3,
0x06,// equalityMatch [3] Assertion,
// equalityMatch [3] Assertion,
// Assertion ::= SEQUENCE {
0x04,
0x01,
'e', // attributeDesc AttributeDescription (LDAPString),
0x04,
0x01,
'f', // assertionValue AssertionValue (OCTET STRING) }
0x30,
0x00 // AttributeDescriptionList ::= SEQUENCE OF AttributeDescription
} );
String decodedPdu = Strings.dumpBytes( stream.array() );
stream.flip();
// Allocate a BindRequest Container
LdapMessageContainer<SearchRequestDecorator> ldapMessageContainer =
new LdapMessageContainer<SearchRequestDecorator>( codec );
try
{
ldapDecoder.decode( stream, ldapMessageContainer );
}
catch ( DecoderException de )
{
de.printStackTrace();
fail( de.getMessage() );