use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith0Request.
/**
* Test parsing of a Request with the (optional) requestID attribute
*/
@Test
public void testResponseWith0Request() {
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(0, batchRequest.getRequests().size());
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith1ExtendedRequest.
/**
* Test parsing of a Request with 1 ExtendedRequest
*/
@Test
public void testResponseWith1ExtendedRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_1_ExtendedRequest.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 ExtendedRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith1SearchRequest.
/**
* Test parsing of a Request with 1 SearchRequest
*/
@Test
public void testResponseWith1SearchRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_1_SearchRequest.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 SearchRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith1AuthRequest.
/**
* Test parsing of a Request with 1 AuthRequest
*/
@Test
public void testResponseWith1AuthRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_1_AuthRequest.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 BindRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith1DelRequest.
/**
* Test parsing of a Request with 1 DelRequest
*/
@Test
public void testResponseWith1DelRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_1_DelRequest.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 DeleteRequest) {
assertTrue(true);
} else {
fail();
}
}
Aggregations