sepcific error page for HttpClientDownloaderTest to avoid test error when local port is available

pull/414/head^2
yihua.huang 8 years ago
parent 8f942d6fe2
commit b090dcd20d

@ -26,6 +26,8 @@ import static org.junit.Assert.assertTrue;
*/
public class HttpClientDownloaderTest {
public static final String PAGE_ALWAYS_NOT_EXISTS = "http://localhost:13421/404";
@Ignore
@Test
public void testCookie() {
@ -52,7 +54,7 @@ public class HttpClientDownloaderTest {
public void testCycleTriedTimes() {
HttpClientDownloader httpClientDownloader = new HttpClientDownloader();
Task task = Site.me().setDomain("localhost").setCycleRetryTimes(5).toTask();
Request request = new Request("http://localhost/404");
Request request = new Request(PAGE_ALWAYS_NOT_EXISTS);
Page page = httpClientDownloader.download(request, task);
assertThat(page.getTargetRequests().size() > 0);
assertThat((Integer) page.getTargetRequests().get(0).getExtra(Request.CYCLE_TRIED_TIMES)).isEqualTo(1);

Loading…
Cancel
Save