XMLPipelineConfiguration config = createPipelineConfiguration();
WebDriverConfiguration webdConf = retrieveWebdConfiguration(config);
webdConf.setResponseContainsPipelineMarkup(true);
XMLPipelineContext context =
pipelineFactory.createPipelineContext(config,
createRootEnvironmentInteraction());
context.setProperty(HTTPResponsePreprocessor.class,
new HTTPResponsePreprocessor() {
public void preprocessResponse(HTTPMessageEntities headers,
HTTPMessageEntities cookies,
int statusCode) {
// create a content type header in order to perform a
// lookup
Header contentType =
HTTPFactory.getDefaultInstance()
.createHeader("Content-Type");
// retrieve all the contentType headers
Header[] headerArray = (Header[]) headers.retrieve(contentType.getIdentity());
// change all contentType headers
for (int i = 0; i < headerArray.length; i++) {
contentType = headerArray[i];
contentType.setValue("text/xml");
}
}
}, false);
WebDriverAccessor accessor = createWebDriverAccessor();
context.setProperty(WebDriverAccessor.class, accessor, false);
doInContextTest(context,
"SimpleGetTestCase.input.xml",
"SimpleGetTestCase.expected.xml");