Code example for StringWriter

Methods: flushtoString

0
        root.put("hallo", null);
        JadeModel model = new JadeModel(root);
 
        JadeTemplate temp = cfg.getTemplate(getResourcePath("fullrun"));
 
        StringWriter out = new StringWriter();
        try { 
            temp.process(model, out);
        } catch (JadeCompilerException e) {
            e.printStackTrace();
            fail(); 
        } 
        out.flush();
        assertEquals("<div><div>Hi everybody</div></div>", out.toString());
 
    } 
 
    @Test 
    public void testEachLoopWithIterableMap() throws Exception { 
 
        IterableMap users = new IterableMap();