@SuppressWarnings("unchecked")
@Test public void testRemoveKeyNotFound() throws Exception {
txnScheduler.runTask(
new TestAbstractKernelRunnable() {
public void run() throws Exception {
ScalableHashMap test = new ScalableHashMap();
dataService.setBinding("test", test);
Bar bar = new Bar(1);
dataService.setBinding("bar", bar);
test.put(bar, 1);
}
}, taskOwner);
txnScheduler.runTask(
new TestAbstractKernelRunnable() {
public void run() throws Exception {
dataService.removeObject(dataService.getBinding("bar"));
ScalableHashMap test =
(ScalableHashMap) dataService.getBinding("test");
assertEquals(null, test.remove(new Bar(1)));
assertEquals(null, test.remove(1));
assertEquals(null, test.remove(new Bar(2)));
}
}, taskOwner);
txnScheduler.runTask(
new TestAbstractKernelRunnable() {
public void run() throws Exception {
ScalableHashMap test =
(ScalableHashMap) dataService.getBinding("test");
assertEquals(null, test.remove(new Bar(1)));
assertEquals(null, test.remove(1));
assertEquals(null, test.remove(new Bar(2)));
}
}, taskOwner);
}