[Git][java-team/rome][master] 5 commits: New upstream version 1.12.1
Emmanuel Bourg
gitlab at salsa.debian.org
Thu Jul 11 22:38:25 BST 2019
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / rome
Commits:
fb63653e by Emmanuel Bourg at 2019-07-11T21:28:42Z
New upstream version 1.12.1
- - - - -
2dc00f03 by Emmanuel Bourg at 2019-07-11T21:28:45Z
Update upstream source from tag 'upstream/1.12.1'
Update to upstream version '1.12.1'
with Debian dir 848757986a960fa68144a3ffb1d1846350689250
- - - - -
eef66cbe by Emmanuel Bourg at 2019-07-11T21:37:29Z
Updated the Maven rules
- - - - -
7f902729 by Emmanuel Bourg at 2019-07-11T21:37:36Z
Standards-Version updated to 4.4.0
- - - - -
d56e8c0b by Emmanuel Bourg at 2019-07-11T21:37:42Z
Upload to unstable
- - - - -
22 changed files:
- debian/changelog
- debian/control
- debian/maven.ignoreRules
- pom.xml
- rome-certiorem-webapp/pom.xml
- rome-certiorem/pom.xml
- rome-fetcher/pom.xml
- rome-modules/pom.xml
- rome-modules/src/main/resources/rome.properties
- rome-modules/src/test/java/com/rometools/modules/psc/PodloveSimpleChapterGeneratorTest.java
- rome-modules/src/test/java/com/rometools/modules/psc/PodloveSimpleChapterParserTest.java
- + rome-modules/src/test/resources/psc/atom.xml
- rome-modules/src/test/resources/psc/test1.xml → rome-modules/src/test/resources/psc/rss.xml
- rome-opml/pom.xml
- rome-osgi-test/pom.xml
- rome-propono/pom.xml
- rome-utils/pom.xml
- rome/pom.xml
- rome/src/main/java/com/rometools/rome/feed/synd/impl/ConverterForRSS091Userland.java
- rome/src/main/java/com/rometools/rome/io/impl/DateParser.java
- rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java
- + rome/src/test/java/com/rometools/rome/io/impl/DateParserTest.java
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+rome (1.12.1-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream release
+ - Updated the Maven rules
+ * Standards-Version updated to 4.4.0
+
+ -- Emmanuel Bourg <ebourg at apache.org> Thu, 11 Jul 2019 23:37:39 +0200
+
rome (1.12.0-1) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -9,7 +9,7 @@ Build-Depends:
libmaven-bundle-plugin-java,
libslf4j-java,
maven-debian-helper
-Standards-Version: 4.3.0
+Standards-Version: 4.4.0
Vcs-Git: https://salsa.debian.org/java-team/rome.git
Vcs-Browser: https://salsa.debian.org/java-team/rome
Homepage: http://rometools.github.io/rome/
=====================================
debian/maven.ignoreRules
=====================================
@@ -1,5 +1,7 @@
ch.qos.logback logback-classic
com.github.tomakehurst wiremock
junit junit
+org.assertj assertj-core
org.hamcrest hamcrest-library
+org.owasp dependency-check-maven
org.sonatype.plugins nexus-staging-maven-plugin
=====================================
pom.xml
=====================================
@@ -6,7 +6,7 @@
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
<packaging>pom</packaging>
<modules>
@@ -207,42 +207,42 @@
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-certiorem</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-certiorem-webapp</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-fetcher</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-modules</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-opml</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-propono</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome-utils</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</dependency>
<!-- JDOM -->
<dependency>
@@ -259,7 +259,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>1.1.3</version>
+ <version>1.2.3</version>
</dependency>
<!-- JUnit -->
<dependency>
@@ -310,7 +310,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.4</version>
+ <version>3.8.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
=====================================
rome-certiorem-webapp/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-certiorem-webapp</artifactId>
=====================================
rome-certiorem/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-certiorem</artifactId>
=====================================
rome-fetcher/pom.xml
=====================================
@@ -6,7 +6,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-fetcher</artifactId>
=====================================
rome-modules/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-modules</artifactId>
=====================================
rome-modules/src/main/resources/rome.properties
=====================================
@@ -55,8 +55,7 @@ rss_1.0.item.ModuleParser.classes=com.rometools.modules.cc.io.ModuleParserRSS1 \
com.rometools.modules.base.io.GoogleBaseParser \
com.rometools.modules.base.io.CustomTagParser \
com.rometools.modules.content.io.ContentModuleParser \
- com.rometools.modules.slash.io.SlashModuleParser \
- com.rometools.modules.psc.io.PodloveSimpleChapterParser
+ com.rometools.modules.slash.io.SlashModuleParser
atom_0.3.item.ModuleParser.classes=com.rometools.modules.cc.io.ModuleParserRSS2 \
com.rometools.modules.base.io.GoogleBaseParser \
@@ -67,8 +66,7 @@ atom_0.3.item.ModuleParser.classes=com.rometools.modules.cc.io.ModuleParserRSS2
com.rometools.modules.georss.W3CGeoParser \
com.rometools.modules.photocast.io.Parser \
com.rometools.modules.mediarss.io.MediaModuleParser \
- com.rometools.modules.mediarss.io.AlternateMediaModuleParser \
- com.rometools.modules.psc.io.PodloveSimpleChapterParser
+ com.rometools.modules.mediarss.io.AlternateMediaModuleParser
atom_1.0.item.ModuleParser.classes=com.rometools.modules.cc.io.ModuleParserRSS2 \
com.rometools.modules.base.io.GoogleBaseParser \
@@ -123,12 +121,12 @@ rss_2.0.item.ModuleGenerator.classes=com.rometools.modules.cc.io.CCModuleGenerat
com.rometools.modules.photocast.io.Generator \
com.rometools.modules.mediarss.io.MediaModuleGenerator \
com.rometools.modules.atom.io.AtomModuleGenerator \
- com.rometools.modules.yahooweather.io.WeatherModuleGenerator
+ com.rometools.modules.yahooweather.io.WeatherModuleGenerator \
+ com.rometools.modules.psc.io.PodloveSimpleChapterGenerator
rss_1.0.item.ModuleGenerator.classes=com.rometools.modules.base.io.GoogleBaseGenerator \
com.rometools.modules.content.io.ContentModuleGenerator \
- com.rometools.modules.slash.io.SlashModuleGenerator \
- com.rometools.modules.psc.io.PodloveSimpleChapterGenerator
+ com.rometools.modules.slash.io.SlashModuleGenerator
atom_0.3.item.ModuleGenerator.classes=com.rometools.modules.cc.io.CCModuleGenerator \
com.rometools.modules.base.io.GoogleBaseGenerator \
@@ -138,8 +136,7 @@ atom_0.3.item.ModuleGenerator.classes=com.rometools.modules.cc.io.CCModuleGenera
com.rometools.modules.georss.SimpleGenerator \
com.rometools.modules.georss.W3CGeoGenerator \
com.rometools.modules.photocast.io.Generator \
- com.rometools.modules.mediarss.io.MediaModuleGenerator \
- com.rometools.modules.psc.io.PodloveSimpleChapterGenerator
+ com.rometools.modules.mediarss.io.MediaModuleGenerator
atom_1.0.item.ModuleGenerator.classes=com.rometools.modules.cc.io.CCModuleGenerator \
com.rometools.modules.base.io.CustomTagGenerator \
=====================================
rome-modules/src/test/java/com/rometools/modules/psc/PodloveSimpleChapterGeneratorTest.java
=====================================
@@ -35,24 +35,44 @@ public class PodloveSimpleChapterGeneratorTest extends AbstractTestCase {
return new TestSuite(PodloveSimpleChapterGeneratorTest.class);
}
- public void testGenerate() throws Exception {
+ public void testGenerateRss() throws Exception {
- log.debug("testGenerate");
+ log.debug("testGenerateRss");
final SyndFeedInput input = new SyndFeedInput();
- final SyndFeed feed = input.build(new XmlReader(new File(getTestFile("psc/test1.xml")).toURI().toURL()));
+ final SyndFeed feed = input.build(new XmlReader(new File(getTestFile("psc/rss.xml")).toURI().toURL()));
final SyndEntry entry = feed.getEntries().get(0);
entry.getModule(PodloveSimpleChapterModule.URI);
final SyndFeedOutput output = new SyndFeedOutput();
final StringWriter writer = new StringWriter();
output.output(feed, writer);
+ final String xml = writer.toString();
log.debug("{}", writer);
+ assertTrue(xml.contains("xmlns:psc=\"http://podlove.org/simple-chapters\""));
+ assertTrue(xml.contains("<psc:chapters version=\"1.2\">"));
+ assertTrue(xml.contains("<psc:chapter start=\"00:00:00.000\" title=\"Lorem Ipsum\" href=\"http://example.org\" image=\"http://example.org/cover\" />"));
}
- public void testGetNamespaces() {
- // TODO add test code
+ public void testGenerateAtom() throws Exception {
+
+ log.debug("testGenerateAtom");
+
+ final SyndFeedInput input = new SyndFeedInput();
+ final SyndFeed feed = input.build(new XmlReader(new File(getTestFile("psc/atom.xml")).toURI().toURL()));
+ final SyndEntry entry = feed.getEntries().get(0);
+ entry.getModule(PodloveSimpleChapterModule.URI);
+ final SyndFeedOutput output = new SyndFeedOutput();
+ final StringWriter writer = new StringWriter();
+ output.output(feed, writer);
+
+ final String xml = writer.toString();
+ log.debug("{}", writer);
+
+ assertTrue(xml.contains("xmlns:psc=\"http://podlove.org/simple-chapters\""));
+ assertTrue(xml.contains("<psc:chapters version=\"1.2\">"));
+ assertTrue(xml.contains("<psc:chapter start=\"00:00:00.000\" title=\"Lorem Ipsum\" href=\"http://example.org\" image=\"http://example.org/cover\" />"));
}
public void testGetNamespaceUri() {
=====================================
rome-modules/src/test/java/com/rometools/modules/psc/PodloveSimpleChapterParserTest.java
=====================================
@@ -34,22 +34,40 @@ public class PodloveSimpleChapterParserTest extends AbstractTestCase {
return new TestSuite(PodloveSimpleChapterParserTest.class);
}
- public void testParse() throws Exception {
+ public void testParseRss() throws Exception {
- log.debug("testParse");
+ log.debug("testParseRss");
final SyndFeedInput input = new SyndFeedInput();
- final SyndFeed feed = input.build(new XmlReader(new File(getTestFile("psc/test1.xml")).toURI().toURL()));
+ final SyndFeed feed = input.build(new XmlReader(new File(getTestFile("psc/rss.xml")).toURI().toURL()));
final SyndEntry entry = feed.getEntries().get(0);
- final PodloveSimpleChapterModule module = (PodloveSimpleChapterModule) entry.getModule(PodloveSimpleChapterModule.URI);
+ final PodloveSimpleChapterModule simpleChapters = (PodloveSimpleChapterModule) entry.getModule(PodloveSimpleChapterModule.URI);
- for (SimpleChapter c : module.getChapters()) {
+ assertNotNull(simpleChapters);
+ for (SimpleChapter c : simpleChapters.getChapters()) {
assertEquals("00:00:00.000", c.getStart());
assertEquals("Lorem Ipsum", c.getTitle());
assertEquals("http://example.org", c.getHref());
assertEquals("http://example.org/cover", c.getImage());
}
+ }
+
+ public void testParseAtom() throws Exception {
+
+ log.debug("testParseAtom");
+
+ final SyndFeedInput input = new SyndFeedInput();
+ final SyndFeed feed = input.build(new XmlReader(new File(getTestFile("psc/atom.xml")).toURI().toURL()));
+ final SyndEntry entry = feed.getEntries().get(0);
+ final PodloveSimpleChapterModule simpleChapters = (PodloveSimpleChapterModule) entry.getModule(PodloveSimpleChapterModule.URI);
+ assertNotNull(simpleChapters);
+ for (SimpleChapter c : simpleChapters.getChapters()) {
+ assertEquals("00:00:00.000", c.getStart());
+ assertEquals("Lorem Ipsum", c.getTitle());
+ assertEquals("http://example.org", c.getHref());
+ assertEquals("http://example.org/cover", c.getImage());
+ }
}
public void testGetNamespaceUri() {
=====================================
rome-modules/src/test/resources/psc/atom.xml
=====================================
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xmlns:psc="http://podlove.org/simple-chapters">
+ <title>Lorem Ipsum</title>
+ <link href="http://example.org"/>
+ <entry>
+ <title>Lorem Ipsum</title>
+ <link href="http://example.org/episode1"/>
+ <link rel="enclosure"
+ href="http://example.org/episode1.m4a" />
+ <psc:chapters version="1.2">
+ <psc:chapter start="00:00:00.000" title="Lorem Ipsum" href="http://example.org" image="http://example.org/cover"/>
+ <psc:chapter start="00:00:00.000" title="Lorem Ipsum" href="http://example.org" image="http://example.org/cover"/>
+ <psc:chapter start="00:00:00.000" title="Lorem Ipsum" href="http://example.org" image="http://example.org/cover"/>
+ </psc:chapters>
+ </entry>
+</feed>
\ No newline at end of file
=====================================
rome-modules/src/test/resources/psc/test1.xml → rome-modules/src/test/resources/psc/rss.xml
=====================================
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/xsl" media="screen" href="/~files/feed-premium.xsl"?>
-
<rss xmlns:psc="http://podlove.org/simple-chapters" version="2.0">
<channel>
<title>Lorem Ipsum</title>
@@ -10,7 +8,7 @@
<title>Lorem Ipsum</title>
<link>http://example.org/episode1</link>
<description><![CDATA[Lorem Ipsum]]></description>
- <psc:chapters xmlns:psc="http://podlove.org/simple-chapters" version="1.2">
+ <psc:chapters version="1.2">
<psc:chapter start="00:00:00.000" title="Lorem Ipsum" href="http://example.org" image="http://example.org/cover"/>
<psc:chapter start="00:00:00.000" title="Lorem Ipsum" href="http://example.org" image="http://example.org/cover"/>
<psc:chapter start="00:00:00.000" title="Lorem Ipsum" href="http://example.org" image="http://example.org/cover"/>
=====================================
rome-opml/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-opml</artifactId>
=====================================
rome-osgi-test/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-osgi-test</artifactId>
=====================================
rome-propono/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-propono</artifactId>
=====================================
rome-utils/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome-utils</artifactId>
=====================================
rome/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>com.rometools</groupId>
<artifactId>rome-parent</artifactId>
- <version>1.12.0</version>
+ <version>1.12.1</version>
</parent>
<artifactId>rome</artifactId>
@@ -69,6 +69,38 @@
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <!-- mvn spotbugs:spotbugs spotbugs:gui -->
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <version>3.1.11</version>
+ <dependencies>
+ <!-- overwrite dependency on spotbugs if you want to specify the version
+ of spotbugs -->
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs</artifactId>
+ <version>3.1.12</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <!-- mvn verify -->
+ <groupId>org.owasp</groupId>
+ <artifactId>dependency-check-maven</artifactId>
+ <version>5.0.0-M3</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <format>xml</format>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
@@ -100,6 +132,12 @@
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>3.11.1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
=====================================
rome/src/main/java/com/rometools/rome/feed/synd/impl/ConverterForRSS091Userland.java
=====================================
@@ -16,12 +16,6 @@
*/
package com.rometools.rome.feed.synd.impl;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
import com.rometools.rome.feed.WireFeed;
import com.rometools.rome.feed.module.DCModule;
import com.rometools.rome.feed.rss.Channel;
@@ -37,6 +31,12 @@ import com.rometools.rome.feed.synd.SyndImage;
import com.rometools.rome.feed.synd.SyndPerson;
import com.rometools.utils.Lists;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
public class ConverterForRSS091Userland extends ConverterForRSS090 {
public ConverterForRSS091Userland() {
@@ -166,6 +166,11 @@ public class ConverterForRSS091Userland extends ConverterForRSS090 {
syndEntry.setComments(item.getComments());
+ // DublinCoreTest will be failed without this row
+ // I don't have better solution
+ if (syndEntry.getPublishedDate() == null)
+ syndEntry.setPublishedDate(item.getPubDate());
+
if (desc != null) {
final SyndContent descContent = new SyndContentImpl();
descContent.setType(desc.getType());
=====================================
rome/src/main/java/com/rometools/rome/io/impl/DateParser.java
=====================================
@@ -104,7 +104,7 @@ public class DateParser {
ParsePosition pp = null;
Date d = null;
for (int i = 0; d == null && i < masks.length; i++) {
- final DateFormat df = new SimpleDateFormat(masks[i], locale);
+ final DateFormat df = new SimpleDateFormat(masks[i].trim(), locale);
// df.setLenient(false);
df.setLenient(true);
try {
@@ -227,12 +227,16 @@ public class DateParser {
*
* */
public static Date parseDate(final String sDate, final Locale locale) {
- Date date = parseW3CDateTime(sDate, locale);
+ Date date = null;
+ if (ADDITIONAL_MASKS.length > 0) {
+ date = parseUsingMask(ADDITIONAL_MASKS, sDate, locale);
+ if (date != null) {
+ return date;
+ }
+ }
+ date = parseW3CDateTime(sDate, locale);
if (date == null) {
date = parseRFC822(sDate, locale);
- if (date == null && ADDITIONAL_MASKS.length > 0) {
- date = parseUsingMask(ADDITIONAL_MASKS, sDate, locale);
- }
}
return date;
}
=====================================
rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java
=====================================
@@ -16,22 +16,17 @@
*/
package com.rometools.rome.io.impl;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-
+import com.rometools.rome.feed.WireFeed;
+import com.rometools.rome.feed.rss.*;
import org.jdom2.Attribute;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.Namespace;
-import com.rometools.rome.feed.WireFeed;
-import com.rometools.rome.feed.rss.Channel;
-import com.rometools.rome.feed.rss.Content;
-import com.rometools.rome.feed.rss.Description;
-import com.rometools.rome.feed.rss.Image;
-import com.rometools.rome.feed.rss.Item;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
public class RSS091UserlandParser extends RSS090Parser {
@@ -273,6 +268,11 @@ public class RSS091UserlandParser extends RSS090Parser {
item.setDescription(parseItemDescription(rssRoot, description));
}
+ final Element pubDate = eItem.getChild("pubDate", getRSSNamespace());
+ if (pubDate != null) {
+ item.setPubDate(DateParser.parseDate(pubDate.getText(), locale));
+ }
+
final Element encoded = eItem.getChild("encoded", getContentNamespace());
if (encoded != null) {
final Content content = new Content();
=====================================
rome/src/test/java/com/rometools/rome/io/impl/DateParserTest.java
=====================================
@@ -0,0 +1,51 @@
+package com.rometools.rome.io.impl;
+
+import static org.assertj.core.api.Assertions.*;
+import java.util.Date;
+import java.util.Locale;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Unit tests for {@link DateParser}.
+ *
+ * @author <a href="mailto:lutz.horn at posteo.de">Lutz Horn</a>
+ *
+ */
+public class DateParserTest {
+
+ @Before
+ public void before() {
+ }
+
+ @After
+ public void after() {
+ }
+
+ @Test
+ public void parseW3CDateTimeIsOk() {
+ Date result = DateParser.parseW3CDateTime("2019-06-07T15:27:13+02:00", Locale.GERMANY);
+
+ assertDateFields(result);
+ }
+
+ @Test
+ public void parseW3CDateTimeWithTrailingWhitespaceIsOk() {
+ Date result = DateParser.parseW3CDateTime("2019-06-07T15:27:13+02:00 ", Locale.GERMANY);
+
+ assertDateFields(result);
+ }
+
+ private void assertDateFields(Date result) {
+ assertThat(result).isNotNull();
+ assertThat(result).hasYear(2019);
+ assertThat(result).hasMonth(6);
+ assertThat(result).hasDayOfMonth(7);
+ assertThat(result).hasHourOfDay(15);
+ assertThat(result).hasMinute(27);
+ assertThat(result).hasSecond(13);
+ }
+
+}
View it on GitLab: https://salsa.debian.org/java-team/rome/compare/6cb1b2d34a8b5e52c1bad0c040f17525cf779985...d56e8c0b36511253cba659afeb748067fb64a9ee
--
View it on GitLab: https://salsa.debian.org/java-team/rome/compare/6cb1b2d34a8b5e52c1bad0c040f17525cf779985...d56e8c0b36511253cba659afeb748067fb64a9ee
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190711/b8146f2f/attachment.html>
More information about the pkg-java-commits
mailing list