Run parser tests with robolectric

This commit is contained in:
ByteHamster 2022-01-22 16:55:20 +01:00
parent 147c996f60
commit 49b6386a6d
4 changed files with 10 additions and 0 deletions

View File

@ -9,4 +9,5 @@ dependencies {
implementation "commons-io:commons-io:$commonsioVersion"
testImplementation "junit:junit:$junitVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
}

View File

@ -5,6 +5,8 @@ import de.danoeh.antennapod.model.feed.EmbeddedChapterImage;
import de.danoeh.antennapod.parser.media.id3.model.FrameHeader;
import org.apache.commons.io.input.CountingInputStream;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -12,6 +14,7 @@ import java.util.List;
import static org.junit.Assert.assertEquals;
@RunWith(RobolectricTestRunner.class)
public class ChapterReaderTest {
private static final byte CHAPTER_WITHOUT_SUBFRAME_START_TIME = 23;
private static final byte[] CHAPTER_WITHOUT_SUBFRAME = {

View File

@ -4,6 +4,8 @@ import de.danoeh.antennapod.parser.media.id3.model.FrameHeader;
import de.danoeh.antennapod.parser.media.id3.model.TagHeader;
import org.apache.commons.io.input.CountingInputStream;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -14,6 +16,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@RunWith(RobolectricTestRunner.class)
public class Id3ReaderTest {
@Test
public void testReadString() throws IOException {

View File

@ -2,6 +2,8 @@ package de.danoeh.antennapod.parser.media.vorbis;
import de.danoeh.antennapod.model.feed.Chapter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.io.IOException;
import java.io.InputStream;
@ -9,6 +11,7 @@ import java.util.List;
import static org.junit.Assert.assertEquals;
@RunWith(RobolectricTestRunner.class)
public class VorbisCommentChapterReaderTest {
@Test