assertTrue(!monitor.isRegistered(e));
}
public void testNotExpiryWithRemove() throws InterruptedException
{
ExpiryMonitor monitor = new ExpiryMonitor("test", 100);
Expirable e = new Expirable()
{
public void expired()
{
expired = true;
}
};
monitor.addExpirable(1000, TimeUnit.MILLISECONDS, e);
Thread.sleep(200);
assertTrue(!expired);
Thread.sleep(200);
monitor.removeExpirable(e);
Thread.sleep(800);
assertTrue(!expired);
assertTrue(!monitor.isRegistered(e));
}