Java 类org.apache.http.impl.conn.ConnectionShutdownException 实例源码

项目:purecloud-iot    文件:TestMainClientExec.java   
@Test(expected=InterruptedIOException.class)
public void testExecConnectionShutDown() throws Exception {
    final HttpRoute route = new HttpRoute(target);
    final HttpClientContext context = new HttpClientContext();
    final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));

    Mockito.when(requestExecutor.execute(
            Mockito.<HttpRequest>any(),
            Mockito.<HttpClientConnection>any(),
            Mockito.<HttpClientContext>any())).thenThrow(new ConnectionShutdownException());

    mainClientExec.execute(route, request, context, execAware);
}
项目:purecloud-iot    文件:TestMinimalClientExec.java   
@Test(expected=InterruptedIOException.class)
public void testExecConnectionShutDown() throws Exception {
    final HttpRoute route = new HttpRoute(target);
    final HttpClientContext context = new HttpClientContext();
    final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));

    Mockito.when(requestExecutor.execute(
            Mockito.<HttpRequest>any(),
            Mockito.<HttpClientConnection>any(),
            Mockito.<HttpClientContext>any())).thenThrow(new ConnectionShutdownException());

    minimalClientExec.execute(route, request, context, execAware);
}