channel.setOut(new ByteArrayOutputStream());
channel.setErr(new ByteArrayOutputStream());
OpenFuture openFuture = channel.open();
CloseFuture closeFuture = session.close(true);
openFuture.await();
closeFuture.await();
assertNotNull(openFuture.getException());
assertNotNull(closeFuture.isClosed());
}
public static void main(String[] args) throws Exception {