NettyClient extends AbstractSharedPoolClient implements StatisticCallback { @Override public Response request(Request request) throws TransportException { if (!isAvailable()) { throw new MotanServiceException("NettyChannel is unavailable: url=" + url.getUri() + MotanFrameworkUtil.toString(request)); } boolean isAsync = false; Object async = RpcContext.getContext().getAttribute(MotanConstants.ASYNC_SUFFIX); if (async != null && async instanceof Boolean) { isAsync = (Boolean) async; } return request(request, isAsync); } NettyClient(URL url); Bootstrap getBootstrap(); @Override Response request(Request request); @Override void heartbeat(Request request); @Override synchronized boolean open(); @Override synchronized void close(); @Override synchronized void close(int timeout); void cleanup(); @Override boolean isClosed(); @Override boolean isAvailable(); @Override URL getUrl(); @Override String statisticCallback(); ResponseFuture removeCallback(long requestId); void registerCallback(long requestId, ResponseFuture responseFuture);  }
@Test public void testAbNormal() throws InterruptedException { url.addParameter(URLParamType.requestTimeout.getName(), URLParamType.requestTimeout.getValue()); nettyClient = new NettyClient(url); try { nettyClient.request(request); fail("Netty Client should not be active!"); } catch (MotanServiceException e) { assertTrue(true); } catch (Exception e) { assertTrue(false); } }