public void testSeriazableWithRemovals() throws Exception {
final String name = "testScalableList";
final int total = 5;
// create the list
txnScheduler.runTask(new TestAbstractKernelRunnable() {
public void run() throws Exception {
ScalableList<String> list = new ScalableList<String>();
for (int i = 0; i < 10; i++)
list.add(Integer.toString(i));
AppContext.getDataManager().setBinding(name, list);
}
}, taskOwner);
// remove some elements
txnScheduler.runTask(new TestAbstractKernelRunnable() {
public void run() throws Exception {
ScalableList<String> list =
uncheckedCast(AppContext.getDataManager().getBinding(
name));
for (int i = 0; i < 5; i++) {
list.remove(0);
}
}
}, taskOwner);
// check that the changes were made
txnScheduler.runTask(new TestAbstractKernelRunnable() {
public void run() throws Exception {
ScalableList<String> list =
uncheckedCast(AppContext.getDataManager().getBinding(
name));
Iterator<String> iter = list.iterator();