use of org.codelibs.fess.crawler.exception.CrawlingAccessException in project fess-crawler by codelibs.
the class HcHttpClientTest method test_doHead_accessTimeoutTarget.
public void test_doHead_accessTimeoutTarget() {
HcHttpClient client = new HcHttpClient() {
@Override
protected ResponseData processHttpMethod(final String url, final HttpUriRequest httpRequest) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
throw new CrawlingAccessException(e);
}
return null;
}
};
client.setAccessTimeout(1);
try {
client.doHead("http://localhost/");
fail();
} catch (CrawlingAccessException e) {
assertTrue(e.getCause() instanceof InterruptedException);
}
}
use of org.codelibs.fess.crawler.exception.CrawlingAccessException in project fess-crawler by codelibs.
the class HcHttpClientTest method test_doGet_accessTimeoutTarget.
public void test_doGet_accessTimeoutTarget() {
HcHttpClient client = new HcHttpClient() {
@Override
protected ResponseData processHttpMethod(final String url, final HttpUriRequest httpRequest) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
throw new CrawlingAccessException(e);
}
return null;
}
};
client.setAccessTimeout(1);
try {
client.doGet("http://localhost/");
fail();
} catch (CrawlingAccessException e) {
assertTrue(e.getCause() instanceof InterruptedException);
}
}
use of org.codelibs.fess.crawler.exception.CrawlingAccessException in project fess-crawler by codelibs.
the class SitemapsHelperTest method test_parseXmlSitemaps_invalid4.
public void test_parseXmlSitemaps_invalid4() {
final byte[] bytes = "<sitemap".getBytes();
final InputStream in = new ByteArrayInputStream(bytes);
try {
sitemapsHelper.parse(in);
fail();
} catch (final CrawlingAccessException e) {
// NOP
}
}
use of org.codelibs.fess.crawler.exception.CrawlingAccessException in project fess-crawler by codelibs.
the class SitemapsHelperTest method test_parseXmlSitemaps_invalid2.
public void test_parseXmlSitemaps_invalid2() {
final byte[] bytes = "test".getBytes();
final InputStream in = new ByteArrayInputStream(bytes);
try {
sitemapsHelper.parse(in);
fail();
} catch (final CrawlingAccessException e) {
// NOP
}
}
use of org.codelibs.fess.crawler.exception.CrawlingAccessException in project fess-crawler by codelibs.
the class SitemapsHelperTest method test_parseXmlSitemaps_invalid3.
public void test_parseXmlSitemaps_invalid3() {
final byte[] bytes = "<urlset".getBytes();
final InputStream in = new ByteArrayInputStream(bytes);
try {
sitemapsHelper.parse(in);
fail();
} catch (final CrawlingAccessException e) {
// NOP
}
}
Aggregations