*/
public void testTimeoutThread() {
TimeoutHttpConnectionManager cm = new TimeoutHttpConnectionManager();
IdleConnectionTimeoutThread timeoutThread = new IdleConnectionTimeoutThread();
timeoutThread.addConnectionManager(cm);
timeoutThread.setTimeoutInterval(100);
timeoutThread.start();
synchronized(this) {
try {
this.wait(250);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
assertTrue("closeIdleConnections() not called", cm.closed);
timeoutThread.removeConnectionManager(cm);
cm.closed = false;
synchronized(this) {
try {
this.wait(250);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
assertFalse("closeIdleConnections() called", cm.closed);
timeoutThread.shutdown();
}