diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2021-03-01 11:26:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 11:26:05 +0100 |
commit | a6702bbcb5298744d560e96962ae64f363610bd7 (patch) | |
tree | b3c5ed5a9c91997c907583a8eb350bbff52e1912 /core/src/test | |
parent | ddd6a12354b776bf0ae28b2d0ea2f1f067daf341 (diff) | |
parent | 5431026adf6899f382b182c0a0ebf6f8307e1ed9 (diff) | |
download | AntennaPod-a6702bbcb5298744d560e96962ae64f363610bd7.zip |
Merge pull request #4972 from ByteHamster/chapter-demo-file
Added chapter parser test files from Hindenburg Journalist Pro
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/java/de/danoeh/antennapod/core/util/id3reader/ChapterReaderTest.java | 23 | ||||
-rw-r--r-- | core/src/test/resources/media-parser/hindenburg-journalist-pro.m4a | bin | 0 -> 23315 bytes | |||
-rw-r--r-- | core/src/test/resources/media-parser/hindenburg-journalist-pro.mp3 | bin | 0 -> 206098 bytes |
3 files changed, 23 insertions, 0 deletions
diff --git a/core/src/test/java/de/danoeh/antennapod/core/util/id3reader/ChapterReaderTest.java b/core/src/test/java/de/danoeh/antennapod/core/util/id3reader/ChapterReaderTest.java index ee4d43131..84fe9d94d 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/util/id3reader/ChapterReaderTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/util/id3reader/ChapterReaderTest.java @@ -162,4 +162,27 @@ public class ChapterReaderTest { assertEquals(EmbeddedChapterImage.makeUrl(1771, 308), chapters.get(2).getImageUrl()); assertEquals(EmbeddedChapterImage.makeUrl(2259, 308), chapters.get(3).getImageUrl()); } + + @Test + public void testRealFileHindenburgJournalistPro() throws IOException, ID3ReaderException { + CountingInputStream inputStream = new CountingInputStream(getClass().getClassLoader() + .getResource("media-parser/hindenburg-journalist-pro.mp3").openStream()); + ChapterReader reader = new ChapterReader(inputStream); + reader.readInputStream(); + List<Chapter> chapters = reader.getChapters(); + + assertEquals(2, chapters.size()); + + assertEquals(0, chapters.get(0).getStart()); + assertEquals(5006, chapters.get(1).getStart()); + + assertEquals("Chapter Marker 1", chapters.get(0).getTitle()); + assertEquals("Chapter Marker 2", chapters.get(1).getTitle()); + + assertEquals("https://example.com/chapter1url", chapters.get(0).getLink()); + assertEquals("https://example.com/chapter2url", chapters.get(1).getLink()); + + assertEquals(EmbeddedChapterImage.makeUrl(5330, 4015), chapters.get(0).getImageUrl()); + assertEquals(EmbeddedChapterImage.makeUrl(9498, 4364), chapters.get(1).getImageUrl()); + } } diff --git a/core/src/test/resources/media-parser/hindenburg-journalist-pro.m4a b/core/src/test/resources/media-parser/hindenburg-journalist-pro.m4a Binary files differnew file mode 100644 index 000000000..bd64dd9da --- /dev/null +++ b/core/src/test/resources/media-parser/hindenburg-journalist-pro.m4a diff --git a/core/src/test/resources/media-parser/hindenburg-journalist-pro.mp3 b/core/src/test/resources/media-parser/hindenburg-journalist-pro.mp3 Binary files differnew file mode 100644 index 000000000..d341b6045 --- /dev/null +++ b/core/src/test/resources/media-parser/hindenburg-journalist-pro.mp3 |