use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class ClientToServerDeltaDUnitTest method testC2SDeltaPropagationWithOldValueInvalidatedAtServer.
@Test
public void testC2SDeltaPropagationWithOldValueInvalidatedAtServer() throws Exception {
String key = "DELTA_KEY";
Integer port1 = (Integer) server.invoke(() -> ClientToServerDeltaDUnitTest.createServerCache(false, false, false, true));
createClientCache("localhost", port1, false, false, false, null, false, false);
LocalRegion region = (LocalRegion) cache.getRegion(REGION_NAME);
region.put(key, new DeltaTestImpl());
server.invoke(() -> ClientToServerDeltaDUnitTest.doInvalidate(key));
DeltaTestImpl value = new DeltaTestImpl();
value.setStr("UPDATED_VALUE");
region.put(key, value);
assertTrue(region.getCachePerfStats().getDeltasSent() == 1);
assertTrue(region.getCachePerfStats().getDeltaFullValuesSent() == 1);
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class ClientToServerDeltaDUnitTest method putLastKeyWithDelta.
private static void putLastKeyWithDelta() {
Region r = cache.getRegion(REGION_NAME);
r.put(LAST_KEY, new DeltaTestImpl());
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class P2PDeltaPropagationDUnitTest method verifyDeltaReceived.
public static void verifyDeltaReceived(Integer updates) {
Region region = cache.getRegion(Region.SEPARATOR + REGION_NAME);
CachePerfStats stats = ((DistributedRegion) cache.getRegion(REGION_NAME)).getCachePerfStats();
long deltaFailures = stats.getDeltaFailedUpdates();
long deltas = stats.getDeltaUpdates();
assertTrue("Failures while processing delta at receiver.", deltaFailures == 0);
assertTrue("Expected 2 deltas to be processed at receiver but were " + deltas + " (statistics)", deltas == 2);
assertTrue("Expected 2 deltas to be processed at receiver but were " + DeltaTestImpl.getFromDeltaInvokations() + " (implementation counter)", DeltaTestImpl.getFromDeltaInvokations() == 2);
assertTrue("Expected " + updates + " updates but found " + numOfUpdates, numOfUpdates == updates);
DeltaTestImpl val = (DeltaTestImpl) region.getEntry("KEY").getValue();
assertTrue("Latest value not received, found: " + val, NEW_STR.equals(val.getStr()));
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class P2PDeltaPropagationDUnitTest method getOnDeltaDisabledServer.
public static void getOnDeltaDisabledServer() throws Exception {
Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
// should be
assertFalse(((DeltaTestImpl) r1.getEntry("KEY").getValue()).getIntVar() == NEW_INT);
// overwritten
// as delta
// is
// disabled
assertTrue(((DeltaTestImpl) r1.getEntry("KEY").getValue()).getStr().equals(NEW_STR));
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class P2PDeltaPropagationDUnitTest method create.
public static void create() throws Exception {
Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
DeltaTestImpl test = new DeltaTestImpl();
r1.create("KEY", test);
test = new DeltaTestImpl();
test.setIntVar(NEW_INT);
r1.create("KEY1", test);
test = new DeltaTestImpl();
test.setStr(NEW_STR);
r1.create("KEY2", test);
}
Aggregations