commit 7f00eab35ba1b3c69d7231e7d35e7f48b5b0dc32
parent 6d5a045c9d1054a43c597318856d64206ae55ac4
Author: Kebigon <git@kebigon.xyz>
Date: Sun, 26 Jan 2020 20:03:20 +0900
Take updated date into account
Diffstat:
3 files changed, 214 insertions(+), 0 deletions(-)
diff --git a/src/main/java/xyz/kebigon/yuzurss/json/Item.java b/src/main/java/xyz/kebigon/yuzurss/json/Item.java
@@ -43,6 +43,8 @@ public class Item implements Comparable<Item>
summary = sanitize(entry.getDescription().getValue());
if (entry.getPublishedDate() != null)
this.datePublished = entry.getPublishedDate();
+ else if (entry.getUpdatedDate() != null)
+ this.datePublished = entry.getUpdatedDate();
if (!entry.getAuthor().isEmpty())
this.author = new Author(entry.getAuthor());
diff --git a/src/test/java/xyz/kebigon/yuzurss/json/ItemTests.java b/src/test/java/xyz/kebigon/yuzurss/json/ItemTests.java
@@ -69,6 +69,48 @@ public class ItemTests
}
@Test
+ public void testGithubFeed() throws IllegalArgumentException, FeedException, IOException
+ {
+ final SyndFeedInput input = new SyndFeedInput();
+ final SyndFeed feed = input.build(new XmlReader(getClass().getResource("/github.xml")));
+
+ final Author author = new Author("alexbakker");
+
+ final Item item0 = new Item(feed.getEntries().get(0));
+ assertEquals("tag:github.com,2008:Repository/65757761/v1.1.4", item0.getId());
+ assertEquals("https://github.com/beemdevelopment/Aegis/releases/tag/v1.1.4", item0.getUrl());
+ assertEquals("v1.1.4", item0.getTitle());
+ assertEquals(
+ "<p>This is a minor release.</p>\n<h2>Fixed bugs</h2>\n<ul>\n<li>The export filename was missing the \".json\" extension in some cases</li>\n</ul>\n<p>The APK released to the Play Store has <code>versionCode</code> set to 29 instead of 28, because the update had to be resubmitted due to an erroneous rejection by Google.</p>",
+ item0.getContentHtml());
+ assertEquals(null, item0.getSummary());
+ assertEquals("2020-01-23T09:47:25.000Z", dateFormat.format(item0.getDatePublished()));
+ assertEquals(author, item0.getAuthor());
+
+ final Item item1 = new Item(feed.getEntries().get(1));
+ assertEquals("tag:github.com,2008:Repository/65757761/v1.1.3", item1.getId());
+ assertEquals("https://github.com/beemdevelopment/Aegis/releases/tag/v1.1.3", item1.getUrl());
+ assertEquals("v1.1.3", item1.getTitle());
+ assertEquals(
+ "<p>This is a minor release.</p>\n<h2>New features</h2>\n<ul>\n<li>Password reminder for users who use biometric unlock</li>\n</ul>\n<h2>Fixed bugs</h2>\n<ul>\n<li>Tokens would not refresh in some rare cases</li>\n</ul>\n<p>Expect an automatic backup feature to be released soon!</p>",
+ item1.getContentHtml());
+ assertEquals(null, item1.getSummary());
+ assertEquals("2020-01-20T20:42:14.000Z", dateFormat.format(item1.getDatePublished()));
+ assertEquals(author, item1.getAuthor());
+
+ final Item item2 = new Item(feed.getEntries().get(2));
+ assertEquals("tag:github.com,2008:Repository/65757761/v1.1.2", item2.getId());
+ assertEquals("https://github.com/beemdevelopment/Aegis/releases/tag/v1.1.2", item2.getUrl());
+ assertEquals("v1.1.2", item2.getTitle());
+ assertEquals(
+ "<h2>New features</h2>\n<ul>\n<li>Ability to select multiple entries</li>\n<li>Ability to select a file location when exporting the vault (including cloud providers like Google Drive)</li>\n<li>Explanation and warning for the security options</li>\n<li>Removed external storage permissions</li>\n</ul>",
+ item2.getContentHtml());
+ assertEquals(null, item2.getSummary());
+ assertEquals("2020-01-18T13:49:25.000Z", dateFormat.format(item2.getDatePublished()));
+ assertEquals(author, item2.getAuthor());
+ }
+
+ @Test
public void testSuumoFeed() throws IllegalArgumentException, FeedException, IOException
{
final SyndFeedInput input = new SyndFeedInput();
diff --git a/src/test/resources/github.xml b/src/test/resources/github.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
+ <id>tag:github.com,2008:https://github.com/beemdevelopment/Aegis/releases</id>
+ <link type="text/html" rel="alternate" href="https://github.com/beemdevelopment/Aegis/releases"/>
+ <link type="application/atom+xml" rel="self" href="https://github.com/beemdevelopment/Aegis/releases.atom"/>
+ <title>Release notes from Aegis</title>
+ <updated>2020-01-22T19:48:40Z</updated>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.1.4</id>
+ <updated>2020-01-23T09:47:25Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.1.4"/>
+ <title>v1.1.4</title>
+ <content type="html"><p>This is a minor release.</p>
+<h2>Fixed bugs</h2>
+<ul>
+<li>The export filename was missing the ".json" extension in some cases</li>
+</ul>
+<p>The APK released to the Play Store has <code>versionCode</code> set to 29 instead of 28, because the update had to be resubmitted due to an erroneous rejection by Google.</p></content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.1.3</id>
+ <updated>2020-01-20T20:42:14Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.1.3"/>
+ <title>v1.1.3</title>
+ <content type="html"><p>This is a minor release.</p>
+<h2>New features</h2>
+<ul>
+<li>Password reminder for users who use biometric unlock</li>
+</ul>
+<h2>Fixed bugs</h2>
+<ul>
+<li>Tokens would not refresh in some rare cases</li>
+</ul>
+<p>Expect an automatic backup feature to be released soon!</p></content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.1.2</id>
+ <updated>2020-01-18T13:49:25Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.1.2"/>
+ <title>v1.1.2</title>
+ <content type="html"><h2>New features</h2>
+<ul>
+<li>Ability to select multiple entries</li>
+<li>Ability to select a file location when exporting the vault (including cloud providers like Google Drive)</li>
+<li>Explanation and warning for the security options</li>
+<li>Removed external storage permissions</li>
+</ul></content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.1.1</id>
+ <updated>2020-01-04T12:06:37Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.1.1"/>
+ <title>v1.1.1</title>
+ <content type="html"><h2>Fixed bugs</h2>
+<ul>
+<li>Exporting the vault did not work on Android 10</li>
+</ul></content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.1</id>
+ <updated>2020-01-03T13:22:07Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.1"/>
+ <title>v1.1</title>
+ <content type="html"><h2>New features</h2>
+<ul>
+<li>Support for other types of biometric authentication (i.e. Pixel 4 face unlock)</li>
+<li>Support for importing from WinAuth</li>
+<li>Support for Chromebooks</li>
+<li>Option to highlight entries when tapped</li>
+<li>Filter for ungrouped tokens</li>
+<li>Ability to search for token account names</li>
+<li>Simplified Chinese translation (thanks RunningMelos!)</li>
+<li>Updated translations (thanks to all Crowdin contributors!)</li>
+</ul>
+<h2>Fixed bugs</h2>
+<ul>
+<li>The behavior of highlighting and revealing entries was inconsistent</li>
+<li>The changelog dialog didn't work</li>
+<li>The persistent notification was shown even after the app was killed</li>
+</ul></content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.1-beta1</id>
+ <updated>2019-12-24T14:10:55Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.1-beta1"/>
+ <title>v1.1-beta1</title>
+ <content type="html"><h2>New features</h2>
+<ul>
+<li>Support for other types of biometric authentication (i.e. Pixel 4 face unlock)</li>
+<li>Support for importing from WinAuth</li>
+<li>Support for Chromebooks</li>
+<li>Option to highlight entries when tapped</li>
+<li>Filter for ungrouped tokens</li>
+<li>Ability to search for token account names</li>
+<li>Simplified Chinese translation (thanks RunningMelos!)</li>
+</ul>
+<h2>Fixed bugs</h2>
+<ul>
+<li>The behavior of highlighting and revealing entries was inconsistent</li>
+</ul></content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.0.3</id>
+ <updated>2019-12-05T17:55:44Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.0.3"/>
+ <title>v1.0.3</title>
+ <content>No content.</content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.0.2</id>
+ <updated>2019-09-11T06:56:29Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.0.2"/>
+ <title>v1.0.2</title>
+ <content>No content.</content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.0.1</id>
+ <updated>2019-09-11T06:55:48Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.0.1"/>
+ <title>v1.0.1</title>
+ <content>No content.</content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+ <entry>
+ <id>tag:github.com,2008:Repository/65757761/v1.0</id>
+ <updated>2019-09-08T12:29:13Z</updated>
+ <link rel="alternate" type="text/html" href="https://github.com/beemdevelopment/Aegis/releases/tag/v1.0"/>
+ <title>v1.0</title>
+ <content>No content.</content>
+ <author>
+ <name>alexbakker</name>
+ </author>
+ <media:thumbnail height="30" width="30" url="https://avatars1.githubusercontent.com/u/2387841?s=60&v=4"/>
+ </entry>
+</feed>