Skip to content
Commits on Source (5)
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@apache.org> Thu, 11 Jul 2019 23:37:39 +0200
rome (1.12.0-1) unstable; urgency=medium
* Team upload.
......
......@@ -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/
......
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
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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 \
......
......@@ -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() {
......
......@@ -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() {
......
<?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
<?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"/>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......@@ -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());
......
......@@ -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,13 +227,17 @@ public class DateParser {
*
* */
public static Date parseDate(final String sDate, final Locale locale) {
Date date = parseW3CDateTime(sDate, locale);
if (date == null) {
date = parseRFC822(sDate, locale);
if (date == null && ADDITIONAL_MASKS.length > 0) {
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);
}
return date;
}
......