Examples of SinkEventTestingSink


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

        macroParameters.put( "play", "false" );
        macroParameters.put( "version", "6" );
        macroParameters.put( "allowScript", "always" );


        SinkEventTestingSink sink = new SinkEventTestingSink();
        MacroRequest request = new MacroRequest( macroParameters, new File( "." ) );
        SwfMacro macro = new SwfMacro();
        macro.required( "src", "value" );

        try
        {
            macro.required( "src", "" );
            fail();
        }
        catch ( IllegalArgumentException e )
        {
            assertNotNull( e );
        }

        try
        {
            macro.required( "src", null );
            fail();
        }
        catch ( IllegalArgumentException e )
        {
            assertNotNull( e );
        }

        macro.execute( sink, request );

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

        assertEquals( "rawText", event.getName() );
        assertFalse( it.hasNext() );

        request = new MacroRequest( new HashMap<String, Object>(), new File( "." ) );
        sink.reset();

        macro.execute( sink, request );

        it = sink.getEventList().iterator();
        event = it.next();

        assertEquals( "rawText", event.getName() );
        assertFalse( it.hasNext() );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.