Skip to content
Browse files

[JENKINS-12586] cvs-plugin fails to read old changelog files

test and fix for the issue, old files contain date with yyyy-mm-DD and HH:mm, but the parser uses yyyy/mm/DD and HH:mm:ss
  • Loading branch information...
alexlehm committed Feb 12, 2012
1 parent 1ccef67 commit be6dd95edca7b4dbaf0125c6df0587d4b3c41e14
@@ -149,9 +149,9 @@ public static CVSChangeLogSet parse(final AbstractBuild<?, ?> build,
private static final DateFormat CHANGE_DATE_FORMATTER = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
private static final DateFormat DATE_FORMATTER = new SimpleDateFormat(
private static final DateFormat TIME_FORMATTER = new SimpleDateFormat(

private User author;
private String msg;
@@ -0,0 +1,22 @@
package hudson.scm;


import org.junit.Test;
import org.jvnet.hudson.test.HudsonTestCase;

public class CVSChangeLogParserTest extends HudsonTestCase {

// borrowed from core/test/.../TestResultTest
private File getDataFile(String name) throws URISyntaxException {
return new File(CVSChangeLogParserTest.class.getResource(name).toURI());

// verify fix for JENKINS-12586
public void testParseOldFile() throws Exception {
CVSChangeLogSet result = new CVSChangeLogParser().parse(null, getDataFile("changelogOldFormat.xml"));
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
example changelog.xml from 1.6 plugin, the format has changed in 2.0
but the old format is still read.
The file is used to check parsing the old format to verify this issue:
the old format uses yyyy-mm-DD and HH:mm for date and time
<msg><![CDATA[example entry]]></msg>

0 comments on commit be6dd95

Please sign in to comment.
You can’t perform that action at this time.