use of org.xwiki.filter.input.DefaultFileInputSource in project xwiki-platform by xwiki.
the class XARInputFilterStreamTest method testSkipFirstDocument.
@Test
public void testSkipFirstDocument() throws FilterException, IOException, ComponentLookupException {
XARInputProperties xarProperties = new XARInputProperties();
xarProperties.setSource(new DefaultFileInputSource(extensionPackager.getExtensionFile(new ExtensionId("xar1", "1.0"))));
EntityReferenceSet entities = new EntityReferenceSet();
entities.includes(new LocalDocumentReference("space2", "page2"));
xarProperties.setEntities(entities);
assertXML("testSkipFirstDocument", xarProperties);
assertTrue(this.allLogRule.getMarker(0).contains(WikiDocumentFilter.LOG_DOCUMENT_SKIPPED));
}
use of org.xwiki.filter.input.DefaultFileInputSource in project xwiki-platform by xwiki.
the class XARInputFilterStreamTest method testSkipLastSpace.
@Test
public void testSkipLastSpace() throws FilterException, IOException, ComponentLookupException {
XARInputProperties xarProperties = new XARInputProperties();
xarProperties.setSource(new DefaultFileInputSource(extensionPackager.getExtensionFile(new ExtensionId("xar1", "1.0"))));
EntityReferenceSet entities = new EntityReferenceSet();
entities.excludes(new EntityReference("space2", EntityType.SPACE));
xarProperties.setEntities(entities);
assertXML("testSkipLastSpace", xarProperties);
assertTrue(this.allLogRule.getMarker(0).contains(WikiDocumentFilter.LOG_DOCUMENT_SKIPPED));
}
use of org.xwiki.filter.input.DefaultFileInputSource in project xwiki-platform by xwiki.
the class XWikiFileDeletedDocumentContent method getXWikiDocument.
@Override
public XWikiDocument getXWikiDocument(XWikiDocument document) throws XWikiException, IOException {
XWikiDocument result = document;
if (result == null) {
result = new XWikiDocument();
}
result.fromXML(new DefaultFileInputSource(this.content), true);
return result;
}
Aggregations