Code example for StringWriter

Methods: getBuffer

0
        options.setWidth(50);
        options.setHeight(40);
        options.setNumberOfPoints(10);
 
        Reader reader = new StringReader(inputGeometry);
        StringWriter writer = new StringWriter();
 
        RectangleCommand command = new RectangleCommand();
        command.execute(options, reader, writer);
        assertEquals("POLYGON ((100 100, 125 100, 150 100, 150 120, 150 140, " 
                + "125 140, 100 140, 100 120, 100 100))", 
                writer.getBuffer().toString());
    } 
}