Examples of HtmlCanvas


Examples of org.rendersnake.HtmlCanvas

    public void testTextSample() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        html.write(StringResource.get("content/Sample.html"),false);
    }
    public void testTextSampleNoCache() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        html.write(StringResource.get("content/Sample.html",false),false);
    }   
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

public class InspectorTest extends TestCase {

    public void testInpsectPersonUI() throws IOException {
        PersonUI ui = new PersonUI(new Person());
        Inspector inspector = new Inspector(ui);
        HtmlCanvas html = new HtmlCanvas();
        html.render(inspector);
        assertNotNull("inspected html", html.toHtml());
        System.out.println(html.toHtml());
        assertTrue(html.toHtml().indexOf("<div class=\"rendersnake-inspector\">") == 0);
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

            assertTrue(true);
        }
    }

    public void testRender() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        resolver.setNextResolver(new MockCompponentResolver());
        html.render(resolver);
        assertFalse(html.toHtml().length() == 0);
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

import org.rendersnake.HtmlAttributes;
import org.rendersnake.HtmlCanvas;

public class CrossSiteScriptingTest extends TestCase {
    public void testContent() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        html.write("<&>");
        assertEquals("&lt;&amp;&gt;",html.toHtml());
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

public class HtmlCanvasTest extends TestCase {

    private HtmlCanvas html;

    public void setUp() {
        html = new HtmlCanvas();
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

   


    public void testCreateWithWriter() throws Exception {
        StringWriter out = new StringWriter(1024);
        HtmlCanvas html = new HtmlCanvas(out);
        html.write("hello");
        assertEquals(out.toString(), "hello");
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

        } catch (IllegalArgumentException ex) {
            // got it
        }
    } 
    public void testRender() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        ctx.renderForErrorOn(html);
        ctx.renderForInpectorOn(new Inspector(new PersonalPage()), html);
        assertFalse(html.toHtml().length() == 0);
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

        }       
    }    
   
    public void testEmpty() throws IOException {
               
        HtmlCanvas html = new HtmlCanvas();
        try {
            html.render(new CloseOnEmpty());
            fail("should raise render exception");
        } catch (RenderException rex) {
            assertTrue(rex.isEmptyStack);
            html.render(rex);
            assertTrue(html.toHtml().length() > 0);
            System.out.println(rex.toString());
        }
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

            System.out.println(rex.toString());
        }
    }
    public void testNull() throws IOException {
       
        HtmlCanvas html = new HtmlCanvas();
        try {
            html.render(new WriteNullTag());
            fail("should raise render exception");
        } catch (RenderException rex) {
            assertTrue(rex.isNullTag);
            html.render(rex);
            assertTrue(html.toHtml().length() > 0);
            System.out.println(rex.toString());
        }
    }
View Full Code Here

Examples of org.rendersnake.HtmlCanvas

            System.out.println(rex.toString());
        }
    }
    public void testCaught() throws IOException {
       
        HtmlCanvas html = new HtmlCanvas();
        try {
            html.render(new ErrorInRender());
            fail("should raise render exception");
        } catch (RenderException rex) {
            assertFalse(rex.isEmptyStack);
            html.render(rex);
            assertTrue(html.toHtml().length() > 0);
            System.out.println(rex.toString());
        }
    }   
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.