use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class WANTestBase method validateQueueContents.
public static void validateQueueContents(final String senderId, final int regionSize) {
IgnoredException exp1 = IgnoredException.addIgnoredException(InterruptedException.class.getName());
IgnoredException exp2 = IgnoredException.addIgnoredException(GatewaySenderException.class.getName());
try {
Set<GatewaySender> senders = cache.getGatewaySenders();
GatewaySender sender = null;
for (GatewaySender s : senders) {
if (s.getId().equals(senderId)) {
sender = s;
break;
}
}
if (!sender.isParallel()) {
final Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
Awaitility.await().atMost(120, TimeUnit.SECONDS).until(() -> {
int size = 0;
for (RegionQueue q : queues) {
size += q.size();
}
assertEquals("Expected queue entries: " + regionSize + " but actual entries: " + size, regionSize, size);
});
} else if (sender.isParallel()) {
final RegionQueue regionQueue;
regionQueue = ((AbstractGatewaySender) sender).getQueues().toArray(new RegionQueue[1])[0];
Awaitility.await().atMost(120, TimeUnit.SECONDS).until(() -> assertEquals("Expected queue entries: " + regionSize + " but actual entries: " + regionQueue.size(), regionSize, regionQueue.size()));
}
} finally {
exp1.remove();
exp2.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class PDXNewWanDUnitTest method testWANPDX_ConflictingData.
/**
* Test 1> Site 1 : 1 locator, 1 member 2> Site 2 : 1 locator, 1 member 3> DR is defined on member
* 1 on site1 4> Serial GatewaySender is defined on member 1 on site1 5> Same DR is defined on
* site2 member 1 6> Put is done with value which is PDXSerializable 7> Validate whether other
* sites member receive this put operation. 8> Bounce site 1 and delete all of it's data 9> Make
* some conflicting PDX registries in site 1 before the reconnect 10> Make sure we flag a warning
* about the conflicting updates.
*/
@Test
public void testWANPDX_ConflictingData() {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
vm2.invoke(() -> WANTestBase.createReceiver_PDX(nyPort));
vm3.invoke(() -> WANTestBase.createCache_PDX(lnPort));
vm3.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 10, false, false, null, true));
vm2.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", null, isOffHeap()));
vm3.invoke(() -> WANTestBase.startSender("ln"));
vm3.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap()));
vm3.invoke(() -> WANTestBase.doPutsPDXSerializable(getTestMethodName() + "_RR", 1));
vm2.invoke(() -> WANTestBase.validateRegionSize_PDX(getTestMethodName() + "_RR", 1));
// bounce vm3
vm3.invoke(() -> WANTestBase.closeCache());
IgnoredException ex1 = IgnoredException.addIgnoredException("Trying to add a PDXType with the same id");
IgnoredException ex2 = IgnoredException.addIgnoredException("CacheWriterException");
IgnoredException ex3 = IgnoredException.addIgnoredException("does match the existing PDX type");
IgnoredException ex4 = IgnoredException.addIgnoredException("ServerOperationException");
IgnoredException ex5 = IgnoredException.addIgnoredException("Stopping the processor");
try {
// blow away vm3's PDX data
vm3.invoke(() -> WANTestBase.deletePDXDir());
vm3.invoke(() -> WANTestBase.createCache_PDX(lnPort));
vm3.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 10, false, false, null, true));
vm3.invoke(() -> WANTestBase.startSender("ln"));
vm3.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap()));
// Define a different type from vm3
vm3.invoke(() -> WANTestBase.doPutsPDXSerializable2(getTestMethodName() + "_RR", 2));
// Give the updates some time to make it over the WAN
Wait.pause(10000);
vm2.invoke(() -> WANTestBase.validateRegionSizeOnly_PDX(getTestMethodName() + "_RR", 2));
vm3.invoke(() -> WANTestBase.closeCache());
} finally {
ex1.remove();
ex2.remove();
ex3.remove();
ex4.remove();
ex5.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class ReplicatedRegion_ParallelWANPropagationDUnitTest method doPuts1.
public static void doPuts1(String regionName, int numPuts) {
IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class.getName());
IgnoredException exp1 = IgnoredException.addIgnoredException(CacheClosedException.class.getName());
try {
Region r = cache.getRegion(Region.SEPARATOR + regionName);
assertNotNull(r);
for (long i = 0; i < numPuts; i++) {
LogWriterUtils.getLogWriter().info("Put : key : " + i);
r.put(i, "1_" + i);
}
} finally {
exp.remove();
exp1.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class ReplicatedRegion_ParallelWANPropagationDUnitTest method doPuts2.
public static void doPuts2(String regionName, int numPuts) {
IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class.getName());
IgnoredException exp1 = IgnoredException.addIgnoredException(CacheClosedException.class.getName());
try {
Region r = cache.getRegion(Region.SEPARATOR + regionName);
assertNotNull(r);
for (long i = 0; i < numPuts; i++) {
LogWriterUtils.getLogWriter().info("Put : key : " + i);
r.put(i, "2_" + i);
}
} finally {
exp.remove();
exp1.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class WANTestBase method doPuts.
public static void doPuts(String regionName, int numPuts, Object value) {
IgnoredException exp1 = IgnoredException.addIgnoredException(InterruptedException.class.getName());
IgnoredException exp2 = IgnoredException.addIgnoredException(GatewaySenderException.class.getName());
try {
Region r = cache.getRegion(Region.SEPARATOR + regionName);
assertNotNull(r);
for (long i = 0; i < numPuts; i++) {
r.put(i, value);
}
} finally {
exp1.remove();
exp2.remove();
}
}
Aggregations