You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ss...@apache.org on 2014/02/04 12:34:46 UTC
git commit: - add a test for incorrect date parsing
Updated Branches:
refs/heads/develop 7163de0bc -> c5ff79f65
- add a test for incorrect date parsing
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/c5ff79f6
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/c5ff79f6
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/c5ff79f6
Branch: refs/heads/develop
Commit: c5ff79f6510ca9979de1ff6ca00115fc7b43ec59
Parents: 7163de0
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Tue Feb 4 12:34:42 2014 +0100
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Tue Feb 4 12:34:42 2014 +0100
----------------------------------------------------------------------
.../apache/marmotta/commons/util/DateUtilsTest.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/marmotta/blob/c5ff79f6/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java
index 53b52a2..a793650 100644
--- a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java
@@ -17,11 +17,11 @@
*/
package org.apache.marmotta.commons.util;
-import java.util.Date;
-
import org.junit.Assert;
import org.junit.Test;
+import java.util.Date;
+
/**
* Unit-Tests for {@link DateUtils}.
*/
@@ -41,4 +41,13 @@ public class DateUtilsTest {
Assert.assertEquals(now, DateUtils.getDate(DateUtils.getXMLCalendar(now)));
}
+
+ @Test
+ public void testParseFreebaseDate() {
+ String dateString = "1961-08-04T19:24";
+ Date date = DateUtils.parseDate(dateString);
+
+ Assert.assertNotNull(date);
+ Assert.assertEquals(61, date.getYear());
+ }
}