@Test public void testTransformWhenIncompleteMatchExistsFollowedByMatch() throws Exception { String expected = "beginDocument [[syntax]=[XWiki 2.1]]\n" + "beginParagraph\n" + "onSpecialSymbol [(]\n" + "onSpace\n" + "onImage [Typed = [true] Type = [icon] Reference = [information]] [true]\n" + "endParagraph\n" + "endDocument [[syntax]=[XWiki 2.1]]"; Parser parser = getComponentManager().getInstance(Parser.class, "xwiki/2.1"); XDOM xdom = parser.parse(new StringReader("( (i)")); getMockedComponent().transform(xdom, new TransformationContext()); WikiPrinter printer = new DefaultWikiPrinter(); BlockRenderer eventBlockRenderer = getComponentManager().getInstance(BlockRenderer.class, "event/1.0"); eventBlockRenderer.render(xdom, printer); Assert.assertEquals(expected, printer.toString()); }
@Override public void transform(Block source, TransformationContext context) throws TransformationException { List<Block> filteredBlocks = this.filter.filter(source.getChildren()); if (!this.mappingTree.getChildren().isEmpty() && !filteredBlocks.isEmpty()) { parseTree(filteredBlocks); } }
IconTransformation extends AbstractTransformation implements Initializable { @Override public void transform(Block source, TransformationContext context) throws TransformationException { List<Block> filteredBlocks = this.filter.filter(source.getChildren()); if (!this.mappingTree.getChildren().isEmpty() && !filteredBlocks.isEmpty()) { parseTree(filteredBlocks); } } }
IconTransformation extends AbstractTransformation implements Initializable { @Override public void transform(Block source, TransformationContext context) throws TransformationException { List<Block> filteredBlocks = this.filter.filter(source.getChildren()); if (!this.mappingTree.getChildren().isEmpty() && !filteredBlocks.isEmpty()) { parseTree(filteredBlocks); } }  }
IconTransformation extends AbstractTransformation implements Initializable { @Override public void transform(Block source, TransformationContext context) throws TransformationException { List<Block> filteredBlocks = this.filter.filter(source.getChildren()); if (!this.mappingTree.getChildren().isEmpty() && !filteredBlocks.isEmpty()) { parseTree(filteredBlocks); } }  @Override void initialize(); @Override void transform(Block source, TransformationContext context); }
IconTransformation extends AbstractTransformation implements Initializable { @Override public void transform(Block source, TransformationContext context) throws TransformationException { List<Block> filteredBlocks = this.filter.filter(source.getChildren()); if (!this.mappingTree.getChildren().isEmpty() && !filteredBlocks.isEmpty()) { parseTree(filteredBlocks); } }  @Override void initialize(); @Override void transform(Block source, TransformationContext context);  }