FileDocCategorySizeDatePackage
ChangeLogWriterTest.javaAPI DocApache Ant 1.703463Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs.cvslib

ChangeLogWriterTest

public class ChangeLogWriterTest extends TestCase
Test for the cvslib ChangeLogWriter

Fields Summary
private ChangeLogWriter
writer
Constructors Summary
Methods Summary
public voidtestNonUTF8Characters()


         
        CVSEntry entry = new CVSEntry(new Date(), "Se\u00f1orita", "2003 < 2004 && 3 > 5");
        entry.addFile("Medicare & review.doc", "1.1");
        entry.addFile("El\u00e8ments de style", "1.2");
        CVSEntry[] entries = { entry };

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        PrintWriter pwriter = new PrintWriter(new OutputStreamWriter(output, "UTF-8"));
        writer.printChangeLog(pwriter, entries);

        // make sure that the parsing does not break
        XMLReader xmlReader = JAXPUtils.getXMLReader();
        InputStream input = new ByteArrayInputStream(output.toByteArray());
        xmlReader.setContentHandler(new NullContentHandler());
        xmlReader.parse(new InputSource(input));