use of org.eclipse.mylyn.wikitext.html.internal.BlockStrategies in project mylyn.docs by eclipse.
the class BlockStrategiesTest method createEmpty.
@Test
public void createEmpty() {
BlockStrategies strategies = new BlockStrategies(Sets.<BlockType>newHashSet());
assertUnsupported(strategies, BlockType.PARAGRAPH);
}
use of org.eclipse.mylyn.wikitext.html.internal.BlockStrategies in project mylyn.docs by eclipse.
the class BlockStrategiesTest method lists.
@Test
public void lists() {
for (BlockType listType : new BlockType[] { BlockType.BULLETED_LIST, BlockType.NUMERIC_LIST }) {
BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(listType));
assertSupported(strategies, listType);
assertSupported(strategies, BlockType.LIST_ITEM);
}
}
use of org.eclipse.mylyn.wikitext.html.internal.BlockStrategies 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.BlockStrategies 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.BlockStrategies in project mylyn.docs by eclipse.
the class BlockStrategiesTest method createNonEmpty.
@Test
public void createNonEmpty() {
BlockStrategies strategies = new BlockStrategies(Sets.newHashSet(BlockType.PARAGRAPH, BlockType.CODE));
assertSupported(strategies, BlockType.PARAGRAPH);
assertSupported(strategies, BlockType.CODE);
for (BlockType blockType : BlockType.values()) {
assertNotNull(strategies.getStrategy(blockType, new Attributes()));
}
}
Aggregations