Package org.apache.maven.doxia.sink

Examples of org.apache.maven.doxia.sink.SinkEventTestingSink


                "*----------*--------------+----------------:" + EOL +
                " cell 3,1 | cell 3,2      | cell 3," + EOL +
                "          |               | 3" + EOL +
                "*----------*--------------+----------------:" + EOL;

        SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();

        assertEquals( it, "head", "head_", "body", "table", "tableRows", "tableRow", "tableCell" );
        assertEquals( it.next(), "text", "cell 1, 1" );

        assertEquals( it, "tableCell_", "tableCell" );
View Full Code Here


                "*----------*--------------+----------------:" + EOL +
                " cell 3,1 | cell 3,2      | cell 3,\\" + EOL +
                "          |               | 3" + EOL +
                "*----------*--------------+----------------:" + EOL;

        SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();

        assertEquals( it, "head", "head_", "body", "table", "tableRows", "tableRow", "tableCell" );
        assertEquals( it.next(), "text", "cell 1,\u00A0" );

        assertEquals( it.next().getName(), "lineBreak" );
View Full Code Here

                "| Centered |   Centered   |   Centered    |" + EOL +
                "*----------*--------------+---------------:" + EOL +
                "| Centered | Left-aligned | Right-aligned |" + EOL +
                "*----------*--------------+---------------:";

        SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();

        assertEquals( it, "head", "head_", "body", "table", "tableRows", "tableRow" );
        assertAttributeEquals( it.next(), "tableCell", SinkEventAttributeSet.ALIGN, "center" );
        assertEquals( it.next(), "text", "Centered" );
        assertEquals( it.next().getName(), "tableCell_" );
View Full Code Here

                + EOL
                + "*--------------------------------------------------+---------------+" + EOL
                + "| \\~ \\= \\- \\+ \\* \\[ \\] \\< \\> \\{ \\} \\\\ \\u2713 | special chars |" + EOL
                + "*--------------------------------------------------+---------------+";

        SinkEventTestingSink sink = new SinkEventTestingSink();
        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();

        assertEquals( it, "head", "head_", "body", "paragraph" );
        assertEquals( it.next(), "text", "~ = - + * [ ] < > { } \\ \u2713" );

        assertEquals( it, "paragraph_", "table", "tableRows", "tableRow", "tableCell" );
View Full Code Here

    {
        final String text = "  {Anchor with spaces (and brackets)}" + EOL
            + "  Link to {{Anchor with spaces (and brackets)}}" + EOL
            + "  {{{http://fake.api#method(with, args)}method(with, args)}}" + EOL;

        final SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();

        assertEquals( it, "head", "head_", "body", "paragraph" );
        assertEquals( it.next(), "anchor", "Anchor_with_spaces_and_brackets" );

        assertEquals( it.next(), "text", "Anchor with spaces (and brackets)" );
View Full Code Here

    {
        // DOXIA-420
        String text = "Enhancements to the APT format" + EOL + EOL
            + "{Title with anchor}" + EOL;

        SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();

        assertEquals( it, "head", "head_", "body", "section1", "sectionTitle1", "text", "sectionTitle1_", "section1_",
                      "section1", "sectionTitle1", "anchor", "text", "anchor_", "sectionTitle1_", "section1_", "body_" );

        assertFalse( it.hasNext() );
View Full Code Here

            "  Cell 1    | Cell 2    |" + EOL +
            "*-----------+-----------+" + EOL +
            "  Cell 3    | Cell 4    |" + EOL +
            "*-----------+-----------+" + EOL;
       
        SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();

        assertEquals( it, "head", "head_", "body", "table", "tableRows" );
        assertEquals( it, "tableRow", "tableHeaderCell", "text", "tableHeaderCell_", "tableHeaderCell", "text",
                      "tableHeaderCell_", "tableRow_" );
        assertEquals( it, "tableRow", "tableCell", "text", "tableCell_", "tableCell", "text", "tableCell_", "tableRow_" );
View Full Code Here

        // DOXIA-479
        String text="*---+---+" + EOL +
            "| cell \\| pipe | next cell " + EOL +
            "*---+---+" + EOL;
       
        SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();
        assertEquals( it, "head", "head_", "body", "table", "tableRows", "tableRow", "tableCell" );
        assertEquals( it.next(), "text", "cell | pipe" );
        assertEquals( it, "tableCell_", "tableCell" );
        assertEquals( it.next(), "text", "next cell" );
        assertEquals( it, "tableCell_", "tableRow_", "tableRows_", "table_", "body_" );
View Full Code Here

    {
        // DOXIA-397
        String text =
            "{{{../apidocs/groovyx/net/http/ParserRegistry.html##parseText(org.apache.http.HttpResponse)}ParserRegistry}}";

        SinkEventTestingSink sink = new SinkEventTestingSink();

        parser.parse( text, sink );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();
        assertEquals( it, "head", "head_", "body", "section1", "sectionTitle1" );
        assertEquals( it.next(), "link",
                      "../apidocs/groovyx/net/http/ParserRegistry.html#parseText(org.apache.http.HttpResponse)" );
        assertEquals( it.next(), "text", "ParserRegistry" );
        assertEquals( it, "link_", "sectionTitle1_", "section1_", "body_" );
View Full Code Here

        final Map<String,Object> macroParameters = new HashMap<String,Object>();
        macroParameters.put( "paramName", "paramValue" );
        macroParameters.put( "parser", "parserValue" );
        macroParameters.put( "sourceContent", "sourceContentValue" );

        SinkEventTestingSink sink = new SinkEventTestingSink();
        MacroRequest request = new MacroRequest( macroParameters, new File( "." ) );

        new EchoMacro().execute( sink, request );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();
        SinkEventElement event = it.next();
        assertEquals( "verbatim", event.getName() );
        event = it.next();
        assertEquals( "text", event.getName() );
        assertEquals( "echo" + Macro.EOL,  (String) event.getArgs()[0] );
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.sink.SinkEventTestingSink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.