fail( de.getMessage() );
}
assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
SearchRequest searchRequest = ldapMessageContainer.getMessage();
assertEquals( 1, searchRequest.getMessageId() );
assertEquals( "a=b", searchRequest.getBase().toString() );
assertEquals( SearchScope.ONELEVEL, searchRequest.getScope() );
assertEquals( AliasDerefMode.DEREF_ALWAYS, searchRequest.getDerefAliases() );
assertEquals( 0, searchRequest.getSizeLimit() );
assertEquals( 0, searchRequest.getTimeLimit() );
assertEquals( true, searchRequest.getTypesOnly() );
// (&(...
ExprNode filter = searchRequest.getFilter();
AndNode andNode = ( AndNode ) filter;
assertNotNull( andNode );
List<ExprNode> andNodes = andNode.getChildren();
assertEquals( 2, andNodes.size() );
// (&(a=b)...
EqualityNode<?> equalityNode = ( EqualityNode<?> ) andNodes.get( 0 );
assertNotNull( equalityNode );
assertEquals( "a", equalityNode.getAttribute() );
assertEquals( "b", equalityNode.getValue().getString() );
// (&(a=b)(c=d))
equalityNode = ( EqualityNode<?> ) andNodes.get( 1 );
assertNotNull( equalityNode );
assertEquals( "c", equalityNode.getAttribute() );
assertEquals( "d", equalityNode.getValue().getString() );
List<String> attributes = searchRequest.getAttributes();
assertEquals( 0, attributes.size() );
// Check the encoding
// We won't check the whole PDU, as it may differs because
// attributes may have been reordered