use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy in project mylyn.docs by eclipse.
the class BlockStrategiesTest method assertFallback.
protected void assertFallback(BlockType supportedType, BlockType blockType) {
BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(supportedType));
BlockStrategy strategy = strategies.getStrategy(blockType, new Attributes());
assertNotNull(strategy);
assertEquals(blockType.name(), SubstitutionBlockStrategy.class, strategy.getClass());
assertEquals(blockType.name(), supportedType, ((SubstitutionBlockStrategy) strategy).getBlockType());
}
use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy in project mylyn.docs by eclipse.
the class SubstitutionBlockStrategyTest method substitution.
@Test
public void substitution() {
SubstitutionBlockStrategy strategy = new SubstitutionBlockStrategy(BlockType.PARAGRAPH);
strategy.beginBlock(builder, BlockType.CODE, new Attributes());
builder.characters("test");
strategy.endBlock(builder);
assertEquals("<p>test</p>", writer.toString());
}
use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy in project mylyn.docs by eclipse.
the class BlockStrategiesTest method alternatives.
@Test
public void alternatives() {
BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.PARAGRAPH));
assertTrue(strategies.getStrategy(BlockType.CODE, new Attributes()) instanceof SubstitutionBlockStrategy);
}
Aggregations