use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith2CompareRequest.
/**
* Test parsing of a Request with 2 CompareRequest
*/
@Test
public void testResponseWith2CompareRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_2_CompareRequest.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
BatchRequestDsml batchRequest = parser.getBatchRequest();
assertEquals(2, batchRequest.getRequests().size());
if (batchRequest.getCurrentRequest() instanceof CompareRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith1AddRequest.
/**
* Test parsing of a Request with 1 AddRequest
*/
@Test
public void testResponseWith1AddRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_1_AddRequest.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
BatchRequestDsml batchRequest = parser.getBatchRequest();
assertEquals(1, batchRequest.getRequests().size());
if (batchRequest.getCurrentRequest() instanceof AddRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith2AddRequest.
/**
* Test parsing of a Request with 2 AddRequest
*/
@Test
public void testResponseWith2AddRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_2_AddRequest.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
BatchRequestDsml batchRequest = parser.getBatchRequest();
assertEquals(2, batchRequest.getRequests().size());
if (batchRequest.getCurrentRequest() instanceof AddRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWithRequestId.
/**
* Test parsing of a Request with the (optional) requestID attribute
*/
@Test
public void testResponseWithRequestId() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_requestID_attribute.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
BatchRequestDsml batchRequest = parser.getBatchRequest();
assertEquals(1234567890, batchRequest.getRequestID());
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith2ExtendedRequest.
/**
* Test parsing of a Request with 2 ExtendedRequest
*/
@Test
public void testResponseWith2ExtendedRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_2_ExtendedRequest.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
BatchRequestDsml batchRequest = parser.getBatchRequest();
assertEquals(2, batchRequest.getRequests().size());
if (batchRequest.getCurrentRequest() instanceof ExtendedRequest) {
assertTrue(true);
} else {
fail();
}
}
Aggregations