@Test
public void simpleEvictionTest() throws InterruptedException {
MessageReceiverHandler handler = new GridNodeImpl( "myNode", null ).getMessageReceiverHandler();
ContextImplWithEviction contextTemp = (ContextImplWithEviction) ((GridNodeServer) handler).getData().getTemp();
((ContextImplWithEviction) contextTemp).setEntryEvictionTime(2000);
((ContextImplWithEviction) contextTemp).setEvictionWakeUpTime(1000);
JDKTimerService timer = new JDKTimerService(1);
contextTemp.set("myvalue", "value");
Long evictionWakeUpTime = contextTemp.getEvictionWakeUpTime();
timer.scheduleJob(new EvictionJob(contextTemp), new MockJobContext(), new MockTrigger(new Date(), evictionWakeUpTime));
contextTemp.set("myvalue", "value");
Thread.sleep(1000);
String value = (String) contextTemp.get("myvalue");
Thread.sleep(4000);
assertNull((String) contextTemp.get("myvalue"));
}