@Test
public void testParseAndFilter() throws ParseException, JDOMException, IOException {

    String svnLog = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + "<log>\n"
            + "  <logentry revision=\"663\">\n" + "    <author>lee</author>\n"
            + "    <date>2003-08-02T10:01:13.349105Z</date>\n" + "    <paths>\n"
            + "      <path action=\"A\">/trunk/playground/bbb</path>\n" + "    </paths>\n" + "    <msg>bli</msg>\n"
            + "  </logentry>\n" + "  <logentry revision=\"664\">\n" + "    <author>etienne</author>\n"
            + "    <date>2003-07-29T17:45:12.100900Z</date>\n" + "    <paths>\n"
            + "      <path action=\"A\">/trunk/playground/aaa/f.txt</path>\n" + "    </paths>\n"
            + "    <msg>bla</msg>\n" + "  </logentry>\n" + "  <logentry revision=\"665\">\n"
            + "    <author>martin</author>\n" + "    <date>2003-07-29T18:15:11.100900Z</date>\n" + "    <paths>\n"
            + "      <path action=\"D\">/trunk/playground/ccc</path>\n" + "    </paths>\n" + "    <msg>blo</msg>\n"
            + "  </logentry>\n" + "</log>";
    TimeZone.setDefault(TimeZone.getTimeZone("GMT+0:00"));
    Date julyTwentynineSixPM2003 = new GregorianCalendar(2003, Calendar.JULY, 29, 18, 0, 0).getTime();
    List modifications = SVN.SVNLogXMLParser.parseAndFilter(new StringReader(svnLog), julyTwentynineSixPM2003);
    assertEquals(2, modifications.size());
    Modification modification = createModification(SVN.getOutDateFormatter().parse("2003-08-02T10:01:13.349"),
            "lee", "bli", "663", "", "/trunk/playground/bbb", "added");
    assertThat((Modification) modifications.get(0), equalTo(modification));
    modification = createModification(SVN.getOutDateFormatter().parse("2003-07-29T18:15:11.100"), "martin", "blo",
            "665", "", "/trunk/playground/ccc", "deleted");
    assertThat((Modification) modifications.get(1), equalTo(modification));
    Date julyTwentyeightZeroPM2003 = new GregorianCalendar(2003, Calendar.JULY, 28, 0, 0, 0).getTime();
    modifications = SVN.SVNLogXMLParser.parseAndFilter(new StringReader(svnLog), julyTwentyeightZeroPM2003);
    assertEquals(3, modifications.size());
    modifications = SVN.SVNLogXMLParser.parseAndFilter(new StringReader(svnLog), julyTwentynineSixPM2003,
            "external/path");
    assertEquals(2, modifications.size());
    modification = createModification(SVN.getOutDateFormatter().parse("2003-08-02T10:01:13.349"), "lee", "bli",
            "663", "", "/external/path:/trunk/playground/bbb", "added");
    assertThat((Modification) modifications.get(0), equalTo(modification));
}