fixed Downloader.getInstance() in unit tests

This commit is contained in:
Christian Schabesberger 2016-12-24 17:11:29 +01:00
parent 3767a96e0f
commit 38c5cb50fb
7 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,7 @@ public class YoutubeChannelExtractorTest extends AndroidTestCase {
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
NewPipe.init(new Downloader()); NewPipe.init(Downloader.getInstance());
extractor = NewPipe.getService("Youtube") extractor = NewPipe.getService("Youtube")
.getChannelExtractorInstance("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw", 0); .getChannelExtractorInstance("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw", 0);
} }

View file

@ -35,7 +35,7 @@ public class YoutubeSearchEngineTest extends AndroidTestCase {
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
NewPipe.init(new Downloader()); NewPipe.init(Downloader.getInstance());
SearchEngine engine = NewPipe.getService("Youtube").getSearchEngineInstance(); SearchEngine engine = NewPipe.getService("Youtube").getSearchEngineInstance();
result = engine.search("this is something boring", 0, "de").getSearchResult(); result = engine.search("this is something boring", 0, "de").getSearchResult();

View file

@ -38,7 +38,7 @@ public class YoutubeSearchResultTest extends AndroidTestCase {
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
NewPipe.init(new Downloader()); NewPipe.init(Downloader.getInstance());
SuggestionExtractor engine = new YoutubeSuggestionExtractor(0); SuggestionExtractor engine = new YoutubeSuggestionExtractor(0);
suggestionReply = engine.suggestionList("hello", "de"); suggestionReply = engine.suggestionList("hello", "de");
} }

View file

@ -38,7 +38,7 @@ public class YoutubeStreamExtractorDefaultTest extends AndroidTestCase {
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
NewPipe.init(new Downloader()); NewPipe.init(Downloader.getInstance());
extractor = NewPipe.getService("Youtube") extractor = NewPipe.getService("Youtube")
.getExtractorInstance("https://www.youtube.com/watch?v=YQHsXMglC9A"); .getExtractorInstance("https://www.youtube.com/watch?v=YQHsXMglC9A");
} }

View file

@ -39,7 +39,7 @@ public class YoutubeStreamExtractorGemaTest extends AndroidTestCase {
public void testGemaError() throws IOException, ExtractionException { public void testGemaError() throws IOException, ExtractionException {
if(testActive) { if(testActive) {
try { try {
NewPipe.init(new Downloader()); NewPipe.init(Downloader.getInstance());
NewPipe.getService("Youtube") NewPipe.getService("Youtube")
.getExtractorInstance("https://www.youtube.com/watch?v=3O1_3zBUKM8"); .getExtractorInstance("https://www.youtube.com/watch?v=3O1_3zBUKM8");
} catch(YoutubeStreamExtractor.GemaException ge) { } catch(YoutubeStreamExtractor.GemaException ge) {

View file

@ -38,9 +38,9 @@ public class YoutubeStreamExtractorLiveStreamTest extends AndroidTestCase {
//todo: make the extractor not throw over a livestream //todo: make the extractor not throw over a livestream
/* /*
NewPipe.init(new Downloader()); NewPipe.init(Downloader.getInstance());
extractor = NewPipe.getService("Youtube") extractor = NewPipe.getService("Youtube")
.getExtractorInstance("https://www.youtube.com/watch?v=J0s6NjqdjLE", new Downloader()); .getExtractorInstance("https://www.youtube.com/watch?v=J0s6NjqdjLE", Downloader.getInstance());
*/ */
} }

View file

@ -17,7 +17,7 @@ public class YoutubeStreamExtractorRestrictedTest extends AndroidTestCase {
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
NewPipe.init(new Downloader()); NewPipe.init(Downloader.getInstance());
extractor = NewPipe.getService("Youtube") extractor = NewPipe.getService("Youtube")
.getExtractorInstance("https://www.youtube.com/watch?v=i6JTvzrpBy0"); .getExtractorInstance("https://www.youtube.com/watch?v=i6JTvzrpBy0");
} }