use of org.apache.directory.api.dsmlv2.request.SearchRequestDsml in project directory-ldap-api by apache.
the class SearchRequestTest method testRequestWithNestedNodes.
/**
* Test parsing of a request with a nested nodes DIRSHARED-137
*/
@Test
public void testRequestWithNestedNodes() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(SearchRequestTest.class.getResource("filters/request_with_nested_connector_nodes.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
SearchRequestDsml searchRequest = (SearchRequestDsml) parser.getBatchRequest().getCurrentRequest();
ExprNode filter = searchRequest.getFilter();
assertTrue(filter instanceof AndNode);
assertEquals("(&(|(sn=*foo*)(cn=*foo*))(|(ou=*josopuram*)(o=*k*)))", filter.toString());
// System.out.println( searchRequest.toDsml( new DefaultElement( "root" ) ).asXML() );
}
Aggregations