You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2016/02/11 01:39:21 UTC
[47/61] [abbrv] [partial] incubator-geode git commit: GEODE-773:
Extract static methods from DistributedTestCase
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
index 372111c..85ae9aa 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java
@@ -66,9 +66,13 @@ import com.gemstone.gemfire.internal.cache.control.ResourceListener;
import com.gemstone.gemfire.internal.cache.control.TestMemoryThresholdListener;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
import com.gemstone.gemfire.test.dunit.VM;
public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCase {
@@ -84,16 +88,15 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
@Override
public void setUp() throws Exception {
super.setUp();
- invokeInEveryVM(this.setHeapMemoryMonitorTestMode);
- addExpectedException("above heap critical threshold");
- addExpectedException("below heap critical threshold");
+ Invoke.invokeInEveryVM(this.setHeapMemoryMonitorTestMode);
+ IgnoredException.addIgnoredException("above heap critical threshold");
+ IgnoredException.addIgnoredException("below heap critical threshold");
}
@Override
- public void tearDown2() throws Exception {
- invokeInEveryVM(resetQueryMonitor);
- invokeInEveryVM(resetResourceManager);
- super.tearDown2();
+ protected void preTearDownClientServerTestCase() throws Exception {
+ Invoke.invokeInEveryVM(resetQueryMonitor);
+ Invoke.invokeInEveryVM(resetResourceManager);
}
private SerializableCallable setHeapMemoryMonitorTestMode = new SerializableCallable() {
@@ -723,7 +726,7 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
//unless otherwise configured
releaseHook(server);
- DistributedTestCase.join(queryExecution, 60000, getLogWriter());
+ ThreadUtils.join(queryExecution, 60000);
//Make sure no exceptions were thrown during query testing
try {
assertEquals(0, queryExecution.getResult());
@@ -1020,7 +1023,7 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
getSystem(props);
final ClientCacheFactory ccf = new ClientCacheFactory(props);
- ccf.addPoolServer(getServerHostName(server.getHost()), port);
+ ccf.addPoolServer(NetworkUtils.getServerHostName(server.getHost()), port);
ClientCache cache = (ClientCache)getClientCache(ccf);
}
});
@@ -1035,7 +1038,7 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
getSystem(props);
PoolFactory pf = PoolManager.createFactory();
- pf.addServer(getServerHostName(server.getHost()), port);
+ pf.addServer(NetworkUtils.getServerHostName(server.getHost()), port);
pf.create("pool1");
AttributesFactory af = new AttributesFactory();
@@ -1057,7 +1060,7 @@ public class ResourceManagerWithQueryMonitorDUnitTest extends ClientServerTestCa
protected Properties getServerProperties(boolean disableQueryMonitorForMemory, int queryTimeout) {
Properties p = new Properties();
- p.setProperty(DistributionConfig.LOCATORS_NAME, "localhost["+getDUnitLocatorPort()+"]");
+ p.setProperty(DistributionConfig.LOCATORS_NAME, "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
return p;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/SelectStarQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/SelectStarQueryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/SelectStarQueryDUnitTest.java
index b943aca..90ee7f7 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/SelectStarQueryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/SelectStarQueryDUnitTest.java
@@ -40,7 +40,10 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.VMCachedDeserializable;
import com.gemstone.gemfire.pdx.PdxInstance;
+import com.gemstone.gemfire.test.dunit.Assert;
import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
import com.gemstone.gemfire.test.dunit.SerializableCallable;
import com.gemstone.gemfire.test.dunit.VM;
@@ -116,9 +119,9 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port1);
- cf.addPoolServer(getServerHostName(server2.getHost()), port2);
- cf.addPoolServer(getServerHostName(server3.getHost()), port3);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port1);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server2.getHost()), port2);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server3.getHost()), port3);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -142,14 +145,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults[][] sr = new SelectResults[1][2];
SelectResults res = null;
@@ -161,7 +164,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -215,14 +218,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < queries.length; i++) {
try {
res = (SelectResults) qs.newQuery(queries[i]).execute();
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -288,7 +291,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port1);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port1);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -316,14 +319,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -338,7 +341,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + multipleRegionQueries[i], e);
+ Assert.fail("Error executing query: " + multipleRegionQueries[i], e);
}
assertEquals(resultSize2[i], res.size());
if (i == 4) {
@@ -395,7 +398,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < multipleRegionQueries.length; i++) {
@@ -403,7 +406,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
res = (SelectResults) qs.newQuery(multipleRegionQueries[i])
.execute();
} catch (Exception e) {
- fail("Error executing query: " + multipleRegionQueries[i], e);
+ Assert.fail("Error executing query: " + multipleRegionQueries[i], e);
}
assertEquals(resultSize2[i], res.size());
if (i == 4) {
@@ -488,7 +491,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -512,14 +515,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -532,7 +535,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -583,14 +586,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < 6; i++) {
try {
res = (SelectResults) qs.newQuery(queries[i]).execute();
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -661,9 +664,9 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port1);
- cf.addPoolServer(getServerHostName(server2.getHost()), port2);
- cf.addPoolServer(getServerHostName(server3.getHost()), port3);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port1);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server2.getHost()), port2);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server3.getHost()), port3);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -687,14 +690,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -707,7 +710,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -758,14 +761,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < 6; i++) {
try {
res = (SelectResults) qs.newQuery(queries[i]).execute();
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -817,7 +820,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port1);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port1);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -850,7 +853,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
qs = getCache().getQueryService();
qs.createIndex("status", "status", "/" + regName);
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
return null;
@@ -861,14 +864,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -883,7 +886,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + multipleRegionQueries[i], e);
+ Assert.fail("Error executing query: " + multipleRegionQueries[i], e);
}
assertEquals(resultSize2[i], res.size());
if (i == 4) {
@@ -926,7 +929,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
qs = getCache().getQueryService();
qs.createIndex("status", "status", "/" + regName2);
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
return null;
@@ -937,14 +940,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -959,7 +962,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + multipleRegionQueries[i], e);
+ Assert.fail("Error executing query: " + multipleRegionQueries[i], e);
}
assertEquals(resultSize2[i], res.size());
if (i == 4) {
@@ -1019,7 +1022,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port1);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port1);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -1043,14 +1046,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -1063,7 +1066,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -1118,14 +1121,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < queries.length; i++) {
try {
res = (SelectResults) qs.newQuery(queries[i]).execute();
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -1174,14 +1177,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < queries.length; i++) {
try {
res = (SelectResults) qs.newQuery(queries[i]).execute();
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -1240,7 +1243,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port1);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port1);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -1264,14 +1267,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -1284,7 +1287,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -1341,14 +1344,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < queries.length; i++) {
try {
res = (SelectResults) qs.newQuery(queries[i]).execute();
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -1397,14 +1400,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
try {
qs = getCache().getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
for (int i = 0; i < queries.length; i++) {
try {
res = (SelectResults) qs.newQuery(queries[i]).execute();
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -1467,7 +1470,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
@Override
public Object call() throws Exception {
ClientCacheFactory cf = new ClientCacheFactory();
- cf.addPoolServer(getServerHostName(server1.getHost()), port);
+ cf.addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port);
ClientCache cache = getClientCache(cf);
cache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.create(regName);
@@ -1483,14 +1486,14 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
client.invoke(new SerializableCallable("Query") {
@Override
public Object call() throws Exception {
- getLogWriter().info("Querying remotely from client");
+ LogWriterUtils.getLogWriter().info("Querying remotely from client");
QueryService localQS = null;
QueryService remoteQS = null;
try {
localQS = ((ClientCache) getCache()).getLocalQueryService();
remoteQS = ((ClientCache) getCache()).getQueryService();
} catch (Exception e) {
- fail("Exception getting query service ", e);
+ Assert.fail("Exception getting query service ", e);
}
SelectResults res = null;
SelectResults[][] sr = new SelectResults[1][2];
@@ -1503,7 +1506,7 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
sr[0][1] = res;
CacheUtils.compareResultsOfWithAndWithoutIndex(sr);
} catch (Exception e) {
- fail("Error executing query: " + queries[i], e);
+ Assert.fail("Error executing query: " + queries[i], e);
}
assertEquals(resultSize[i], res.size());
if (i == 3) {
@@ -1602,10 +1605,10 @@ public class SelectStarQueryDUnitTest extends CacheTestCase {
public void beforeIterationEvaluation(CompiledValue executer,
Object currentObject) {
if (currentObject instanceof VMCachedDeserializable) {
- getLogWriter().fine("currentObject is serialized object");
+ LogWriterUtils.getLogWriter().fine("currentObject is serialized object");
isObjectSerialized = true;
} else {
- getLogWriter().fine("currentObject is deserialized object");
+ LogWriterUtils.getLogWriter().fine("currentObject is deserialized object");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
index 37abacf..57846a8 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationDeadLockJUnitTest.java
@@ -46,7 +46,7 @@ import com.gemstone.gemfire.cache.query.IndexType;
import com.gemstone.gemfire.cache.query.QueryService;
import com.gemstone.gemfire.cache.query.data.Portfolio;
import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -190,7 +190,7 @@ public class IndexCreationDeadLockJUnitTest
Thread th = new IndexCreationDeadLockJUnitTest.PutThread("put thread");
th.start();
- DistributedTestCase.join(th, 60 * 1000, null);
+ ThreadUtils.join(th, 60 * 1000);
}
/**
@@ -294,7 +294,7 @@ public class IndexCreationDeadLockJUnitTest
Thread indxCreationThread = new HelperThread("index creator thread");
indxCreationThread.start();
try {
- DistributedTestCase.join(indxCreationThread, 30 * 1000, null);
+ ThreadUtils.join(indxCreationThread, 30 * 1000);
}
catch (Exception e) {
e.printStackTrace();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexMaintenanceAsynchJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexMaintenanceAsynchJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexMaintenanceAsynchJUnitTest.java
index 84612b5..ac3b8bb 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexMaintenanceAsynchJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexMaintenanceAsynchJUnitTest.java
@@ -45,8 +45,8 @@ import com.gemstone.gemfire.cache.query.data.Portfolio;
import com.gemstone.gemfire.cache.query.internal.QueryObserverAdapter;
import com.gemstone.gemfire.cache.query.internal.QueryObserverHolder;
import com.gemstone.gemfire.cache.query.internal.index.IndexProtocol;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -137,7 +137,7 @@ public class IndexMaintenanceAsynchJUnitTest {
return "index updates never became 8";
}
};
- DistributedTestCase.waitForCriterion(ev, 5000, 200, true);
+ Wait.waitForCriterion(ev, 5000, 200, true);
//queryString= "SELECT DISTINCT * FROM /portfolios p, p.positions.values pos where pos.secId='IBM'";
queryString= "SELECT DISTINCT * FROM /portfolios where status = 'active'";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
index 3e4a570..0bfad5e 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/LikePredicateJUnitTest.java
@@ -57,7 +57,7 @@ import com.gemstone.gemfire.cache.query.internal.ResultsCollectionWrapper;
import com.gemstone.gemfire.cache.query.internal.index.IndexManager;
import com.gemstone.gemfire.cache.query.internal.index.IndexManager.TestHook;
import com.gemstone.gemfire.cache.query.internal.types.ObjectTypeImpl;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -2054,7 +2054,7 @@ public class LikePredicateJUnitTest {
assertEquals(5, rs[0][0].size());
// wait for remove to complete
- DistributedTestCase.join(LikeQueryIndexTestHook.th, 60 * 1000, null);
+ ThreadUtils.join(LikeQueryIndexTestHook.th, 60 * 1000);
// The index should have been removed by now
assertEquals(0, cache.getQueryService().getIndexes().size());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/ExecutionContextJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/ExecutionContextJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/ExecutionContextJUnitTest.java
index 35b5995..41d6d62 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/ExecutionContextJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/ExecutionContextJUnitTest.java
@@ -44,7 +44,7 @@ import com.gemstone.gemfire.cache.query.SelectResults;
import com.gemstone.gemfire.cache.query.data.Portfolio;
import com.gemstone.gemfire.cache.query.data.Position;
import com.gemstone.gemfire.internal.cache.InternalCache;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
/**
@@ -368,7 +368,7 @@ public class ExecutionContextJUnitTest {
for (int i =0; i < th.length ;++i) {
try {
- DistributedTestCase.join(th[i], 30 * 1000, null);
+ ThreadUtils.join(th[i], 30 * 1000);
}catch(Exception e) {
fail(e.toString());
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
index 7ad5f66..eeaa36c 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/AsynchIndexMaintenanceJUnitTest.java
@@ -28,8 +28,9 @@ import com.gemstone.gemfire.cache.query.CacheUtils;
import com.gemstone.gemfire.cache.query.IndexType;
import com.gemstone.gemfire.cache.query.QueryService;
import com.gemstone.gemfire.cache.query.data.Portfolio;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import java.util.HashSet;
@@ -113,7 +114,7 @@ public class AsynchIndexMaintenanceJUnitTest {
return "valueToEntriesMap never became 50";
}
};
- DistributedTestCase.waitForCriterion(ev, 3000, 200, true);
+ Wait.waitForCriterion(ev, 3000, 200, true);
}
@Test
@@ -140,7 +141,7 @@ public class AsynchIndexMaintenanceJUnitTest {
}
};
- DistributedTestCase.waitForCriterion(evSize, 17 * 1000, 200, true);
+ Wait.waitForCriterion(evSize, 17 * 1000, 200, true);
// clear region.
region.clear();
@@ -153,7 +154,7 @@ public class AsynchIndexMaintenanceJUnitTest {
return "valueToEntriesMap never became size :" + 0;
}
};
- DistributedTestCase.waitForCriterion(evClear, 17 * 1000, 200, true);
+ Wait.waitForCriterion(evClear, 17 * 1000, 200, true);
// Add to region.
for( int i=0; i<size ; ++i) {
@@ -161,7 +162,7 @@ public class AsynchIndexMaintenanceJUnitTest {
idSet.add((i+1) + "");
}
//assertEquals(0, getIndexSize(ri));
- DistributedTestCase.waitForCriterion(evSize, 17 * 1000, 200, true);
+ Wait.waitForCriterion(evSize, 17 * 1000, 200, true);
}
@Test
@@ -183,7 +184,7 @@ public class AsynchIndexMaintenanceJUnitTest {
return "valueToEntries map never became size 3";
}
};
- DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true);
+ Wait.waitForCriterion(ev, 10 * 1000, 200, true);
}
@Test
@@ -247,7 +248,7 @@ public class AsynchIndexMaintenanceJUnitTest {
}
try {
for (int i = 0; i < TOTAL_THREADS; ++i) {
- DistributedTestCase.join(threads[i], 30 * 1000, null);
+ ThreadUtils.join(threads[i], 30 * 1000);
}
}
catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
index 3e69990..5528299 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java
@@ -45,9 +45,13 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.internal.cache.EvictionAttributesImpl;
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.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
/**
* @author shobhit
@@ -112,7 +116,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
}
assertNotNull("Region " + name + " not in cache", cache.getRegion(name));
assertNotNull("Region ref null", partitionRegion);
@@ -165,7 +169,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
Cache cache = PRQHelp.getCache();
while (!hooked) {
- pause(100);
+ Wait.pause(100);
}
// Create and hence initialize Index
try {
@@ -180,10 +184,8 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
});
// If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30 * 1000, PRQHelp.getCache()
- .getLogger());
- DistributedTestCase.join(asyncInv1, 30 * 1000, PRQHelp.getCache()
- .getLogger());
+ ThreadUtils.join(asyncInv2, 30 * 1000);
+ ThreadUtils.join(asyncInv1, 30 * 1000);
}
/**
@@ -194,8 +196,8 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
VM vm0 = host.getVM(0);
VM vm1 = host.getVM(1);
- addExpectedException("Unexpected IOException:");
- addExpectedException("java.net.SocketException");
+ IgnoredException.addIgnoredException("Unexpected IOException:");
+ IgnoredException.addIgnoredException("java.net.SocketException");
name = "PartionedPortfoliosPR";
// Create Overflow Persistent Partition Region
@@ -232,7 +234,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
} catch (IOException e) {
e.printStackTrace();
}
@@ -254,7 +256,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
final int port = vm0.invokeInt(ConcurrentIndexInitOnOverflowRegionDUnitTest.class,
"getCacheServerPort");
- final String host0 = getServerHostName(vm0.getHost());
+ final String host0 = NetworkUtils.getServerHostName(vm0.getHost());
// Start changing the value in Region which should turn into a deadlock if
// the fix is not there
@@ -308,7 +310,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
Cache cache = PRQHelp.getCache();
while (!hooked) {
- pause(100);
+ Wait.pause(100);
}
// Create Indexes
try {
@@ -323,10 +325,8 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
});
// If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30 * 1000, PRQHelp.getCache()
- .getLogger());
- DistributedTestCase.join(asyncInv1, 30 * 1000, PRQHelp.getCache()
- .getLogger());
+ ThreadUtils.join(asyncInv2, 30 * 1000);
+ ThreadUtils.join(asyncInv1, 30 * 1000);
vm0.invoke(new CacheSerializableRunnable("Set Test Hook") {
@@ -378,7 +378,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
case 6: // processAction in IndexManager
hooked = true;
//wait untill some thread unhooks.
- while (hooked) { pause(20); }
+ while (hooked) { Wait.pause(20); }
break;
default:
break;
@@ -397,7 +397,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
for (int i=0; i<100; i++) {
if (i == 50) IndexManager.testHook = new LocalTestHook();
region.put(i, new Portfolio(i));
- if (i == 50) pause(20);
+ if (i == 50) Wait.pause(20);
}
}
});
@@ -410,7 +410,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
Region region = PRQHelp.getCache().getRegion(regionName);
while(!hooked) {
- pause(100);
+ Wait.pause(100);
}
if (hooked) {
hooked = false;
@@ -431,8 +431,7 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
});
// Kill asynch thread
- DistributedTestCase.join(indexUpdateAsysnch, 20000, PRQHelp.getCache()
- .getLogger());
+ ThreadUtils.join(indexUpdateAsysnch, 20000);
//Verify region size which must be 50
vm0.invoke(new CacheSerializableRunnable("Check region size") {
@@ -453,8 +452,8 @@ public class ConcurrentIndexInitOnOverflowRegionDUnitTest extends CacheTestCase
switch (spot) {
case 6: // Before Index update and after region entry lock.
hooked = true;
- getLogWriter().fine("IndexManagerTestHook is hooked.");
- pause(10000);
+ LogWriterUtils.getLogWriter().fine("IndexManagerTestHook is hooked.");
+ Wait.pause(10000);
hooked = false;
break;
default:
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
index e999787..81482b4 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java
@@ -45,9 +45,11 @@ import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.internal.cache.EvictionAttributesImpl;
import com.gemstone.gemfire.internal.cache.PartitionedRegionQueryEvaluator.TestHook;
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.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
/**
* Test creates a persistent-overflow region and performs updates in region
@@ -115,7 +117,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
}
assertNotNull("Region " + name + " not in cache", cache.getRegion(name));
assertNotNull("Region ref null", partitionRegion);
@@ -167,7 +169,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
.newQuery("select * from /" + name + " p where p.ID > -1");
while (!hooked) {
- pause(100);
+ Wait.pause(100);
}
try {
PRQHelp.getCache().getLogger().fine("Querying the region");
@@ -180,8 +182,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
});
//If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30*1000, PRQHelp.getCache().getLogger());
- DistributedTestCase.join(asyncInv1, 30*1000, PRQHelp.getCache().getLogger());
+ ThreadUtils.join(asyncInv2, 30*1000);
+ ThreadUtils.join(asyncInv1, 30*1000);
}
/**
@@ -217,7 +219,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
}
assertNotNull("Region " + name + " not in cache", cache.getRegion(name));
assertNotNull("Region ref null", partitionRegion);
@@ -269,7 +271,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
.newQuery("select * from /" + name + " p where p.ID > -1");
while (!hooked) {
- pause(100);
+ Wait.pause(100);
}
try {
PRQHelp.getCache().getLogger().fine("Querying the region");
@@ -282,8 +284,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
});
//If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30*1000, PRQHelp.getCache().getLogger());
- DistributedTestCase.join(asyncInv1, 30*1000, PRQHelp.getCache().getLogger());
+ ThreadUtils.join(asyncInv2, 30*1000);
+ ThreadUtils.join(asyncInv1, 30*1000);
}
/**
@@ -322,7 +324,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
}
assertNotNull("Region " + name + " not in cache", cache.getRegion(name));
assertNotNull("Region ref null", partitionRegion);
@@ -378,7 +380,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
.newQuery("select * from /" + name + " p where p.ID > -1");
while (!hooked) {
- pause(100);
+ Wait.pause(100);
}
try {
PRQHelp.getCache().getLogger().fine("Querying the region");
@@ -391,10 +393,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
});
// If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30 * 1000, PRQHelp.getCache()
- .getLogger());
- DistributedTestCase.join(asyncInv1, 30 * 1000, PRQHelp.getCache()
- .getLogger());
+ ThreadUtils.join(asyncInv2, 30 * 1000);
+ ThreadUtils.join(asyncInv1, 30 * 1000);
}
/**
@@ -433,7 +433,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
}
assertNotNull("Region " + name + " not in cache", cache.getRegion(name));
assertNotNull("Region ref null", partitionRegion);
@@ -489,7 +489,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
.newQuery("select * from /" + name + " p where p.ID > -1");
while (!hooked) {
- pause(100);
+ Wait.pause(100);
}
try {
PRQHelp.getCache().getLogger().fine("Querying the region");
@@ -502,10 +502,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
});
// If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30 * 1000, PRQHelp.getCache()
- .getLogger());
- DistributedTestCase.join(asyncInv1, 30 * 1000, PRQHelp.getCache()
- .getLogger());
+ ThreadUtils.join(asyncInv2, 30 * 1000);
+ ThreadUtils.join(asyncInv1, 30 * 1000);
}
/**
@@ -532,7 +530,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
}
assertNotNull("Region " + name + " not in cache", cache.getRegion(name));
assertNotNull("Region ref null", partitionRegion);
@@ -584,7 +582,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
.newQuery("select * from /" + name + " p where p.ID > -1");
while (!hooked) {
- pause(10);
+ Wait.pause(10);
}
try {
PRQHelp.getCache().getLogger().fine("Querying the region");
@@ -597,8 +595,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
});
//If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30*1000, PRQHelp.getCache().getLogger());
- DistributedTestCase.join(asyncInv1, 30*1000, PRQHelp.getCache().getLogger());
+ ThreadUtils.join(asyncInv2, 30*1000);
+ ThreadUtils.join(asyncInv1, 30*1000);
}
/**
@@ -625,7 +623,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
RegionFactory regionFactory = cache.createRegionFactory(attr.create());
partitionRegion = regionFactory.create(name);
} catch (IllegalStateException ex) {
- getLogWriter().warning("Creation caught IllegalStateException", ex);
+ LogWriterUtils.getLogWriter().warning("Creation caught IllegalStateException", ex);
}
assertNotNull("Region " + name + " not in cache", cache.getRegion(name));
assertNotNull("Region ref null", partitionRegion);
@@ -677,7 +675,7 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
.newQuery("select * from /" + name + " p where p.ID > -1");
while (!hooked) {
- pause(10);
+ Wait.pause(10);
}
try {
PRQHelp.getCache().getLogger().fine("Querying the region");
@@ -690,8 +688,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
});
//If we take more than 30 seconds then its a deadlock.
- DistributedTestCase.join(asyncInv2, 30*1000, PRQHelp.getCache().getLogger());
- DistributedTestCase.join(asyncInv1, 30*1000, PRQHelp.getCache().getLogger());
+ ThreadUtils.join(asyncInv2, 30*1000);
+ ThreadUtils.join(asyncInv1, 30*1000);
}
public class IndexManagerTestHook implements com.gemstone.gemfire.cache.query.internal.index.IndexManager.TestHook{
@@ -699,8 +697,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
switch (spot) {
case 5: //Before Index update and after region entry lock.
hooked = true;
- getLogWriter().fine("IndexManagerTestHook is hooked.");
- pause(10000);
+ LogWriterUtils.getLogWriter().fine("IndexManagerTestHook is hooked.");
+ Wait.pause(10000);
//hooked = false;
break;
default:
@@ -713,8 +711,8 @@ public class ConcurrentIndexOperationsOnOverflowRegionDUnitTest extends
switch (spot) {
case 5: //Before Index update and after region entry lock.
hooked = true;
- getLogWriter().fine("IndexManagerTestHook is hooked.");
- pause(100);
+ LogWriterUtils.getLogWriter().fine("IndexManagerTestHook is hooked.");
+ Wait.pause(100);
// hooked = false;
break;
default:
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
index 5faba97..6cbbef2 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java
@@ -41,11 +41,15 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
import com.gemstone.gemfire.internal.cache.RegionEntry;
import com.gemstone.gemfire.internal.cache.Token;
import com.gemstone.gemfire.internal.cache.persistence.query.CloseableIterator;
+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.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
/**
* This test is similar to {@link ConcurrentIndexUpdateWithoutWLDUnitTest} except
@@ -88,7 +92,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
@Override
public void setUp() throws Exception {
- invokeInEveryVM(new CacheSerializableRunnable("Set INPLACE_OBJECT_MODIFICATION false") {
+ Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set INPLACE_OBJECT_MODIFICATION false") {
@Override
public void run2() throws CacheException {
@@ -103,21 +107,18 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
* Tear down a PartitionedRegionTestCase by cleaning up the existing cache
* (mainly because we want to destroy any existing PartitionedRegions)
*/
- public void tearDown2() throws Exception {
- try {
- invokeInEveryVM(new CacheSerializableRunnable("Set INPLACE_OBJECT_MODIFICATION false") {
-
- @Override
- public void run2() throws CacheException {
- //System.setProperty("gemfire.index.INPLACE_OBJECT_MODIFICATION", "false");
- IndexManager.INPLACE_OBJECT_MODIFICATION_FOR_TEST = false;
- }
- });
- invokeInEveryVM(ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.class, "destroyRegions");
- invokeInEveryVM(CacheTestCase.class, "closeCache");
- } finally {
- super.tearDown2();
- }
+ @Override
+ protected final void preTearDown() throws Exception {
+ Invoke.invokeInEveryVM(new CacheSerializableRunnable("Set INPLACE_OBJECT_MODIFICATION false") {
+
+ @Override
+ public void run2() throws CacheException {
+ //System.setProperty("gemfire.index.INPLACE_OBJECT_MODIFICATION", "false");
+ IndexManager.INPLACE_OBJECT_MODIFICATION_FOR_TEST = false;
+ }
+ });
+ Invoke.invokeInEveryVM(ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.class, "destroyRegions");
+ Invoke.invokeInEveryVM(CacheTestCase.class, "closeCache");
}
public static synchronized void destroyRegions() {
@@ -145,12 +146,12 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 30*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 30*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
@@ -190,11 +191,11 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, totalDataSize));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 30*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 30*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
@@ -248,12 +249,12 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize ));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 60*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 60*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));
@@ -311,11 +312,11 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize ));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 60*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 60*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, rindexName));
@@ -390,7 +391,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
if (index instanceof CompactRangeIndex) {
// Ignore invalid values.
if (value != Token.INVALID && value != Token.TOMBSTONE) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value));
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value));
Integer ID = ((Portfolio) value).getID();
assertTrue("Did not find index key for REgionEntry [key: "
@@ -428,7 +429,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
expectedNullEntries++;
}
} else {
- getLogWriter().info(internalEntry.getKey()+"");
+ LogWriterUtils.getLogWriter().info(internalEntry.getKey()+"");
expectedUndefinedEntries++;
}
}
@@ -440,7 +441,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
Collection<Position> positions = ((Portfolio)value).positions.values();
for (Position pos : positions) {
if (pos != null) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
String secId = pos.secId;
assertTrue("Did not find index key for REgionEntry [key: "
+ internalEntry.getKey() + " , value: " + value
@@ -523,21 +524,21 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
.toArray()) {
getLogWriter().info(((RegionEntry) obj).getKey() + "");
}
-*/ getLogWriter().info(
+*/ LogWriterUtils.getLogWriter().info(
" Expected Size of Index is: " + expectedIndexSize
+ " Undefined size is: " + expectedUndefinedEntries
+ " And NULL size is: " + expectedNullEntries);
assertEquals("No of index keys NOT equals the no shown in statistics for index:" + index.getName(), ((CompactRangeIndex) index).getIndexStorage().size(), stats.getNumberOfKeys());
} else {
- getLogWriter().info(
+ LogWriterUtils.getLogWriter().info(
" Actual Size of Index is: " + actualSize + " Undefined size is: "
+ ((RangeIndex) index).undefinedMappedEntries.getNumEntries()
+ " And NULL size is: "
+ ((RangeIndex) index).nullMappedEntries.getNumEntries());
for (Object obj : ((RangeIndex) index).undefinedMappedEntries.map.keySet()) {
- getLogWriter().info(((RegionEntry) obj).getKey() + "");
+ LogWriterUtils.getLogWriter().info(((RegionEntry) obj).getKey() + "");
}
- getLogWriter().info(
+ LogWriterUtils.getLogWriter().info(
" Expected Size of Index is: " + expectedIndexSize
+ " Undefined size is: " + expectedUndefinedEntries
+ " And NULL size is: " + expectedNullEntries);
@@ -583,7 +584,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
if (index instanceof CompactRangeIndex) {
// Ignore invalid values.
if (value != Token.INVALID && value != Token.TOMBSTONE) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value));
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value));
Integer ID = ((Portfolio) value).getID();
assertTrue("Did not find index key for REgionEntry [key: "
@@ -631,7 +632,7 @@ public class ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest extends
Collection<Position> positions = ((Portfolio)value).positions.values();
for (Position pos : positions) {
if (pos != null) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
String secId = pos.secId;
assertTrue("Did not find index key for REgionEntry [key: "
+ internalEntry.getKey() + " , value: " + value
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
index fbead52..2ac564a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java
@@ -42,11 +42,15 @@ import com.gemstone.gemfire.internal.cache.PartitionedRegion;
import com.gemstone.gemfire.internal.cache.RegionEntry;
import com.gemstone.gemfire.internal.cache.Token;
import com.gemstone.gemfire.internal.cache.persistence.query.CloseableIterator;
+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.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
import com.gemstone.gemfire.test.dunit.VM;
import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.dunit.ThreadUtils;
/**
*
@@ -88,13 +92,10 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
* Tear down a PartitionedRegionTestCase by cleaning up the existing cache
* (mainly because we want to destroy any existing PartitionedRegions)
*/
- public void tearDown2() throws Exception {
- try {
- invokeInEveryVM(ConcurrentIndexUpdateWithoutWLDUnitTest.class, "destroyRegions");
- invokeInEveryVM(CacheTestCase.class, "closeCache");
- } finally {
- super.tearDown2();
- }
+ @Override
+ protected final void preTearDown() throws Exception {
+ Invoke.invokeInEveryVM(ConcurrentIndexUpdateWithoutWLDUnitTest.class, "destroyRegions");
+ Invoke.invokeInEveryVM(CacheTestCase.class, "closeCache");
}
public static synchronized void destroyRegions() {
@@ -121,12 +122,12 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 30*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 30*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
@@ -162,12 +163,12 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 30*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 30*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
@@ -206,11 +207,11 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, totalDataSize));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 30*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 30*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
@@ -264,12 +265,12 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize ));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 60*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 60*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));
@@ -326,11 +327,11 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize ));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 60*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 60*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, rindexName));
@@ -398,12 +399,12 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize ));
for (AsyncInvocation inv : asyncInvs) {
- DistributedTestCase.join(inv, 60*000, helper.getCache().getLogger());
+ ThreadUtils.join(inv, 60*000);
}
for (AsyncInvocation inv : asyncInvs) {
if (inv.exceptionOccurred()) {
- fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
+ Assert.fail("Random region operation failed on VM_"+inv.getId(), inv.getException());
}
}
vm0.invoke(getCacheSerializableRunnableForIndexValidation(regionName, indexName));
@@ -477,7 +478,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
if (index instanceof CompactRangeIndex) {
// Ignore invalid values.
if (value != Token.INVALID && value != Token.TOMBSTONE) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value));
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value));
Integer ID = ((Portfolio) value).getID();
assertTrue("Did not find index key for REgionEntry [key: "
@@ -513,7 +514,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
expectedNullEntries++;
}
} else {
- getLogWriter().info(internalEntry.getKey()+"");
+ LogWriterUtils.getLogWriter().info(internalEntry.getKey()+"");
expectedUndefinedEntries++;
}
}
@@ -525,7 +526,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
Collection<Position> positions = ((Portfolio)value).positions.values();
for (Position pos : positions) {
if (pos != null) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
String secId = pos.secId;
assertTrue("Did not find index key for REgionEntry [key: "
+ internalEntry.getKey() + " , value: " + value
@@ -599,7 +600,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
IndexStatistics stats = index.getStatistics();
if (index instanceof CompactRangeIndex) {
- getLogWriter().info(
+ LogWriterUtils.getLogWriter().info(
" Actual Size of Index is: " + actualSize);
/* getLogWriter().info(
" Actual Size of Index is: " + actualSize + " Undefined size is: "
@@ -611,21 +612,21 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
getLogWriter().info(((RegionEntry) obj).getKey() + "");
}
*/
- getLogWriter().info(
+ LogWriterUtils.getLogWriter().info(
" Expected Size of Index is: " + expectedIndexSize
+ " Undefined size is: " + expectedUndefinedEntries
+ " And NULL size is: " + expectedNullEntries);
assertEquals("No of index keys NOT equals the no shown in statistics for index:" + index.getName(), ((CompactRangeIndex) index).getIndexStorage().size(), stats.getNumberOfKeys());
} else {
- getLogWriter().info(
+ LogWriterUtils.getLogWriter().info(
" Actual Size of Index is: " + actualSize + " Undefined size is: "
+ ((RangeIndex) index).undefinedMappedEntries.getNumEntries()
+ " And NULL size is: "
+ ((RangeIndex) index).nullMappedEntries.getNumEntries());
for (Object obj : ((RangeIndex) index).undefinedMappedEntries.map.keySet()) {
- getLogWriter().info(((RegionEntry) obj).getKey() + "");
+ LogWriterUtils.getLogWriter().info(((RegionEntry) obj).getKey() + "");
}
- getLogWriter().info(
+ LogWriterUtils.getLogWriter().info(
" Expected Size of Index is: " + expectedIndexSize
+ " Undefined size is: " + expectedUndefinedEntries
+ " And NULL size is: " + expectedNullEntries);
@@ -670,7 +671,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
if (index instanceof CompactRangeIndex) {
// Ignore invalid values.
if (value != Token.INVALID && value != Token.TOMBSTONE) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value));
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value));
Integer ID = ((Portfolio) value).getID();
assertTrue("Did not find index key for REgionEntry [key: "
@@ -718,7 +719,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
Collection<Position> positions = ((Portfolio)value).positions.values();
for (Position pos : positions) {
if (pos != null) {
- getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
+ LogWriterUtils.getLogWriter().info("Portfolio: "+ ((Portfolio)value) + "Position: " + pos);
String secId = pos.secId;
assertTrue("Did not find index key for REgionEntry [key: "
+ internalEntry.getKey() + " , value: " + value
@@ -765,7 +766,7 @@ public class ConcurrentIndexUpdateWithoutWLDUnitTest extends
try {
iter = ((CompactRangeIndex) index).getIndexStorage().iterator(null);
while (iter.hasNext()) {
- getLogWriter().info(
+ LogWriterUtils.getLogWriter().info(
"Index Values : " + iter.next().getDeserializedValue());
actualValueSize++;
}