}
public void testOnePhaseCommit() throws CacheLoaderException {
List<Modification> mods = new ArrayList<Modification>();
mods.add(new Store(InternalEntryFactory.create("k1", "v1")));
mods.add(new Store(InternalEntryFactory.create("k2", "v2")));
mods.add(new Remove("k1"));
Transaction tx = EasyMock.createNiceMock(Transaction.class);
prepare(mods, tx, true);
Set s = loadAll();
assert load("k2").getValue().equals("v2");
assert !cacheMap.containsKey("k1");
cacheMap.clear();
mods = new ArrayList<Modification>();
mods.add(new Store(InternalEntryFactory.create("k1", "v1")));
mods.add(new Store(InternalEntryFactory.create("k2", "v2")));
mods.add(new Clear());
mods.add(new Store(InternalEntryFactory.create("k3", "v3")));
prepare(mods, tx, true);
assert !cacheMap.containsKey("k1");
assert !cacheMap.containsKey("k2");
assert cacheMap.containsKey("k3");