Skip to content

Commit 4d5d4e7

Browse files
litetexStypox
authored andcommitted
Modify SoundcloudChannelTabExtractorTest so that it compiles
Also removed irrelevant methods See TeamNewPipe#1308
1 parent 409000a commit 4d5d4e7

1 file changed

Lines changed: 6 additions & 39 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudChannelTabExtractorTest.java

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,17 @@
1313
class SoundcloudChannelTabExtractorTest {
1414

1515
static class Tracks extends DefaultListExtractorTest<ChannelTabExtractor> {
16-
1716
@Override
1817
protected ChannelTabExtractor createExtractor() throws Exception {
1918
return SoundCloud.getChannelTabExtractorFromId("10494998", ChannelTabs.TRACKS);
2019
}
2120

22-
2321
@Override public StreamingService expectedService() throws Exception { return SoundCloud; }
2422
@Override public String expectedName() throws Exception { return ChannelTabs.TRACKS; }
2523
@Override public String expectedId() throws Exception { return "10494998"; }
2624
@Override public String expectedUrlContains() throws Exception { return "https://soundcloud.com/liluzivert/tracks"; }
2725
@Override public String expectedOriginalUrlContains() throws Exception { return "https://soundcloud.com/liluzivert/tracks"; }
2826
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; }
29-
@Override public boolean expectedHasMoreItems() { return true; }
3027

3128
@Test
3229
void testGetPageInNewExtractor() throws Exception {
@@ -48,7 +45,6 @@ protected ChannelTabExtractor createExtractor() throws Exception {
4845
@Override public String expectedUrlContains() throws Exception { return "https://soundcloud.com/neffexmusic/sets"; }
4946
@Override public String expectedOriginalUrlContains() throws Exception { return "https://soundcloud.com/neffexmusic/sets"; }
5047
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.PLAYLIST; }
51-
@Override public boolean expectedHasMoreItems() { return true; }
5248
}
5349

5450
static class Albums extends DefaultListExtractorTest<ChannelTabExtractor> {
@@ -63,62 +59,33 @@ protected ChannelTabExtractor createExtractor() throws Exception {
6359
@Override public String expectedUrlContains() throws Exception { return "https://soundcloud.com/bigsean-1/albums"; }
6460
@Override public String expectedOriginalUrlContains() throws Exception { return "https://soundcloud.com/bigsean-1/albums"; }
6561
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.PLAYLIST; }
66-
@Override public boolean expectedHasMoreItems() { return true; }
6762
}
6863

6964
static class LikesOnlyTracks extends DefaultListExtractorTest<ChannelTabExtractor> {
70-
private static SoundcloudChannelTabExtractor extractor;
71-
72-
@BeforeAll
73-
static void setUp() throws IOException, ExtractionException {
74-
NewPipe.init(DownloaderTestImpl.getInstance());
75-
extractor = (SoundcloudChannelTabExtractor) SoundCloud
76-
.getChannelTabExtractorFromId("30854092", ChannelTabs.LIKES);
77-
extractor.fetchPage();
65+
@Override
66+
protected ChannelTabExtractor createExtractor() throws Exception {
67+
return SoundCloud.getChannelTabExtractorFromId("30854092", ChannelTabs.LIKES);
7868
}
7969

80-
@Override public ChannelTabExtractor extractor() throws Exception { return extractor; }
8170
@Override public StreamingService expectedService() throws Exception { return SoundCloud; }
8271
@Override public String expectedName() throws Exception { return ChannelTabs.LIKES; }
8372
@Override public String expectedId() throws Exception { return "30854092"; }
8473
@Override public String expectedUrlContains() throws Exception { return "https://soundcloud.com/lubenitza/likes"; }
8574
@Override public String expectedOriginalUrlContains() throws Exception { return "https://soundcloud.com/lubenitza/likes"; }
8675
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; }
87-
@Override public boolean expectedHasMoreItems() { return true; }
88-
89-
@Test
90-
void testGetPageInNewExtractor() throws Exception {
91-
final ChannelTabExtractor newTabExtractor =
92-
SoundCloud.getChannelTabExtractorFromId("30854092", ChannelTabs.LIKES);
93-
defaultTestGetPageInNewExtractor(extractor, newTabExtractor);
94-
}
9576
}
9677

9778
static class LikesOnlyPlaylists extends DefaultListExtractorTest<ChannelTabExtractor> {
98-
private static SoundcloudChannelTabExtractor extractor;
99-
100-
@BeforeAll
101-
static void setUp() throws IOException, ExtractionException {
102-
NewPipe.init(DownloaderTestImpl.getInstance());
103-
extractor = (SoundcloudChannelTabExtractor) SoundCloud
104-
.getChannelTabExtractorFromId("1280839267", ChannelTabs.LIKES);
105-
extractor.fetchPage();
79+
@Override
80+
protected ChannelTabExtractor createExtractor() throws Exception {
81+
return SoundCloud.getChannelTabExtractorFromId("1280839267", ChannelTabs.LIKES);
10682
}
10783

108-
@Override public ChannelTabExtractor extractor() throws Exception { return extractor; }
10984
@Override public StreamingService expectedService() throws Exception { return SoundCloud; }
11085
@Override public String expectedName() throws Exception { return ChannelTabs.LIKES; }
11186
@Override public String expectedId() throws Exception { return "1280839267"; }
11287
@Override public String expectedUrlContains() throws Exception { return "https://soundcloud.com/soreen-735855039/likes"; }
11388
@Override public String expectedOriginalUrlContains() throws Exception { return "https://soundcloud.com/soreen-735855039/likes"; }
11489
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.PLAYLIST; }
115-
@Override public boolean expectedHasMoreItems() { return true; }
116-
117-
@Test
118-
void testGetPageInNewExtractor() throws Exception {
119-
final ChannelTabExtractor newTabExtractor =
120-
SoundCloud.getChannelTabExtractorFromId("1280839267", ChannelTabs.LIKES);
121-
defaultTestGetPageInNewExtractor(extractor, newTabExtractor);
122-
}
12390
}
12491
}

0 commit comments

Comments
 (0)