Skip to content

Commit 9b98978

Browse files
committed
Add testContentAvailability(), fix missing methods in test interfaces
1 parent ffbdfaf commit 9b98978

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/BaseSearchExtractorTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ public interface BaseSearchExtractorTest extends BaseListExtractorTest {
99
void testSearchSuggestion() throws Exception;
1010
@Test
1111
void testSearchCorrected() throws Exception;
12+
@Test
13+
void testMetaInfo() throws Exception;
1214
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/BaseStreamExtractorTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,10 @@ public interface BaseStreamExtractorTest extends BaseExtractorTest {
6868
void testTags() throws Exception;
6969
@Test
7070
void testSupportInfo() throws Exception;
71+
@Test
72+
void testStreamSegmentsCount() throws Exception;
73+
@Test
74+
void testMetaInfo() throws Exception;
75+
@Test
76+
void testContentAvailability() throws Exception;
7177
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/DefaultSearchExtractorTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public void testSearchSuggestion() throws Exception {
5050
}
5151

5252
@Test
53+
@Override
5354
public void testSearchCorrected() throws Exception {
5455
assertEquals(isCorrectedSearch(), extractor().isCorrectedSearch());
5556
}
@@ -58,6 +59,7 @@ public void testSearchCorrected() throws Exception {
5859
* @see DefaultStreamExtractorTest#testMetaInfo()
5960
*/
6061
@Test
62+
@Override
6163
public void testMetaInfo() throws Exception {
6264
final List<MetaInfo> metaInfoList = extractor().getMetaInfo();
6365
final List<MetaInfo> expectedMetaInfoList = expectedMetaInfo();

extractor/src/test/java/org/schabi/newpipe/extractor/services/DefaultStreamExtractorTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.schabi.newpipe.extractor.MetaInfo;
88
import org.schabi.newpipe.extractor.localization.DateWrapper;
99
import org.schabi.newpipe.extractor.stream.AudioStream;
10+
import org.schabi.newpipe.extractor.stream.ContentAvailability;
1011
import org.schabi.newpipe.extractor.stream.Description;
1112
import org.schabi.newpipe.extractor.stream.Frameset;
1213
import org.schabi.newpipe.extractor.stream.StreamExtractor;
@@ -77,6 +78,7 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
7778
public String expectedSupportInfo() { return ""; } // default: no support info available
7879
public int expectedStreamSegmentsCount() { return -1; } // return 0 or greater to test (default is -1 to ignore)
7980
public List<MetaInfo> expectedMetaInfo() throws MalformedURLException { return Collections.emptyList(); } // default: no metadata info available
81+
public ContentAvailability expectedContentAvailability() { return ContentAvailability.UNKNOWN; } // default: unknown content availability
8082

8183
@Test
8284
@Override
@@ -429,6 +431,7 @@ public void testSupportInfo() throws Exception {
429431
}
430432

431433
@Test
434+
@Override
432435
public void testStreamSegmentsCount() throws Exception {
433436
if (expectedStreamSegmentsCount() >= 0) {
434437
assertEquals(expectedStreamSegmentsCount(), extractor().getStreamSegments().size());
@@ -439,6 +442,7 @@ public void testStreamSegmentsCount() throws Exception {
439442
* @see DefaultSearchExtractorTest#testMetaInfo()
440443
*/
441444
@Test
445+
@Override
442446
public void testMetaInfo() throws Exception {
443447
final List<MetaInfo> metaInfoList = extractor().getMetaInfo();
444448
final List<MetaInfo> expectedMetaInfoList = expectedMetaInfo();
@@ -463,6 +467,11 @@ public void testMetaInfo() throws Exception {
463467
assertTrue(urls.contains(expectedUrl));
464468
}
465469
}
470+
}
466471

472+
@Test
473+
@Override
474+
public void testContentAvailability() throws Exception {
475+
assertEquals(expectedContentAvailability(), extractor().getContentAvailability());
467476
}
468477
}

0 commit comments

Comments
 (0)