use of org.apache.directory.api.ldap.model.message.Request in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith1AuthRequestAnd1AddRequest.
/**
* Test parsing of a Request with 1 AuthRequest and 1 AddRequest
*/
@Test
public void testResponseWith1AuthRequestAnd1AddRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_1_AuthRequest_1_AddRequest.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
BatchRequestDsml batchRequest = parser.getBatchRequest();
List<DsmlDecorator<? extends Request>> requests = batchRequest.getRequests();
assertEquals(2, requests.size());
if (requests.get(0) instanceof BindRequest) {
assertTrue(true);
} else {
fail();
}
if (requests.get(1) instanceof AddRequest) {
assertTrue(true);
} else {
fail();
}
}
Aggregations