use of org.apache.directory.api.dsmlv2.DsmlDecorator in project directory-ldap-api by apache.
the class BatchResponseTest method testResponseWith1CompareResponse.
/**
* Test parsing of a Response with the 1 CompareResponse
*/
@Test
public void testResponseWith1CompareResponse() {
Dsmlv2ResponseParser parser = null;
try {
parser = new Dsmlv2ResponseParser(getCodec());
parser.setInput(BatchResponseTest.class.getResource("response_with_1_CompareResponse.xml").openStream(), "UTF-8");
parser.parse();
} catch (Exception e) {
fail(e.getMessage());
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals(1, batchResponse.getResponses().size());
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if (response instanceof CompareResponse) {
assertTrue(true);
} else {
fail();
}
}
Aggregations