}
@Test
public void getOriginalInputStream_exception() {
// 情况1. parse时调用
schema = new SchemaBaseImpl(new InputStreamSource() {
public InputStream getInputStream() throws IOException {
throw new IOException("hi");
}
@Override
public String toString() {
return "mysource";
}
});
schema.transform(transformer);
try {
schema.getInputStream();
fail();
} catch (ConfigurationPointException e) {
assertThat(e, exception("Failed to read text of schema file: myschema, source=mysource"));
}
// 情况2. getInputStream时调用(无transformer)
schema = new SchemaBaseImpl(new InputStreamSource() {
public InputStream getInputStream() throws IOException {
throw new IOException("hi");
}
@Override