Search in sources :

Example 1 with BeginBlockEvent

use of org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent in project mylyn.docs by eclipse.

the class EventDocumentBuilderTest method beginBlock.

@Test
public void beginBlock() {
    builder.beginBlock(BlockType.PREFORMATTED, new Attributes());
    assertEvents(new BeginBlockEvent(BlockType.PREFORMATTED, new Attributes()));
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) HeadingAttributes(org.eclipse.mylyn.wikitext.parser.HeadingAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) BeginBlockEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent) Test(org.junit.Test)

Example 2 with BeginBlockEvent

use of org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent in project mylyn.docs by eclipse.

the class SourceBlocksTest method process.

@Test
public void process() {
    EventDocumentBuilder builder = new EventDocumentBuilder();
    sourceBlocks.process(ProcessingContext.builder().build(), builder, LineSequence.create("one\nb2\nmore\n\nb1 and\n\n\nb2"));
    ImmutableList<DocumentBuilderEvent> expectedEvents = // 
    ImmutableList.of(// 
    new BeginBlockEvent(BlockType.PARAGRAPH, new Attributes()), // 
    new CharactersEvent("b2"), // 
    new CharactersEvent("more"), // 
    new EndBlockEvent(), // 
    new BeginBlockEvent(BlockType.QUOTE, new Attributes()), // 
    new CharactersEvent("b1 and"), // 
    new EndBlockEvent(), // 
    new BeginBlockEvent(BlockType.PARAGRAPH, new Attributes()), // 
    new CharactersEvent("b2"), new EndBlockEvent());
    assertEquals(Joiner.on("\n").join(builder.getDocumentBuilderEvents().getEvents()), expectedEvents, builder.getDocumentBuilderEvents().getEvents());
}
Also used : DocumentBuilderEvent(org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvent) CharactersEvent(org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent) EventDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder) EndBlockEvent(org.eclipse.mylyn.wikitext.parser.builder.event.EndBlockEvent) BeginBlockEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) Test(org.junit.Test)

Example 3 with BeginBlockEvent

use of org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent in project mylyn.docs by eclipse.

the class BeginBlockEventTest method equals.

@Test
public void equals() {
    assertEquality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent(BlockType.CODE, new Attributes()));
    assertInequality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent(BlockType.BULLETED_LIST, new Attributes()));
    assertInequality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent(BlockType.PREFORMATTED, new Attributes()));
}
Also used : BeginBlockEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) Test(org.junit.Test)

Example 4 with BeginBlockEvent

use of org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent in project mylyn.docs by eclipse.

the class MultiplexingDocumentBuilderTest method beginBlock.

@Test
public void beginBlock() {
    multiplexer.beginBlock(BlockType.PREFORMATTED, new Attributes());
    assertEvents(new BeginBlockEvent(BlockType.PREFORMATTED, new Attributes()));
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) HeadingAttributes(org.eclipse.mylyn.wikitext.parser.HeadingAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) BeginBlockEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent) Test(org.junit.Test)

Aggregations

Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)4 BeginBlockEvent (org.eclipse.mylyn.wikitext.parser.builder.event.BeginBlockEvent)4 Test (org.junit.Test)4 HeadingAttributes (org.eclipse.mylyn.wikitext.parser.HeadingAttributes)2 ImageAttributes (org.eclipse.mylyn.wikitext.parser.ImageAttributes)2 LinkAttributes (org.eclipse.mylyn.wikitext.parser.LinkAttributes)2 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)1 CharactersEvent (org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent)1 DocumentBuilderEvent (org.eclipse.mylyn.wikitext.parser.builder.event.DocumentBuilderEvent)1 EndBlockEvent (org.eclipse.mylyn.wikitext.parser.builder.event.EndBlockEvent)1