use of org.grails.buffer.CodecPrintWriter in project grails-core by grails.
the class MockGrailsApplication method testPrintStreamCharBufferWithClosure.
@Test
public void testPrintStreamCharBufferWithClosure() throws IOException {
FastStringWriter stringwriter = new FastStringWriter();
CodecPrintWriter writer = new CodecPrintWriter(stringwriter, getEncoder(new MockGrailsApplication(), CodecWithClosureProperties.class), registry);
StreamCharBuffer buf = new StreamCharBuffer();
buf.getWriter().write("hola");
writer.write(buf);
writer.flush();
assertEquals("-> hola <-", stringwriter.getValue());
}
Aggregations