Search in sources :

Example 1 with MultiplexingDocumentBuilder

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

the class MultiplexingDocumentBuilderTest method flush.

@Test
public void flush() {
    final AtomicBoolean flushed = new AtomicBoolean();
    DocumentBuilder delegate = new NoOpDocumentBuilder() {

        @Override
        public void flush() {
            flushed.set(true);
        }
    };
    multiplexer = new MultiplexingDocumentBuilder(delegate);
    multiplexer.flush();
    assertTrue(flushed.get());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) NoOpDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.NoOpDocumentBuilder) NoOpDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.NoOpDocumentBuilder) DocumentBuilder(org.eclipse.mylyn.wikitext.parser.DocumentBuilder) MultiplexingDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.MultiplexingDocumentBuilder) EventDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder) MultiplexingDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.MultiplexingDocumentBuilder) Test(org.junit.Test)

Example 2 with MultiplexingDocumentBuilder

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

the class MultiplexingDocumentBuilderTest method setLocator.

@Test
public void setLocator() {
    DocumentBuilder delegateOne = new NoOpDocumentBuilder();
    DocumentBuilder delegateTwo = new NoOpDocumentBuilder();
    Locator locator = new ContentState();
    multiplexer = new MultiplexingDocumentBuilder(delegateOne, delegateTwo);
    multiplexer.setLocator(locator);
    assertSame(locator, delegateOne.getLocator());
    assertSame(locator, delegateTwo.getLocator());
}
Also used : NoOpDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.NoOpDocumentBuilder) Locator(org.eclipse.mylyn.wikitext.parser.Locator) NoOpDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.NoOpDocumentBuilder) DocumentBuilder(org.eclipse.mylyn.wikitext.parser.DocumentBuilder) MultiplexingDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.MultiplexingDocumentBuilder) EventDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder) MultiplexingDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.MultiplexingDocumentBuilder) ContentState(org.eclipse.mylyn.wikitext.parser.markup.ContentState) Test(org.junit.Test)

Aggregations

DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)2 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)2 MultiplexingDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.MultiplexingDocumentBuilder)2 NoOpDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.NoOpDocumentBuilder)2 Test (org.junit.Test)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Locator (org.eclipse.mylyn.wikitext.parser.Locator)1 ContentState (org.eclipse.mylyn.wikitext.parser.markup.ContentState)1