Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6164E18466 for ; Mon, 1 Feb 2016 20:56:11 +0000 (UTC) Received: (qmail 620 invoked by uid 500); 1 Feb 2016 20:55:58 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 590 invoked by uid 500); 1 Feb 2016 20:55:58 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 581 invoked by uid 99); 1 Feb 2016 20:55:58 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 20:55:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1963BC0044 for ; Mon, 1 Feb 2016 20:55:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.227 X-Spam-Level: * X-Spam-Status: No, score=1.227 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id OOEyGyWPeXOv for ; Mon, 1 Feb 2016 20:55:31 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 4E8802343E for ; Mon, 1 Feb 2016 20:55:19 +0000 (UTC) Received: (qmail 94521 invoked by uid 99); 1 Feb 2016 20:55:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 20:55:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BD14E031B; Mon, 1 Feb 2016 20:55:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Mon, 01 Feb 2016 20:56:00 -0000 Message-Id: <0b66aa81050642daa9d9025bf7a45206@git.apache.org> In-Reply-To: <7afb608c78004321a7e3805fbaf2c62d@git.apache.org> References: <7afb608c78004321a7e3805fbaf2c62d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [43/50] [abbrv] incubator-geode git commit: Refactor dunit http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java index c19b7b6..ffb06af 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java @@ -67,6 +67,7 @@ import com.gemstone.gemfire.internal.cache.execute.util.RollbackFunction; import com.gemstone.gemfire.internal.cache.tx.ClientTXStateStub; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -88,7 +89,7 @@ public class ClientServerTransactionDUnitTest extends RemoteTransactionDUnitTest public void setUp() throws Exception { super.setUp(); - addExpectedException("java.net.SocketException"); + IgnoredException.addExpectedException("java.net.SocketException"); } private Integer createRegionsAndStartServer(VM vm, boolean accessor) { @@ -1405,7 +1406,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { VM server2 = host.getVM(1); VM client = host.getVM(2); - addExpectedException("java.net.SocketException"); + IgnoredException.addExpectedException("java.net.SocketException"); final int port1 = createRegionsAndStartServer(server1, true); final int port2 = createRegionsAndStartServer(server2, false); @@ -2665,7 +2666,7 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { final int port2 = createRegionsAndStartServer(server2, false); final int port = createRegionsAndStartServer(server1, true); - addExpectedException("ClassCastException"); + IgnoredException.addExpectedException("ClassCastException"); SerializableRunnable suspectStrings = new SerializableRunnable("suspect string") { public void run() { InternalDistributedSystem.getLoggerI18n().convertToLogWriter().info( @@ -2762,8 +2763,8 @@ public void testClientCommitAndDataStoreGetsEvent() throws Exception { doFunctionWithFailureWork(false); } private void doFunctionWithFailureWork(final boolean commit) { - addExpectedException("TransactionDataNodeHasDepartedException"); - addExpectedException("ClassCastException"); + IgnoredException.addExpectedException("TransactionDataNodeHasDepartedException"); + IgnoredException.addExpectedException("ClassCastException"); Host host = Host.getHost(0); VM server1 = host.getVM(0); VM server2 = host.getVM(1); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java index 0611f63..2a7c0b5 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentDestroySubRegionDUnitTest.java @@ -23,6 +23,7 @@ import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionDestroyedException; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache30.CacheTestCase; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -101,7 +102,7 @@ public class ConcurrentDestroySubRegionDUnitTest extends CacheTestCase { vm1.invoke(createChild); } catch(Exception e) { if(!(e.getCause() instanceof RegionDestroyedException)) { - fail("Wrong exception", e); + Assert.fail("Wrong exception", e); } RegionDestroyedException rde = (RegionDestroyedException) e.getCause(); assertEquals("Error on loop " + i, "/region", rde.getRegionFullPath()); @@ -160,7 +161,7 @@ public class ConcurrentDestroySubRegionDUnitTest extends CacheTestCase { vm1.invoke(createChild); } catch(Exception e) { if(!(e.getCause() instanceof RegionDestroyedException)) { - fail("Wrong exception", e); + Assert.fail("Wrong exception", e); } RegionDestroyedException rde = (RegionDestroyedException) e.getCause(); assertEquals("Error on loop " + i, "/region", rde.getRegionFullPath()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java index df0ea7f..5a08dac 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java @@ -50,6 +50,7 @@ import com.gemstone.gemfire.distributed.internal.membership.MembershipManager; import com.gemstone.gemfire.distributed.internal.membership.gms.MembershipManagerHelper; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.test.dunit.DistributedTestCase; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -1046,7 +1047,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase { final int port2 = createRegionsAndStartServer(server2, true); final String regionName = usePR? PR_REG_NAME : REP_REG_NAME; - addExpectedException("java.net.SocketException"); + IgnoredException.addExpectedException("java.net.SocketException"); createClientRegion(client, port1, false, port2); @@ -1059,11 +1060,11 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase { final DistributedMember server1ID = (DistributedMember)server1.invoke(getID); final DistributedMember server2ID = (DistributedMember)server2.invoke(getID); - Set exceptions = new HashSet(); - exceptions.add(addExpectedException("Membership: requesting removal", server1)); - exceptions.add(addExpectedException("Membership: requesting removal", server2)); - exceptions.add(addExpectedException("ForcedDisconnect", server1)); - exceptions.add(addExpectedException("ForcedDisconnect", server2)); + Set exceptions = new HashSet(); + exceptions.add(IgnoredException.addExpectedException("Membership: requesting removal", server1)); + exceptions.add(IgnoredException.addExpectedException("Membership: requesting removal", server2)); + exceptions.add(IgnoredException.addExpectedException("ForcedDisconnect", server1)); + exceptions.add(IgnoredException.addExpectedException("ForcedDisconnect", server2)); try { @@ -1164,7 +1165,7 @@ public class ConcurrentMapOpsDUnitTest extends CacheTestCase { }); } finally { disconnectAllFromDS(); - for (ExpectedException ex: exceptions) { + for (IgnoredException ex: exceptions) { ex.remove(); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java index f101acb..b17fdb0 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java @@ -43,6 +43,7 @@ import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion; +import com.gemstone.gemfire.test.dunit.IgnoredException; /** A test of 46438 - missing response to an update attributes message */ public class ConnectDisconnectDUnitTest extends CacheTestCase { @@ -52,7 +53,7 @@ public class ConnectDisconnectDUnitTest extends CacheTestCase { } - private ExpectedException ex; + private IgnoredException ex; public ConnectDisconnectDUnitTest(String name) { super(name); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java index 43ed3da..13b65b3 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DeltaPropagationDUnitTest.java @@ -835,7 +835,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { } } catch (Exception e) { - fail("failed in doLocalOp()", e); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in doLocalOp()", e); } } @@ -878,7 +878,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { + expected, expected.equals(value)); } catch (Exception e) { - fail("failed in assertValue()", e); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in assertValue()", e); } } @@ -1015,7 +1015,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { r.put(LAST_KEY, ""); } catch (Exception ex) { - fail("failed in createDelta()", ex); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in createDelta()", ex); } } @@ -1032,7 +1032,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { r.create(DELTA_KEY, deltaPut[0]); } catch (Exception ex) { - fail("failed in createDelta()", ex); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in createDelta()", ex); } } @@ -1054,7 +1054,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { r.put(LAST_KEY, ""); } catch (Exception ex) { - fail("failed in updateDelta()", ex); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in updateDelta()", ex); } } @@ -1069,7 +1069,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { r.create(LAST_KEY, ""); } catch (Exception ex) { - fail("failed in createDeltas()", ex); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in createDeltas()", ex); } } @@ -1081,7 +1081,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { r.create("KEY-A", "I push the delta out to disk :)"); } catch (Exception ex) { - fail("failed in createAnEntry()", ex); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in createAnEntry()", ex); } } @@ -1093,7 +1093,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { r.invalidate(DELTA_KEY); } catch (Exception ex) { - fail("failed in invalidateDelta()", ex); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in invalidateDelta()", ex); } } @@ -1476,7 +1476,7 @@ public class DeltaPropagationDUnitTest extends DistributedTestCase { r.registerInterest("ALL_KEYS"); } catch (Exception ex) { - fail("failed in registerInterestListAll", ex); + com.gemstone.gemfire.test.dunit.Assert.fail("failed in registerInterestListAll", ex); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java index 1c2f921..8d86669 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java @@ -28,6 +28,7 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.SerializableRunnable; public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase { @@ -96,7 +97,7 @@ public class DistrbutedRegionProfileOffHeapDUnitTest extends CacheTestCase { Region region = null; try { - addExpectedException("IllegalStateException"); + IgnoredException.addExpectedException("IllegalStateException"); region = regionFactory.create(regionName); fail("Expected exception upon creation with invalid off-heap state"); } catch (IllegalStateException expected) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java index 19f72ab..0ad338e 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EventTrackerDUnitTest.java @@ -40,6 +40,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionMessage; import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver; import com.gemstone.gemfire.internal.cache.EventTracker.BulkOpHolder; import com.gemstone.gemfire.internal.cache.ha.ThreadIdentifier; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -146,7 +147,7 @@ public class EventTrackerDUnitTest extends CacheTestCase { try { startCacheServer(); } catch (Exception ex) { - fail("While starting CacheServer", ex); + Assert.fail("While starting CacheServer", ex); } } }); @@ -219,7 +220,7 @@ public class EventTrackerDUnitTest extends CacheTestCase { try { startCacheServer(); } catch (Exception ex) { - fail("While starting CacheServer", ex); + Assert.fail("While starting CacheServer", ex); } } }); @@ -303,7 +304,7 @@ public class EventTrackerDUnitTest extends CacheTestCase { try { startCacheServer(); } catch (Exception ex) { - fail("While starting CacheServer", ex); + Assert.fail("While starting CacheServer", ex); } } }; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java index dbc1f3f..c2a5e90 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionObjectSizerDUnitTest.java @@ -37,6 +37,7 @@ import com.gemstone.gemfire.internal.SharedLibrary; import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController; import com.gemstone.gemfire.internal.cache.lru.Sizeable; import com.gemstone.gemfire.internal.size.ReflectionSingleObjectSizer; +import com.gemstone.gemfire.test.dunit.Assert; public class EvictionObjectSizerDUnitTest extends CacheTestCase { @@ -215,7 +216,7 @@ public class EvictionObjectSizerDUnitTest extends CacheTestCase { cache.getResourceManager().setEvictionHeapPercentage(50); } catch (Exception e) { - fail("Failed while creating the cache", e); + Assert.fail("Failed while creating the cache", e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java index 189d0d2..445d479 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionStatsDUnitTest.java @@ -40,6 +40,7 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -415,7 +416,7 @@ public class EvictionStatsDUnitTest extends CacheTestCase { cache.getResourceManager().setEvictionHeapPercentage(20); } catch (Exception e) { - fail("Failed while creating the cache", e); + Assert.fail("Failed while creating the cache", e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java index cbd2f65..aefa88b 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/EvictionTestBase.java @@ -44,6 +44,7 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.Resou import com.gemstone.gemfire.internal.cache.control.MemoryEvent; import com.gemstone.gemfire.internal.cache.control.MemoryThresholds.MemoryState; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; @@ -297,7 +298,7 @@ public class EvictionTestBase extends CacheTestCase { getLogWriter().info("critical= "+cache.getResourceManager().getCriticalHeapPercentage()); } catch (Exception e) { - fail("Failed while creating the cache", e); + Assert.fail("Failed while creating the cache", e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java index 6a96948..8578c64 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/FixedPRSinglehopDUnitTest.java @@ -40,6 +40,7 @@ import com.gemstone.gemfire.internal.cache.partitioned.fixed.QuarterPartitionRes import com.gemstone.gemfire.internal.cache.partitioned.fixed.SingleHopQuarterPartitionResolver; import com.gemstone.gemfire.internal.cache.partitioned.fixed.FixedPartitioningTestBase.Q1_Months; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.VM; @@ -367,7 +368,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } if (!fpaList.isEmpty() || isAccessor) { @@ -412,7 +413,7 @@ public class FixedPRSinglehopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } if (!fpaList.isEmpty() || isAccessor) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java index 9f318fb..f3cfa2f 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIDeltaDUnitTest.java @@ -55,8 +55,10 @@ import com.gemstone.gemfire.internal.cache.persistence.DiskStoreID; import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector; import com.gemstone.gemfire.internal.cache.versions.VersionTag; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -83,7 +85,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase { // protected static String REGION_NAME = GIIDeltaDUnitTest.class.getSimpleName()+"_Region"; protected static String REGION_NAME = "_Region"; final String expectedExceptions = GemFireIOException.class.getName(); - protected ExpectedException expectedEx; + protected IgnoredException expectedEx; static Object giiSyncObject = new Object(); /** @@ -152,7 +154,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase { createDistributedRegion(vm1); assignVMsToPandR(vm0, vm1); // from now on, use P and R as vmhttps://wiki.gemstone.com/display/gfepersistence/DeltaGII+Spec+for+8.0 - expectedEx = addExpectedException(expectedExceptions); + expectedEx = IgnoredException.addExpectedException(expectedExceptions); } // these steps are shared by all test cases @@ -2003,7 +2005,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase { try { future.join(MAX_WAIT); } catch (InterruptedException e) { - fail("Create region is interrupted", e); + Assert.fail("Create region is interrupted", e); } if(future.isAlive()) { fail("Region not created within" + MAX_WAIT); @@ -2025,7 +2027,7 @@ public class GIIDeltaDUnitTest extends CacheTestCase { getLogWriter().info("In createDistributedRegion, using hydra.getLogWriter()"); getLogWriter().fine("Unfinished Op limit="+InitialImageOperation.MAXIMUM_UNFINISHED_OPERATIONS); } catch (CacheException ex) { - fail("While creating region", ex); + Assert.fail("While creating region", ex); } } }; @@ -2367,9 +2369,9 @@ public class GIIDeltaDUnitTest extends CacheTestCase { try { remote_rvv = DataSerializer.readObject(new DataInputStream(bais)); } catch (IOException e) { - fail("Unexpected exception", e); + Assert.fail("Unexpected exception", e); } catch (ClassNotFoundException e) { - fail("Unexpected exception", e); + Assert.fail("Unexpected exception", e); } RequestImageMessage rim = new RequestImageMessage(); rim.setSender(R_ID); @@ -2521,10 +2523,10 @@ public class GIIDeltaDUnitTest extends CacheTestCase { try { async.join(30000); if (async.exceptionOccurred()) { - fail("Test failed", async.getException()); + Assert.fail("Test failed", async.getException()); } } catch (InterruptedException e1) { - fail("Test failed", e1); + Assert.fail("Test failed", e1); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java index d478b8b..44df27d 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GIIFlowControlDUnitTest.java @@ -30,7 +30,9 @@ import com.gemstone.gemfire.distributed.internal.DistributionManager; import com.gemstone.gemfire.distributed.internal.DistributionMessage; import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver; import com.gemstone.gemfire.internal.cache.InitialImageOperation.ImageReplyMessage; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -134,7 +136,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase { try { Thread.sleep(500); } catch (InterruptedException e) { - fail("interrupted", e); + Assert.fail("interrupted", e); } assertEquals(2, observer.messageCount.get()); observer.allowMessages.countDown(); @@ -201,7 +203,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase { try { Thread.sleep(500); } catch (InterruptedException e) { - fail("interrupted", e); + Assert.fail("interrupted", e); } assertEquals(2, observer.messageCount.get()); } @@ -257,7 +259,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase { } }); - ExpectedException expectedEx = null; + IgnoredException expectedEx = null; try { createRegion(vm0); @@ -284,7 +286,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase { try { Thread.sleep(500); } catch (InterruptedException e) { - fail("interrupted", e); + Assert.fail("interrupted", e); } assertEquals(2, observer.messageCount.get()); } @@ -306,7 +308,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase { throw e; } - expectedEx = addExpectedException(InterruptedException.class.getName(), + expectedEx = IgnoredException.addExpectedException(InterruptedException.class.getName(), vm1); if(disconnect) { disconnect(vm1); @@ -437,7 +439,7 @@ public class GIIFlowControlDUnitTest extends CacheTestCase { try { allowMessages.await(); } catch (InterruptedException e) { - fail("Interrupted", e); + Assert.fail("Interrupted", e); } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java index 9a6b3e4..3c77110 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/GridAdvisorDUnitTest.java @@ -33,6 +33,7 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.distributed.internal.InternalLocator; import com.gemstone.gemfire.internal.AvailablePort.Keeper; import com.gemstone.gemfire.internal.AvailablePortHelper; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -96,7 +97,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { try { Locator.startLocatorAndDS(port1, logFile, null, dsProps, true, true, null); } catch (IOException ex) { - fail("While starting locator on port " + port1, ex); + Assert.fail("While starting locator on port " + port1, ex); } } }); @@ -112,7 +113,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { Locator.startLocatorAndDS(port2, logFile, null, dsProps, true, true, "locator2HNFC"); } catch (IOException ex) { - fail("While starting locator on port " + port2, ex); + Assert.fail("While starting locator on port " + port2, ex); } } }); @@ -605,7 +606,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { try { Locator.startLocatorAndDS(port1, logFile, null, dsProps, true, true, null); } catch (IOException ex) { - fail("While starting locator on port " + port1, ex); + Assert.fail("While starting locator on port " + port1, ex); } } }); @@ -621,7 +622,7 @@ public class GridAdvisorDUnitTest extends DistributedTestCase { Locator.startLocatorAndDS(port2, logFile, null, dsProps, true, true, "locator2HNFC"); } catch (IOException ex) { - fail("While starting locator on port " + port2, ex); + Assert.fail("While starting locator on port " + port2, ex); } } }); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java index 54da4b6..3ec0411 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/HABug36773DUnitTest.java @@ -38,6 +38,7 @@ import com.gemstone.gemfire.cache30.ClientServerTestCase; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.internal.AvailablePort; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.VM; @@ -234,7 +235,7 @@ public class HABug36773DUnitTest extends DistributedTestCase Thread.sleep(700); } catch (InterruptedException ie) { - fail("Interrupted while waiting ", ie); + Assert.fail("Interrupted while waiting ", ie); } } } @@ -260,7 +261,7 @@ public class HABug36773DUnitTest extends DistributedTestCase assertEquals(r1.getEntry(KEY2).getValue(), "key-2"); } catch (Exception ex) { - fail("failed while createEntriesK1andK2()", ex); + Assert.fail("failed while createEntriesK1andK2()", ex); } } @@ -320,7 +321,7 @@ public class HABug36773DUnitTest extends DistributedTestCase } catch (Exception ex) { - fail("failed while registering interest", ex); + Assert.fail("failed while registering interest", ex); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java index 03d9edd..91b4796 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/InterruptClientServerDUnitTest.java @@ -34,6 +34,7 @@ import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.internal.cache.UpdateOperation.UpdateMessage; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.VM; @@ -83,7 +84,7 @@ public class InterruptClientServerDUnitTest extends CacheTestCase { * @throws Throwable */ public void testClientPutWithInterrupt() throws Throwable { - addExpectedException("InterruptedException"); + IgnoredException.addExpectedException("InterruptedException"); Host host = Host.getHost(0); final VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java index 3910c3c..93f4f0c 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/MapClearGIIDUnitTest.java @@ -32,6 +32,7 @@ import com.gemstone.gemfire.cache.RegionEvent; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -239,19 +240,19 @@ public class MapClearGIIDUnitTest extends CacheTestCase { DistributedTestCase.join(asyncGII, 30 * 1000, getLogWriter()); if (asyncGII.exceptionOccurred()) { Throwable t = asyncGII.getException(); - fail("createRegionInVM0 failed", t); + Assert.fail("createRegionInVM0 failed", t); } assertTrue(vm0 .invokeBoolean(MapClearGIIDUnitTest.class, "checkImageStateFlag")); if (asyncGII.exceptionOccurred()) { - fail("asyncGII failed", asyncGII.getException()); + Assert.fail("asyncGII failed", asyncGII.getException()); } } catch (Exception e) { - fail("Test failed", e); + Assert.fail("Test failed", e); } finally { vm0.invoke(new SerializableRunnable("Set fast image processing") { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java index 4482533..5879929 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionDUnitTest.java @@ -25,6 +25,7 @@ import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -82,7 +83,7 @@ public class OffHeapEvictionDUnitTest extends EvictionDUnitTest { getLogWriter().info("critical= "+cache.getResourceManager().getCriticalOffHeapPercentage()); } catch (Exception e) { - fail("Failed while creating the cache", e); + Assert.fail("Failed while creating the cache", e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java index a2d0555..82f47d5 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/OffHeapEvictionStatsDUnitTest.java @@ -21,6 +21,7 @@ import java.util.Properties; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.SerializableRunnable; /** @@ -78,7 +79,7 @@ public class OffHeapEvictionStatsDUnitTest extends EvictionStatsDUnitTest { getLogWriter().info("critical= "+cache.getResourceManager().getCriticalOffHeapPercentage()); } catch (Exception e) { - fail("Failed while creating the cache", e); + Assert.fail("Failed while creating the cache", e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java index f1e7988..8249d2b 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PRBadToDataDUnitTest.java @@ -24,6 +24,7 @@ import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.PartitionAttributesFactory; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -76,7 +77,7 @@ public class PRBadToDataDUnitTest extends CacheTestCase { assertNotNull(pr); } catch (final CacheException ex) { - fail("While creating Partitioned region", ex); + Assert.fail("While creating Partitioned region", ex); } } }; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java index d5e7f9c..a11987a 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java @@ -35,6 +35,7 @@ import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.BucketVisitor; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -517,7 +518,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("Exception during " + count, async[count].getException()); + Assert.fail("Exception during " + count, async[count].getException()); } } } @@ -558,7 +559,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends } for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("Exception during " + count, async[count].getException()); + Assert.fail("Exception during " + count, async[count].getException()); } } } @@ -592,7 +593,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during" + count, async[count].getException()); + Assert.fail("exception during" + count, async[count].getException()); } } } @@ -630,7 +631,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } } @@ -702,7 +703,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } } @@ -747,7 +748,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } } @@ -826,7 +827,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends for (int count = 0; count < 4; count++) { if (async[count].exceptionOccurred()) { - fail("got exception on " + count, async[count].getException()); + Assert.fail("got exception on " + count, async[count].getException()); } } @@ -888,7 +889,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("Validation of bucket distribution failed on " + count, + Assert.fail("Validation of bucket distribution failed on " + count, async[count].getException()); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java index d458947..b7cb178 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCacheCloseDUnitTest.java @@ -27,6 +27,7 @@ import com.gemstone.gemfire.cache.PartitionAttributesFactory; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -129,7 +130,7 @@ public class PartitionedRegionCacheCloseDUnitTest extends DistributedTestCase.join(async1, 30 * 1000, getLogWriter()); if(async0.exceptionOccurred()) { - fail("Exception during async0", async0.getException()); + Assert.fail("Exception during async0", async0.getException()); } // Here we would close cache on one of the vms. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java index 367782a..1701a73 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionCreationDUnitTest.java @@ -34,9 +34,11 @@ import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -126,7 +128,7 @@ public class PartitionedRegionCreationDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } @@ -257,7 +259,7 @@ public class PartitionedRegionCreationDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } @@ -443,7 +445,7 @@ public class PartitionedRegionCreationDUnitTest extends for (int count = 0; count < 4; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } @@ -459,7 +461,7 @@ public class PartitionedRegionCreationDUnitTest extends for (int count = 4; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } getLogWriter().info("*****INITIALIZATION TEST ENDED*****"); @@ -499,7 +501,7 @@ public class PartitionedRegionCreationDUnitTest extends for (int count = 0; count < 4; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } @@ -519,7 +521,7 @@ public class PartitionedRegionCreationDUnitTest extends for (int count = 4; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } getLogWriter().info("*****REGISTRATION TEST ENDED*****"); @@ -532,7 +534,7 @@ public class PartitionedRegionCreationDUnitTest extends */ public void testPartitionRegionPersistenceConflicts() throws Throwable { - addExpectedException("IllegalStateException"); + IgnoredException.addExpectedException("IllegalStateException"); final String name = getUniqueName(); // Cache cache = getCache(); Host host = Host.getHost(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java index 1d89967..acd6bc9 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDelayedRecoveryDUnitTest.java @@ -26,6 +26,7 @@ import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -156,7 +157,7 @@ public class PartitionedRegionDelayedRecoveryDUnitTest extends CacheTestCase { fail("Redundancy recovery did not happen within 60 seconds"); } } catch (InterruptedException e) { - fail("interrupted", e); + Assert.fail("interrupted", e); } finally { InternalResourceManager.setResourceObserver(null); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java index 4733fff..6f4e20d 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDestroyDUnitTest.java @@ -28,6 +28,7 @@ import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.RegionDestroyedException; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -166,7 +167,7 @@ public class PartitionedRegionDestroyDUnitTest extends DistributedTestCase.join(async1, 30 * 1000, getLogWriter()); if(async1.exceptionOccurred()) { - fail("async1 failed", async1.getException()); + Assert.fail("async1 failed", async1.getException()); } final String expectedExceptions = "com.gemstone.gemfire.distributed.internal.ReplyException"; addExceptionTag(expectedExceptions); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java index dbaa433..985656d 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEntryCountDUnitTest.java @@ -23,6 +23,7 @@ import com.gemstone.gemfire.cache.EvictionAttributes; import com.gemstone.gemfire.cache.PartitionAttributesFactory; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -85,7 +86,7 @@ public class PartitionedRegionEntryCountDUnitTest extends CacheTestCase { assertNotNull(pr); } catch (final CacheException ex) { - fail("While creating Partitioned region", ex); + Assert.fail("While creating Partitioned region", ex); } } }; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java index 5fe0b45..48972c6 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionEvictionDUnitTest.java @@ -46,6 +46,7 @@ import com.gemstone.gemfire.internal.cache.control.HeapMemoryMonitor; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceType; import com.gemstone.gemfire.internal.cache.lru.HeapEvictor; import com.gemstone.gemfire.internal.cache.lru.HeapLRUCapacityController; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; @@ -362,7 +363,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase { assertNotNull(pr); } catch (final CacheException ex) { - fail("While creating Partitioned region", ex); + Assert.fail("While creating Partitioned region", ex); } } }; @@ -543,7 +544,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase { assertNotNull(pr); } catch (final CacheException ex) { - fail("While creating Partitioned region", ex); + Assert.fail("While creating Partitioned region", ex); } } }; @@ -661,7 +662,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase { assertNotNull(pr); } catch (final CacheException ex) { - fail("While creating Partitioned region", ex); + Assert.fail("While creating Partitioned region", ex); } } }; @@ -1723,7 +1724,7 @@ public class PartitionedRegionEvictionDUnitTest extends CacheTestCase { assertNotNull(pr); } catch (final CacheException ex) { - fail("While creating Partitioned region", ex); + Assert.fail("While creating Partitioned region", ex); } } }; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java index 9ce79e1..50ec5b9 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHADUnitTest.java @@ -36,6 +36,7 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserver; import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -102,7 +103,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase } assertNotNull(partitionedregion); } catch (InterruptedException e) { - fail("interrupted",e); + Assert.fail("interrupted",e); } finally { InternalResourceManager.setResourceObserver(null); } @@ -219,7 +220,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase fail("recovery didn't happen in 60 seconds"); } } catch (InterruptedException e) { - fail("recovery wait interrupted", e); + Assert.fail("recovery wait interrupted", e); } finally { InternalResourceManager.setResourceObserver(null); } @@ -321,7 +322,7 @@ public class PartitionedRegionHADUnitTest extends PartitionedRegionDUnitTestCase // async1.join(); if (async0.exceptionOccurred()) { - fail("async0 failed", async0.getException()); + Assert.fail("async0 failed", async0.getException()); } // assertFalse(async1.exceptionOccurred()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java index 726423d..ca37e1c 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHAFailureAndRecoveryDUnitTest.java @@ -32,6 +32,7 @@ import com.gemstone.gemfire.cache30.CertifiableTestCacheListener; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.internal.NanoTimer; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -401,7 +402,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends for (int count2 = 0; count2 < async.length; count2++) { if (async[count2].exceptionOccurred()) { - fail("exception during " + count2, async[count2].getException()); + Assert.fail("exception during " + count2, async[count2].getException()); } } } @@ -491,7 +492,7 @@ public class PartitionedRegionHAFailureAndRecoveryDUnitTest extends TimeUnit.MILLISECONDS.sleep(250); } catch (InterruptedException e) { - fail("Interrupted, ah!", e); + Assert.fail("Interrupted, ah!", e); } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java index 6ace0a5..74b7d42 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionMultipleDUnitTest.java @@ -20,6 +20,7 @@ import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -243,7 +244,7 @@ public class PartitionedRegionMultipleDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } @@ -303,7 +304,7 @@ public class PartitionedRegionMultipleDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } } @@ -339,7 +340,7 @@ public class PartitionedRegionMultipleDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } } @@ -372,7 +373,7 @@ public class PartitionedRegionMultipleDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("Failed due to exception: "+ async[count].getException(), + Assert.fail("Failed due to exception: "+ async[count].getException(), async[count].getException()); } } @@ -411,7 +412,7 @@ public class PartitionedRegionMultipleDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } } @@ -545,7 +546,7 @@ public class PartitionedRegionMultipleDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { DistributedTestCase.join(async[count], 30 * 1000, getLogWriter()); if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } @@ -591,7 +592,7 @@ public class PartitionedRegionMultipleDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("exception during " + count, async[count].getException()); + Assert.fail("exception during " + count, async[count].getException()); } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java index 496026d..dc88914 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionPRIDDUnitTest.java @@ -23,6 +23,7 @@ import java.util.*; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache30.*; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -121,7 +122,7 @@ public class PartitionedRegionPRIDDUnitTest extends for (int count = 0; count < AsyncInvocationArrSize; count++) { if (async[count].exceptionOccurred()) { - fail("VM " + count + Assert.fail("VM " + count + " encountered this exception during async invocation", async[count].getException()); } @@ -238,7 +239,7 @@ public class PartitionedRegionPRIDDUnitTest extends for (int i = 0; i < numNodes; i++) { if (async[i].exceptionOccurred()) { - fail("VM " + i + Assert.fail("VM " + i + " encountered this exception during async invocation", async[i].getException()); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java index b4af7d1..171a889 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryDUnitTest.java @@ -58,6 +58,7 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.internal.cache.partitioned.QueryMessage; import com.gemstone.gemfire.pdx.JSONFormatter; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; @@ -295,7 +296,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -367,7 +368,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -438,7 +439,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -510,7 +511,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -582,7 +583,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -655,7 +656,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -727,7 +728,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -798,7 +799,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); @@ -953,7 +954,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { try { qs = getCache().getQueryService(); } catch (Exception e) { - fail("Failed to get QueryService.", e); + Assert.fail("Failed to get QueryService.", e); } for (int i = 0; i < queries.length; i++) { @@ -962,7 +963,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { assertTrue("Size of resultset should be greater than 0 for query: " + queries[i], sr.size() > 0); } catch (Exception e) { - fail("Failed executing query ", e); + Assert.fail("Failed executing query ", e); } } return null; @@ -1004,7 +1005,7 @@ public class PartitionedRegionQueryDUnitTest extends CacheTestCase { SelectResults results = (SelectResults) query.execute(); assertEquals(new HashSet(Arrays.asList(new Integer[] { 1, 2, 3 ,4, 5, 6, 7, 8, 9 })), results.asSet()); } catch (Exception e) { - fail("Bad query", e); + Assert.fail("Bad query", e); } } }); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java index e5e238e..1d57733 100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopDUnitTest.java @@ -65,9 +65,11 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId; import com.gemstone.gemfire.internal.cache.execute.data.OrderId; import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.VM; public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { @@ -104,7 +106,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { public void setUp() throws Exception { super.setUp(); - addExpectedException("Connection refused"); + IgnoredException.addExpectedException("Connection refused"); Host host = Host.getHost(0); member0 = host.getVM(0); member1 = host.getVM(1); @@ -186,7 +188,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); @@ -805,7 +807,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { public void testMetadataFetchOnlyThroughFunctions() { //Workaround for 52004 - addExpectedException("InternalFunctionInvocationTargetException"); + IgnoredException.addExpectedException("InternalFunctionInvocationTargetException"); Integer port0 = (Integer)member0.invoke( PartitionedRegionSingleHopDUnitTest.class, "createServer", new Object[] { 3, 4 }); @@ -1404,7 +1406,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); @@ -1474,7 +1476,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); @@ -1616,7 +1618,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } return port; } @@ -1699,7 +1701,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } return port; } @@ -1714,7 +1716,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); @@ -1786,7 +1788,7 @@ public class PartitionedRegionSingleHopDUnitTest extends CacheTestCase { server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java index ee256a9..711909d 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSingleHopWithServerGroupDUnitTest.java @@ -41,8 +41,10 @@ import com.gemstone.gemfire.internal.cache.execute.data.CustId; import com.gemstone.gemfire.internal.cache.execute.data.OrderId; import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.IgnoredException; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -115,7 +117,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes member1 = host.getVM(1); member2 = host.getVM(2); member3 = host.getVM(3); - addExpectedException("java.net.SocketException"); + IgnoredException.addExpectedException("java.net.SocketException"); } public void tearDown2() throws Exception { @@ -809,7 +811,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); @@ -895,7 +897,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); @@ -981,7 +983,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); @@ -1350,7 +1352,7 @@ public class PartitionedRegionSingleHopWithServerGroupDUnitTest extends CacheTes server.start(); } catch (IOException e) { - fail("Failed to start server ", e); + Assert.fail("Failed to start server ", e); } PartitionAttributesFactory paf = new PartitionAttributesFactory(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java index c4c9796..735acfd 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionSizeDUnitTest.java @@ -31,6 +31,7 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.internal.OSProcess; import com.gemstone.gemfire.internal.logging.InternalLogWriter; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.AsyncInvocation; import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; @@ -237,7 +238,7 @@ public class PartitionedRegionSizeDUnitTest extends DistributedTestCase.join(async0, 30 * 1000, getLogWriter()); if (async0.exceptionOccurred()) { - fail("Exception during async0", async0.getException()); + Assert.fail("Exception during async0", async0.getException()); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java index fe2a104..79b0ec8 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsDUnitTest.java @@ -30,6 +30,7 @@ import com.gemstone.gemfire.cache.control.RebalanceOperation; import com.gemstone.gemfire.cache.control.RebalanceResults; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -358,7 +359,7 @@ public class PartitionedRegionStatsDUnitTest extends try { RebalanceResults results = op.getResults(); } catch (Exception e) { - fail("ex", e); + Assert.fail("ex", e); } } }; @@ -406,7 +407,7 @@ public class PartitionedRegionStatsDUnitTest extends RebalanceResults results = op.getResults(); } catch (Exception e) { - fail("ex", e); + Assert.fail("ex", e); } } }; @@ -541,7 +542,7 @@ public class PartitionedRegionStatsDUnitTest extends try { tombstoneService.forceBatchExpirationForTests(1); } catch (InterruptedException e) { - fail("interrupted", e); + Assert.fail("interrupted", e); } } }); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java index 7840a2b..0b73af0 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionTestUtilsDUnitTest.java @@ -36,6 +36,7 @@ import com.gemstone.gemfire.cache.PartitionAttributesFactory; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.DistributedMember; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.VM; @@ -97,9 +98,9 @@ public class PartitionedRegionTestUtilsDUnitTest extends assertNotNull(s); assertTrue(s.isEmpty()); } catch (ClassNotFoundException cnfe) { - fail("GetSomeKeys failed with ClassNotFoundException", cnfe); + Assert.fail("GetSomeKeys failed with ClassNotFoundException", cnfe); } catch (IOException ioe) { - fail("GetSomeKeys failed with IOException", ioe); + Assert.fail("GetSomeKeys failed with IOException", ioe); } } @@ -127,9 +128,9 @@ public class PartitionedRegionTestUtilsDUnitTest extends assertTrue(val.intValue() < MAXKEYS); } } catch (ClassNotFoundException cnfe) { - fail("GetSomeKeys failed with ClassNotFoundException", cnfe); + Assert.fail("GetSomeKeys failed with ClassNotFoundException", cnfe); } catch (IOException ioe) { - fail("GetSomeKeys failed with IOException", ioe); + Assert.fail("GetSomeKeys failed with IOException", ioe); } } } @@ -513,7 +514,7 @@ public class PartitionedRegionTestUtilsDUnitTest extends assertEquals(0, p.getBucketOwnersForValidation(i).size()); } } catch (ForceReattemptException noGood) { - fail("Unexpected force retry", noGood); + Assert.fail("Unexpected force retry", noGood); } } } @@ -562,7 +563,7 @@ public class PartitionedRegionTestUtilsDUnitTest extends assertEquals(1, primCount); } } catch (ForceReattemptException noGood) { - fail("Unexpected force retry", noGood); + Assert.fail("Unexpected force retry", noGood); } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0d759cb3/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java index 55d9a82..b6ad72d 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionWithSameNameDUnitTest.java @@ -37,6 +37,7 @@ import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.RegionExistsException; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; +import com.gemstone.gemfire.test.dunit.Assert; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -754,7 +755,7 @@ public class PartitionedRegionWithSameNameDUnitTest extends cache.createRegion(innerPrPrefix + i, ra); } catch (RegionExistsException ex) { - fail( + Assert.fail( "Got incorrect exception because the partition region being created prior to local region", ex); }