Commit b090dcd2 authored by yihua.huang's avatar yihua.huang

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

parent 8f942d6f
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment