use of org.eclipse.xtext.xbase.resource.BatchLinkableResourceStorageWritable in project xtext-xtend by eclipse.
the class ResourceStorageTest method testFailedWrite.
@Test(expected = IOException.class)
public void testFailedWrite() throws Exception {
final XtendFile file = this.file("class C{}");
ByteArrayOutputStream _byteArrayOutputStream = new ByteArrayOutputStream();
Resource _eResource = file.eResource();
new BatchLinkableResourceStorageWritable(_byteArrayOutputStream, false) {
@Override
protected void writeAssociationsAdapter(final BatchLinkableResource resource, final OutputStream zipOut) throws IOException {
final Function1<Adapter, Boolean> _function = (Adapter it) -> {
return Boolean.valueOf((it instanceof JvmModelAssociator.Adapter));
};
final Adapter removeMe = IterableExtensions.<Adapter>findFirst(resource.eAdapters(), _function);
Assert.assertTrue(resource.eAdapters().remove(removeMe));
super.writeAssociationsAdapter(resource, zipOut);
}
}.writeResource(((StorageAwareResource) _eResource));
}
Aggregations