Package org.rendersnake

Examples of org.rendersnake.HtmlCanvas.render()


import org.rendersnake.HtmlCanvas;

public class Dump {
    public static void main(String[] args) throws IOException {
        HtmlCanvas html = new HtmlCanvas();
        html.render(HomePage.INSTANCE);
        System.out.println(html.toHtml());
    }
}
View Full Code Here


   
    public void buildPage(int howMany) throws IOException {
        NoWriter sink = new NoWriter();               
        for(int t=0;t<howMany;t++) {
          HtmlCanvas c = new HtmlCanvas(sink);
            c.render(HomePage.INSTANCE);
        }
        if (howMany != WARM_PAGES)
          System.out.println("Written chars:" + sink.written);
    }
   
View Full Code Here

        ui.renderOn(html);
        System.out.println(html.toHtml());
    }
    public void testPageRender() throws IOException {
        HtmlCanvas html = new HtmlCanvas();
        html.render(new PersonalPage());
       
        Tidy tidy = new Tidy();
        tidy.setMessageListener(new TidyMessageCheck());
        tidy.setXHTML(true);
        tidy.setDocType("loose");
View Full Code Here

        tidy.parse(new ByteArrayInputStream(html.toHtml().getBytes()), System.out);       
    }
    public void testPageRenderWithError() throws IOException {
        HtmlCanvas html = new HtmlCanvas();
        html.tag("bogus");
        html.render(new PersonalPage());
       
        Tidy tidy = new Tidy();
        tidy.setMessageListener(new TidyMessageCheck());
        tidy.setXHTML(true);
        tidy.setDocType("loose");
View Full Code Here

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

    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);
    }
    public void testInpsectNull() throws IOException {
View Full Code Here

    }

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

    public void testNext() {
        resolver.setNextResolver(new MockCompponentResolver());
View Full Code Here

   
    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);
View Full Code Here

        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());
        }
    }
    public void testNull() throws IOException {
View Full Code Here

    }
    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);
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.