use of org.eclipse.mylyn.wikitext.html.internal.BlockStrategy 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.BlockStrategy in project mylyn.docs by eclipse.
the class BlockStrategiesTest method fallBackToUnsupported.
@Test
public void fallBackToUnsupported() {
BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.PARAGRAPH));
BlockStrategy strategy = strategies.getStrategy(BlockType.TABLE_ROW, new Attributes());
assertNotNull(strategy);
assertTrue(UnsupportedBlockStrategy.class.equals(strategy.getClass()));
}
use of org.eclipse.mylyn.wikitext.html.internal.BlockStrategy in project mylyn.docs by eclipse.
the class BlockStrategiesTest method assertUnsupported.
private void assertUnsupported(BlockStrategies strategies, BlockType blockType) {
BlockStrategy blockStrategy = strategies.getStrategy(blockType, new Attributes());
assertNotNull(blockStrategy);
assertFalse(blockStrategy instanceof SupportedBlockStrategy);
}
use of org.eclipse.mylyn.wikitext.html.internal.BlockStrategy in project mylyn.docs by eclipse.
the class BlockStrategiesTest method fallBackToNoOp.
@Test
public void fallBackToNoOp() {
BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.PARAGRAPH));
List<BlockType> unsupportedBlockTypes = ImmutableList.of(BlockType.TABLE, BlockType.BULLETED_LIST, BlockType.NUMERIC_LIST, BlockType.DEFINITION_LIST);
for (BlockType blockType : unsupportedBlockTypes) {
BlockStrategy strategy = strategies.getStrategy(blockType, new Attributes());
assertNotNull(strategy);
assertTrue(NoOpBlockStrategy.class.equals(strategy.getClass()));
}
}
Aggregations