use of org.apache.knox.test.Console in project knox by apache.
the class XmlGatewayDescriptorExporterTest method testXmlGatewayDescriptorStoreFailure.
@Test
public void testXmlGatewayDescriptorStoreFailure() throws IOException {
GatewayDescriptor descriptor = GatewayDescriptorFactory.create().addResource().addFilter().param().up().up().up();
Console console = new Console();
try {
console.capture();
GatewayDescriptorFactory.store(descriptor, "xml", new BrokenWriter());
fail("Expected IOException");
} catch (IOException e) {
assertThat(e.getMessage(), containsString("BROKEN"));
} finally {
console.release();
}
}
Aggregations