Package org.rendersnake

Examples of org.rendersnake.HtmlCanvas


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

public class MissingComponentErrorTest extends TestCase {

    public void testRender() throws Exception {
        QualifiedClassNameResolver resolver = new QualifiedClassNameResolver();
        MissingComponentError error = new MissingComponentError(resolver);
        HtmlCanvas html = new HtmlCanvas();
        error.renderOn(html);
    }
View Full Code Here

        FileUtils.copyDirectory(new File("src/main/webapp/htdocs"), new File(home + "/htdocs"));
    }

    private static void generate(String home, Renderable page, String uri) throws IOException {
        FileWriter fw = new FileWriter(home + "/" + uri);
        new HtmlCanvas(fw).render(page);
        fw.close();
        System.out.println("[generator] wrote " + uri + " size:" + new File(home + "/" + uri).length());
    }
View Full Code Here

public class PersonUITest extends TestCase {

    public void testRender() throws IOException {
        PersonUI ui = new PersonUI(new Person());
        HtmlCanvas html = new HtmlCanvas();
        ui.renderOn(html);
        System.out.println(html.toHtml());
    }
View Full Code Here

        HtmlCanvas html = new HtmlCanvas();
        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");
        tidy.parse(new ByteArrayInputStream(html.toHtml().getBytes()), System.out);       
    }
View Full Code Here

        tidy.setXHTML(true);
        tidy.setDocType("loose");
        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");
        try {
            tidy.parse(new ByteArrayInputStream(html.toHtml().getBytes()), System.out);       
        } catch (AssertionFailedError err) {
            System.out.println(err);
            // good thing
        }
    }
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));
    }
View Full Code Here

    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 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

TOP

Related Classes of org.rendersnake.HtmlCanvas

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.