Trying to avoid thread deadlock when testing

This commit is contained in:
4pr0n 2015-02-06 10:01:03 -08:00
parent 9967332057
commit c2bb65bc60
4 changed files with 7 additions and 10 deletions

View File

@ -1,4 +1,3 @@
language: java
jdk:
- oraclejdk8
- oraclejdk7

View File

@ -52,7 +52,6 @@ public abstract class AbstractRipper
}
protected void stopCheck() throws IOException {
if (shouldStop) {
threadPool.waitForThreads();
throw new IOException("Ripping interrupted");
}
}

View File

@ -148,17 +148,16 @@ public class VkRipper extends AlbumRipper {
}
String url = photoIDsToURLs.get(photoID);
addURLToDownload(new URL(url));
}
logger.info("Received " + elements.size() + " elements");
if (elements.size() < 40) {
break;
}
offset += elements.size();
if (isStopped() || isThisATest()) {
break;
}
}
if (elements.size() < 40 || isStopped() || isThisATest()) {
break;
}
offset += elements.size();
}
waitForThreads();
}

View File

@ -15,8 +15,8 @@ public class VkRipperTest extends RippersTest {
}
List<URL> contentURLs = new ArrayList<URL>();
contentURLs.add(new URL("https://vk.com/album45506334_172415053"));
//contentURLs.add(new URL("https://vk.com/album45506334_0"));
//contentURLs.add(new URL("https://vk.com/photos45506334"));
contentURLs.add(new URL("https://vk.com/album45506334_0"));
contentURLs.add(new URL("https://vk.com/photos45506334"));
for (URL url : contentURLs) {
VkRipper ripper = new VkRipper(url);
testRipper(ripper);