use of org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents in project mylyn.docs by eclipse.
the class DocumentBuilderEventsTest method testToString.
@Test
public void testToString() {
BeginDocumentEvent event = new BeginDocumentEvent();
DocumentBuilderEvents events = new DocumentBuilderEvents(Lists.<DocumentBuilderEvent>newArrayList(event));
assertNotNull(events.toString());
assertTrue(events.toString().contains(event.toString()));
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents in project mylyn.docs by eclipse.
the class DocumentBuilderEventsTest method createsWithProvidedEvents.
@Test
public void createsWithProvidedEvents() {
BeginDocumentEvent event = new BeginDocumentEvent();
List<DocumentBuilderEvent> allEvents = Lists.<DocumentBuilderEvent>newArrayList(event);
DocumentBuilderEvents events = new DocumentBuilderEvents(allEvents);
assertEquals(allEvents, events.getEvents());
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents in project mylyn.docs by eclipse.
the class DocumentBuilderEventsTest method getEventsImmutable.
@Test
public void getEventsImmutable() {
DocumentBuilderEvents events = new DocumentBuilderEvents(Lists.<DocumentBuilderEvent>newArrayList());
thrown.expect(UnsupportedOperationException.class);
events.getEvents().clear();
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents in project mylyn.docs by eclipse.
the class ConfluenceLanguageIntegrationTest method parseToEvents.
private DocumentBuilderEvents parseToEvents(String markup) {
EventDocumentBuilder eventBuilder = new EventDocumentBuilder();
MarkupParser parser = new MarkupParser(new ConfluenceLanguage(), eventBuilder);
parser.parse(markup);
DocumentBuilderEvents events = eventBuilder.getDocumentBuilderEvents();
return events;
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvents in project mylyn.docs by eclipse.
the class CompositeSpanStrategyTest method test.
@Test
public void test() {
CompositeSpanStrategy strategy = new CompositeSpanStrategy(Lists.<SpanStrategy>newArrayList(new SubstitutionWithoutCssSpanStrategy(SpanType.BOLD), new SubstitutionWithoutCssSpanStrategy(SpanType.ITALIC)));
EventDocumentBuilder builder = new EventDocumentBuilder();
strategy.beginSpan(builder, SpanType.DELETED, new Attributes());
strategy.endSpan(builder);
DocumentBuilderEvents events = builder.getDocumentBuilderEvents();
assertEquals(ImmutableList.of(new BeginSpanEvent(SpanType.BOLD, new Attributes()), new BeginSpanEvent(SpanType.ITALIC, new Attributes()), new EndSpanEvent(), new EndSpanEvent()), events.getEvents());
}
Aggregations