Skip to content
Permalink
Browse files

Merge pull request #6 from alexlehm/master

fix [JENKINS-12586] cvs-plugin fails to read old changelog files
  • Loading branch information...
alexlehm committed Feb 12, 2012
2 parents 1ccef67 + be6dd95 commit f82d0b2c6ca9b8eb3bb175ebf3de3668c65be118
@@ -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(
"yyyy/MM/dd");
"yyyy-MM-dd");
private static final DateFormat TIME_FORMATTER = new SimpleDateFormat(
"HH:mm:ss");
"HH:mm");

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

import java.io.File;
import java.net.URISyntaxException;

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
@Test
public void testParseOldFile() throws Exception {
CVSChangeLogSet result = new CVSChangeLogParser().parse(null, getDataFile("changelogOldFormat.xml"));
assertNotNull(result);
}
}
@@ -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:
https://issues.jenkins-ci.org/browse/JENKINS-12586
the old format uses yyyy-mm-DD and HH:mm for date and time
-->
<changelog>
<entry>
<date>2011-12-14</date>
<time>23:26</time>
<author><![CDATA[user]]></author>
<file>
<name><![CDATA[file]]></name>
<fullName><![CDATA[/cvs/file1]]></fullName>
<revision>1.1.2.1</revision>
</file>
<msg><![CDATA[example entry]]></msg>
</entry>
</changelog>

0 comments on commit f82d0b2

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