use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class ClientToServerDeltaDUnitTest method putWithFromDeltaERR.
/*
* put delta with some times fromDelta fails to apply client sends back full object
*/
private static void putWithFromDeltaERR(String key) {
Region r = cache.getRegion(REGION_NAME);
DeltaTestImpl val = null;
for (int i = 0; i < NO_PUT_OPERATION; i++) {
switch(i) {
case 0:
val = new DeltaTestImpl(0, "0", new Double(0), new byte[0], new TestObject1("0", 0));
break;
case 1:
val = new DeltaTestImpl(0, "0", new Double(0), new byte[0], new TestObject1("0", 0));
val.setStr((String) putDelta[1]);
break;
case 2:
val = new DeltaTestImpl(0, (String) putDelta[1], new Double(0), new byte[0], new TestObject1("0", 0));
val.setIntVar(((Integer) putDelta[2]).intValue());
break;
}
r.put(key, val);
}
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class DeltaPropagationWithCQDUnitTest method doPuts.
public static void doPuts(Integer num, Boolean useDelta) throws Exception {
Region<Object, Object> region = cache.getRegion(regionName);
for (int i = 0; i < num; i++) {
if (useDelta) {
DeltaTestImpl delta = new DeltaTestImpl(i, "VALUE_" + i);
delta.setIntVar(i);
region.put("KEY_" + i, delta);
} else {
region.put("KEY_" + i, i);
}
}
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class ClientToServerDeltaDUnitTest method putDeltaForCQ.
private static void putDeltaForCQ(String key, Integer numOfPuts, Integer[] cqIndices, Boolean[] satisfyQuery) {
Region region = cache.getRegion(REGION_NAME);
DeltaTestImpl val = null;
for (int j = 0; j < numOfPuts; j++) {
val = new DeltaTestImpl(0, "0", new Double(0), new byte[0], new TestObject1("0", 0));
for (int i = 0; i < cqIndices.length; i++) {
switch(i) {
case 0:
val.setStr("CASE_0");
// select *
break;
case 1:
val.setStr("CASE_1");
// select where intVar = 0
if (satisfyQuery[i]) {
val.setIntVar(0);
} else {
val.setIntVar(100);
}
break;
case 2:
val.setStr("CASE_2");
// select where intVar > 0
if (satisfyQuery[i]) {
val.setIntVar(100);
} else {
val.setIntVar(-100);
}
break;
case 3:
val.setStr("CASE_3");
// select where intVar < 0
if (satisfyQuery[i]) {
val.setIntVar(-100);
} else {
val.setIntVar(100);
}
break;
default:
break;
}
}
region.put(key, val);
}
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class ClientToServerDeltaDUnitTest method put.
/*
* put delta full cycle
*/
private static void put(String key) {
Region r = cache.getRegion(REGION_NAME);
DeltaTestImpl val = null;
for (int i = 0; i < NO_PUT_OPERATION; i++) {
switch(i) {
case 0:
val = new DeltaTestImpl(0, "0", new Double(0), new byte[0], new TestObject1("0", 0));
break;
case 1:
val = new DeltaTestImpl(0, "0", new Double(0), new byte[0], new TestObject1("0", 0));
val.setStr((String) putDelta[0]);
break;
case 2:
val = new DeltaTestImpl(0, (String) putDelta[1], new Double(0), new byte[0], new TestObject1("0", 0));
val.setIntVar(((Integer) putDelta[2]).intValue());
break;
}
r.put(key, val);
}
}
use of org.apache.geode.DeltaTestImpl in project geode by apache.
the class P2PDeltaPropagationDUnitTest method putDelta.
public static void putDelta() throws Exception {
Region r1 = cache.getRegion(Region.SEPARATOR + REGION_NAME);
DeltaTestImpl test = new DeltaTestImpl(9999, NEW_STR);
test.setIntVar(NEW_INT);
r1.put("KEY", test);
}
Aggregations