Rollback classes naming

This commit is contained in:
Mauricio Colli
2017-08-10 22:23:09 -03:00
parent 8d88093eb7
commit 03634a2b6a
40 changed files with 435 additions and 429 deletions

View File

@@ -4,24 +4,24 @@ import org.junit.Before;
import org.junit.Test;
import org.schabi.newpipe.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.user.UserExtractor;
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
import static org.junit.Assert.*;
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
/**
* Test for {@link UserExtractor}
* Test for {@link ChannelExtractor}
*/
public class SoundcloudUserExtractorTest {
public class SoundcloudChannelExtractorTest {
UserExtractor extractor;
ChannelExtractor extractor;
@Before
public void setUp() throws Exception {
NewPipe.init(Downloader.getInstance());
extractor = SoundCloud.getService()
.getUserExtractor("https://soundcloud.com/liluzivert");
.getChannelExtractor("https://soundcloud.com/liluzivert");
}
@Test
@@ -30,8 +30,8 @@ public class SoundcloudUserExtractorTest {
}
@Test
public void testGetUserName() throws Exception {
assertEquals(extractor.getUserName(), "LIL UZI VERT");
public void testGetName() throws Exception {
assertEquals(extractor.getName(), "LIL UZI VERT");
}
@Test

View File

@@ -30,12 +30,12 @@ public class SoundcloudPlaylistExtractorTest {
@Test
public void testGetId() throws Exception {
assertEquals(extractor.getPlaylistId(), "246349810");
assertEquals(extractor.getId(), "246349810");
}
@Test
public void testGetName() throws Exception {
assertEquals(extractor.getPlaylistName(), "THE PERFECT LUV TAPE®");
assertEquals(extractor.getName(), "THE PERFECT LUV TAPE®");
}
@Test

View File

@@ -28,7 +28,7 @@ public class SoundcloudSearchEngineAllTest {
// SoundCloud will suggest "lil uzi vert" instead of "lill uzi vert"
// keep in mind that the suggestions can NOT change by country (the parameter "de")
result = engine.search("lill uzi vert", 0, "de",
EnumSet.of(SearchEngine.Filter.USER,
EnumSet.of(SearchEngine.Filter.CHANNEL,
SearchEngine.Filter.STREAM)).getSearchResult();
}

View File

@@ -17,7 +17,7 @@ import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
/**
* Test for {@link SearchEngine}
*/
public class SoundcloudSearchEngineUserTest {
public class SoundcloudSearchEngineChannelTest {
private SearchResult result;
@Before
@@ -28,7 +28,7 @@ public class SoundcloudSearchEngineUserTest {
// SoundCloud will suggest "lil uzi vert" instead of "lill uzi vert"
// keep in mind that the suggestions can NOT change by country (the parameter "de")
result = engine.search("lill uzi vert", 0, "de",
EnumSet.of(SearchEngine.Filter.USER)).getSearchResult();
EnumSet.of(SearchEngine.Filter.CHANNEL)).getSearchResult();
}
@Test
@@ -39,7 +39,7 @@ public class SoundcloudSearchEngineUserTest {
@Test
public void testResultsItemType() {
for (InfoItem infoItem : result.resultList) {
assertEquals(InfoItem.InfoType.USER, infoItem.info_type);
assertEquals(InfoItem.InfoType.CHANNEL, infoItem.info_type);
}
}

View File

@@ -29,19 +29,19 @@ public class SoundcloudStreamExtractorDefaultTest {
@Test
public void testGetInvalidTimeStamp() throws ParsingException {
assertTrue(Integer.toString(extractor.getTimeStamp()),
assertTrue(extractor.getTimeStamp() + "",
extractor.getTimeStamp() <= 0);
}
@Test
public void testGetValidTimeStamp() throws IOException, ExtractionException {
StreamExtractor extractor = SoundCloud.getService().getStreamExtractor("https://soundcloud.com/liluzivert/do-what-i-want-produced-by-maaly-raw-don-cannon#t=69");
assertEquals(Integer.toString(extractor.getTimeStamp()), "69");
assertEquals(extractor.getTimeStamp() + "", "69");
}
@Test
public void testGetTitle() throws ParsingException {
assertEquals(extractor.getTitle(), "Do What I Want [Produced By Maaly Raw + Don Cannon]");
assertEquals(extractor.getName(), "Do What I Want [Produced By Maaly Raw + Don Cannon]");
}
@Test

View File

@@ -4,7 +4,7 @@ import org.junit.Before;
import org.junit.Test;
import org.schabi.newpipe.Downloader;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.user.UserExtractor;
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
import static org.junit.Assert.*;
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
@@ -30,17 +30,17 @@ import static org.schabi.newpipe.extractor.ServiceList.YouTube;
*/
/**
* Test for {@link UserExtractor}
* Test for {@link ChannelExtractor}
*/
public class YoutubeUserExtractorTest {
public class YoutubeChannelExtractorTest {
UserExtractor extractor;
ChannelExtractor extractor;
@Before
public void setUp() throws Exception {
NewPipe.init(Downloader.getInstance());
extractor = YouTube.getService()
.getUserExtractor("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw");
.getChannelExtractor("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw");
}
@Test
@@ -49,8 +49,8 @@ public class YoutubeUserExtractorTest {
}
@Test
public void testGetUserName() throws Exception {
assertEquals(extractor.getUserName(), "Gronkh");
public void testGetName() throws Exception {
assertEquals(extractor.getName(), "Gronkh");
}
@Test

View File

@@ -30,12 +30,12 @@ public class YoutubePlaylistExtractorTest {
@Test
public void testGetId() throws Exception {
assertEquals(extractor.getPlaylistId(), "PL7XlqX4npddfrdpMCxBnNZXg2GFll7t5y");
assertEquals(extractor.getId(), "PL7XlqX4npddfrdpMCxBnNZXg2GFll7t5y");
}
@Test
public void testGetName() throws Exception {
assertEquals(extractor.getPlaylistName(), "important videos");
assertEquals(extractor.getName(), "important videos");
}
@Test

View File

@@ -49,7 +49,7 @@ public class YoutubeSearchEngineAllTest {
// Youtube will suggest "asdf" instead of "asdgff"
// keep in mind that the suggestions can change by country (the parameter "de")
result = engine.search("asdgff", 0, "de",
EnumSet.of(SearchEngine.Filter.USER,
EnumSet.of(SearchEngine.Filter.CHANNEL,
SearchEngine.Filter.STREAM)).getSearchResult();
}

View File

@@ -38,7 +38,7 @@ import static org.schabi.newpipe.extractor.ServiceList.YouTube;
/**
* Test for {@link SearchEngine}
*/
public class YoutubeSearchEngineUserTest {
public class YoutubeSearchEngineChannelTest {
private SearchResult result;
@Before
@@ -49,7 +49,7 @@ public class YoutubeSearchEngineUserTest {
// Youtube will suggest "gronkh" instead of "grrunkh"
// keep in mind that the suggestions can change by country (the parameter "de")
result = engine.search("grrunkh", 0, "de",
EnumSet.of(SearchEngine.Filter.USER)).getSearchResult();
EnumSet.of(SearchEngine.Filter.CHANNEL)).getSearchResult();
}
@Test
@@ -60,7 +60,7 @@ public class YoutubeSearchEngineUserTest {
@Test
public void testResultsItemType() {
for (InfoItem infoItem : result.resultList) {
assertEquals(InfoItem.InfoType.USER, infoItem.info_type);
assertEquals(InfoItem.InfoType.CHANNEL, infoItem.info_type);
}
}

View File

@@ -13,6 +13,7 @@ import org.schabi.newpipe.extractor.stream.VideoStream;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
@@ -52,20 +53,19 @@ public class YoutubeStreamExtractorDefaultTest {
@Test
public void testGetInvalidTimeStamp() throws ParsingException {
assertTrue(Integer.toString(extractor.getTimeStamp()),
assertTrue(extractor.getTimeStamp() + "",
extractor.getTimeStamp() <= 0);
}
@Test
public void testGetValidTimeStamp() throws IOException, ExtractionException {
StreamExtractor extractor = YouTube.getService().getStreamExtractor("https://youtu.be/FmG385_uUys?t=174");
assertTrue(Integer.toString(extractor.getTimeStamp()),
extractor.getTimeStamp() == 174);
assertEquals(extractor.getTimeStamp() + "", "174");
}
@Test
public void testGetTitle() throws ParsingException {
assertTrue(!extractor.getTitle().isEmpty());
assertTrue(!extractor.getName().isEmpty());
}
@Test

View File

@@ -11,6 +11,7 @@ import org.schabi.newpipe.extractor.stream.VideoStream;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
@@ -30,16 +31,13 @@ public class YoutubeStreamExtractorRestrictedTest {
@Test
public void testGetInvalidTimeStamp() throws ParsingException {
assertTrue(Integer.toString(extractor.getTimeStamp()),
extractor.getTimeStamp() <= 0);
assertTrue(extractor.getTimeStamp() + "", extractor.getTimeStamp() <= 0);
}
@Test
public void testGetValidTimeStamp() throws IOException, ExtractionException {
StreamExtractor extractor = YouTube.getService()
.getStreamExtractor("https://youtu.be/FmG385_uUys?t=174");
assertTrue(Integer.toString(extractor.getTimeStamp()),
extractor.getTimeStamp() == 174);
StreamExtractor extractor = YouTube.getService().getStreamExtractor("https://youtu.be/FmG385_uUys?t=174");
assertEquals(extractor.getTimeStamp() + "", "174");
}
@Test
@@ -49,7 +47,7 @@ public class YoutubeStreamExtractorRestrictedTest {
@Test
public void testGetTitle() throws ParsingException {
assertTrue(!extractor.getTitle().isEmpty());
assertTrue(!extractor.getName().isEmpty());
}
@Test