use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class PartitionedRegionMetaDataCleanupDUnitTest method testCleanupOnCloseRegion.
@Test
public void testCleanupOnCloseRegion() {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
createPR(vm0, "region1", 5);
createPR(vm1, "region2", 10);
// This should fail
IgnoredException ex = IgnoredException.addIgnoredException("IllegalStateException", vm1);
try {
createPR(vm1, "region1", 10);
fail("Should have received an exception");
} catch (RMIException e) {
// ok
} finally {
ex.remove();
}
closePr(vm0, "region1");
waitForCreate(vm0, "region1", 15);
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class PersistentRecoveryOrderDUnitTest method testSplitBrain.
@Test
public void testSplitBrain() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
createPersistentRegion(vm0);
putAnEntry(vm0);
closeRegion(vm0);
createPersistentRegion(vm1);
updateTheEntry(vm1);
closeRegion(vm1);
// VM0 doesn't know that VM1 ever existed
// so it will start up.
createPersistentRegion(vm0);
IgnoredException e = IgnoredException.addIgnoredException(ConflictingPersistentDataException.class.getSimpleName(), vm1);
try {
// VM1 should not start up, because we should detect that vm1
// was never in the same distributed system as vm0
createPersistentRegion(vm1);
fail("Should have thrown an exception, vm1 is from a 'different' distributed system");
} catch (RuntimeException ok) {
if (!(ok.getCause() instanceof ConflictingPersistentDataException)) {
throw ok;
}
} finally {
e.remove();
}
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class DSObjectLocalOnly method testDataSerializersWithServerKillAndReInvoked.
@Test
public void testDataSerializersWithServerKillAndReInvoked() throws Exception {
PORT1 = initServerCache(server1);
PORT2 = initServerCache(server2);
client1.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(NetworkUtils.getServerHostName(server1.getHost()), new Integer(PORT1)));
client2.invoke(() -> DataSerializerPropogationDUnitTest.createClientCache(NetworkUtils.getServerHostName(server2.getHost()), new Integer(PORT2)));
client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject7());
client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithOnePut)));
server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithOnePut)));
server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithOnePut)));
client2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithOnePut)));
// can get server connectivity exception
final IgnoredException expectedEx = IgnoredException.addIgnoredException("Server unreachable", client1);
server1.invoke(() -> DataSerializerPropogationDUnitTest.stopServer());
try {
client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject8());
} catch (Exception e) {
// we are putting in a client whose server is dead
}
try {
client1.invoke(() -> DataSerializerPropogationDUnitTest.registerDSObject9());
} catch (Exception e) {
// we are putting in a client whose server is
// dead
}
server1.invoke(() -> DataSerializerPropogationDUnitTest.startServer());
client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithAllPuts)));
server1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithAllPuts)));
server2.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithAllPuts)));
client1.invoke(() -> DataSerializerPropogationDUnitTest.verifyDataSerializers(new Integer(instanceCountWithAllPuts)));
expectedEx.remove();
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class DurableClientReconnectDUnitTest method testDurableReconnectWithBothNonRedundantServersDown.
@Test
public void testDurableReconnectWithBothNonRedundantServersDown() throws Exception {
// create client cache and Send clientReady message
createCacheClient();
HashSet redundantServers = new HashSet(pool.getRedundantNames());
redundantServers.add(pool.getPrimaryName());
assertTrue(redundantServers.size() == 2);
instance.determineAndVerfiyRedundantServers(redundantServers);
instance.determineAndVerfiyNonRedundantServers(redundantServers);
// Stop the durable client
closeCache(true);
Set nonRedundantSet = new HashSet();
nonRedundantSet.add(SERVER1);
nonRedundantSet.add(SERVER2);
nonRedundantSet.add(SERVER3);
nonRedundantSet.add(SERVER4);
nonRedundantSet.removeAll(redundantServers);
Object[] serverArray = nonRedundantSet.toArray();
String rServer1 = (String) serverArray[0];
String rServer2 = (String) serverArray[1];
// can see sporadic socket closed exceptions
final IgnoredException expectedEx = IgnoredException.addIgnoredException(SocketException.class.getName());
instance.closeServer(rServer1);
instance.closeServer(rServer2);
createCacheClient();
HashSet redundantServersAfterReconnect = new HashSet(pool.getRedundantNames());
redundantServersAfterReconnect.add(pool.getPrimaryName());
List redundantServersHistory = new ArrayList();
redundantServersHistory.addAll(redundantServersAfterReconnect);
redundantServersHistory.add(rServer1);
redundantServersHistory.add(rServer2);
instance.determineAndVerfiyNonRedundantServers(redundantServersHistory);
expectedEx.remove();
assertTrue(redundantServers.equals(redundantServersAfterReconnect));
assertTrue(redundantServersAfterReconnect.size() == 2);
assertFalse("redundantServersAfterReconnect contains " + rServer1, redundantServersAfterReconnect.contains(rServer1));
assertFalse("redundantServersAfterReconnect contains " + rServer2, redundantServersAfterReconnect.contains(rServer2));
}
use of org.apache.geode.test.dunit.IgnoredException in project geode by apache.
the class CompressionCacheConfigDUnitTest method testCreateCacheWithBadCompressor.
/**
* Asserts that member initialization fails when an unrecognized compressor is declared in the
* cache.xml.
*/
@Test
public void testCreateCacheWithBadCompressor() throws Exception {
IgnoredException.addIgnoredException("Unable to load class BAD_COMPRESSOR");
File cacheXml = createCacheXml(BAD_COMPRESSOR);
IgnoredException expectedException = IgnoredException.addIgnoredException("While reading Cache XML file");
try {
assertFalse(createCacheOnVM(getVM(0), cacheXml.getCanonicalPath()));
} finally {
expectedException.remove();
cacheXml.delete();
}
}
Aggregations