use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith1AbandonRequest.
/**
* Test parsing of a Request with 1 AbandonRequest
*/
@Test
public void testResponseWith1AbandonRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_1_AbandonRequest.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 AbandonRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith2DelRequest.
/**
* Test parsing of a Request with 2 DelRequest
*/
@Test
public void testResponseWith2DelRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_2_DelRequest.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 DeleteRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith2SearchRequest.
/**
* Test parsing of a Request with 2 SearchRequest
*/
@Test
public void testResponseWith2SearchRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_2_SearchRequest.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 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 testResponseWith2AbandonRequest.
/**
* Test parsing of a Request with 2 AbandonRequest
*/
@Test
public void testResponseWith2AbandonRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_2_AbandonRequest.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 AbandonRequest) {
assertTrue(true);
} else {
fail();
}
}
use of org.apache.directory.api.dsmlv2.request.BatchRequestDsml in project directory-ldap-api by apache.
the class BatchRequestTest method testResponseWith2ModifyRequest.
/**
* Test parsing of a Request with 2 ModifyRequest
*/
@Test
public void testResponseWith2ModifyRequest() {
Dsmlv2Parser parser = null;
try {
parser = newParser();
parser.setInput(BatchRequestTest.class.getResource("request_with_2_ModifyRequest.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 ModifyRequest) {
assertTrue(true);
} else {
fail();
}
}
Aggregations