use of org.apache.directory.api.dsmlv2.response.BatchResponseDsml in project directory-ldap-api by apache.
the class ParserUtilsTest method testStyleDocumentWithBatchResponse.
/**
* Test for DIRAPI-238: DSML pretty print does not work, prints error.
*
* Indirect test of ParserUtils.styleDocument() via BatchResponseDsml.toDsml()
*/
@Test
public void testStyleDocumentWithBatchResponse() throws Exception {
Dsmlv2ResponseParser parser = new Dsmlv2ResponseParser(getCodec());
parser.setInput(BatchResponseTest.class.getResource("response_with_2_SearchResponse.xml").openStream(), "UTF-8");
parser.parse();
BatchResponseDsml batchResponse = parser.getBatchResponse();
String dsml = batchResponse.toDsml();
assertNotNull(dsml);
assertEquals("Pretty printed DSML should contain newlines", 12, countNewlines(dsml));
assertEquals("Pretty printed DSML should contain indention", 18, countIndention(dsml));
}
Aggregations