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 494A71846F for ; Thu, 11 Feb 2016 00:39:25 +0000 (UTC) Received: (qmail 28099 invoked by uid 500); 11 Feb 2016 00:39:25 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 28062 invoked by uid 500); 11 Feb 2016 00:39:25 -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 28049 invoked by uid 99); 11 Feb 2016 00:39:25 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2016 00:39:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 92D5F18048E for ; Thu, 11 Feb 2016 00:39:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.549 X-Spam-Level: X-Spam-Status: No, score=-3.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 6NsQ1UTeJXoz for ; Thu, 11 Feb 2016 00:38:53 +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 1A01F233EE for ; Thu, 11 Feb 2016 00:38:37 +0000 (UTC) Received: (qmail 20493 invoked by uid 99); 11 Feb 2016 00:38:37 -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; Thu, 11 Feb 2016 00:38:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E3566E053F; Thu, 11 Feb 2016 00:38:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dschneider@apache.org To: commits@geode.incubator.apache.org Date: Thu, 11 Feb 2016 00:39:23 -0000 Message-Id: <05a6b85533b642439608b285c94b0b6a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [49/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/PdxStringQueryDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java index 52a3763..42459c9 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PdxStringQueryDUnitTest.java @@ -61,8 +61,13 @@ import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.persistence.query.CloseableIterator; import com.gemstone.gemfire.pdx.internal.PdxString; +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.Invoke; +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.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; @@ -129,7 +134,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{ try { localQueryService = getCache().getQueryService(); } catch (Exception e) { - fail("Failed to get QueryService.", e); + Assert.fail("Failed to get QueryService.", e); } Index index = null; // create an index on statusIndexed is created @@ -165,7 +170,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{ final int port1 = server1.invokeInt(PdxStringQueryDUnitTest.class, "getCacheServerPort"); final int port2 = server2.invokeInt(PdxStringQueryDUnitTest.class, "getCacheServerPort"); - final String host0 = getServerHostName(server0.getHost()); + final String host0 = NetworkUtils.getServerHostName(server0.getHost()); // Create client pool. final String poolName = "testClientServerQueryPool"; @@ -178,7 +183,7 @@ public class PdxStringQueryDUnitTest extends CacheTestCase{ factory.setScope(Scope.LOCAL); ClientServerTestCase.configureConnectionPool(factory, host0, port1,-1, true, -1, -1, null); Region region = createRegion(regionName, rootRegionName, factory.create()); - getLogWriter().info("Put PortfolioPdx"); + LogWriterUtils.getLogWriter().info("Put PortfolioPdx"); for (int i=0; i select * from /"+repRegionName+" where ID = 1").execute(); @@ -175,7 +182,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { @Override public void run2() throws CacheException { QueryService qs = CacheFactory.getAnyInstance().getQueryService(); - while (!hooked){pause(100);} + while (!hooked){Wait.pause(100);} Object rs = null; try { rs = qs.newQuery(" select * from /"+repRegionName+" where ID = 1").execute(); @@ -197,7 +204,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { hooked = false;//Let client put go further. } }); - DistributedTestCase.join(putThread, 200, this.getLogWriter()); + ThreadUtils.join(putThread, 200); } public void testRangeIndex() { @@ -252,7 +259,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { public void run2() throws CacheException { QueryService qs = CacheFactory.getAnyInstance().getQueryService(); Position pos1 = null; - while (!hooked){pause(100);} + while (!hooked){Wait.pause(100);} try { Object rs = qs.newQuery(" select pos from /"+repRegionName+" p, p.positions.values pos where pos.secId = 'APPL' AND p.ID = 1").execute(); CacheFactory.getAnyInstance().getLogger().fine("Shobhit: "+rs); @@ -264,13 +271,13 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { } } catch (Exception e) { e.printStackTrace(); - fail("Query execution failed on server.", e); + Assert.fail("Query execution failed on server.", e); IndexManager.testHook = null; } finally { hooked = false;//Let client put go further. } while (!hooked) { - pause(100); + Wait.pause(100); } try { Object rs = qs.newQuery(" select pos from /"+repRegionName+" p, p.positions.values pos where pos.secId = 'APPL' AND p.ID = 1").execute(); @@ -292,7 +299,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { } } }); - DistributedTestCase.join(putThread, 200, this.getLogWriter()); + ThreadUtils.join(putThread, 200); } public void testRangeIndexWithIndexAndQueryFromCluaseMisMatch() { @@ -344,7 +351,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { public void run2() throws CacheException { QueryService qs = CacheFactory.getAnyInstance().getQueryService(); Position pos1 = null; - while (!hooked){pause(100);} + while (!hooked){Wait.pause(100);} try { Object rs = qs.newQuery(" select pos from /"+repRegionName+" p, p.positions.values pos where pos.secId = 'APPL' AND p.ID = 1").execute(); CacheFactory.getAnyInstance().getLogger().fine("Shobhit: "+rs); @@ -356,13 +363,13 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { } } catch (Exception e) { e.printStackTrace(); - fail("Query execution failed on server.", e); + Assert.fail("Query execution failed on server.", e); IndexManager.testHook = null; } finally { hooked = false;//Let client put go further. } while (!hooked) { - pause(100); + Wait.pause(100); } try { Object rs = qs.newQuery("select pos from /"+repRegionName+" p, p.positions.values pos where pos.secId = 'APPL' AND p.ID = 1").execute(); @@ -383,7 +390,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { } } }); - DistributedTestCase.join(putThread, 200, this.getLogWriter()); + ThreadUtils.join(putThread, 200); } public void testRangeIndexWithIndexAndQueryFromCluaseMisMatch2() { @@ -435,7 +442,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { public void run2() throws CacheException { QueryService qs = CacheFactory.getAnyInstance().getQueryService(); Position pos1 = null; - while (!hooked){pause(100);} + while (!hooked){Wait.pause(100);} try { Object rs = qs.newQuery(" select pos from /"+repRegionName+" p, p.collectionHolderMap.values coll, p.positions.values pos where pos.secId = 'APPL' AND p.ID = 1").execute(); CacheFactory.getAnyInstance().getLogger().fine("Shobhit: "+rs); @@ -447,13 +454,13 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { } } catch (Exception e) { e.printStackTrace(); - fail("Query execution failed on server.", e); + Assert.fail("Query execution failed on server.", e); IndexManager.testHook = null; } finally { hooked = false;//Let client put go further. } while (!hooked) { - pause(100); + Wait.pause(100); } try { Object rs = qs.newQuery("select pos from /"+repRegionName+" p, p.collectionHolderMap.values coll, p.positions.values pos where pos.secId = 'APPL' AND p.ID = 1").execute(); @@ -474,7 +481,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { } } }); - DistributedTestCase.join(putThread, 200, this.getLogWriter()); + ThreadUtils.join(putThread, 200); } public static void createProxyRegions() { @@ -537,7 +544,7 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { Region region = cache.getRegion(repRegionName); for (int j = from; j < to; j++) region.put(new Integer(j), portfolio[j]); - getLogWriter() + LogWriterUtils.getLogWriter() .info( "PRQueryDUnitHelper#getCacheSerializableRunnableForPRPuts: Inserted Portfolio data on Region " + regionName); @@ -551,17 +558,17 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { switch (spot) { case 9: //Before Index update and after region entry lock. hooked = true; - getLogWriter().info("QueryDataInconsistency.IndexManagerTestHook is hooked in Update Index Entry."); + LogWriterUtils.getLogWriter().info("QueryDataInconsistency.IndexManagerTestHook is hooked in Update Index Entry."); while(hooked) { - pause(100); + Wait.pause(100); } assertEquals(hooked, false); break; case 10: //Before Region update and after Index Remove call. hooked = true; - getLogWriter().info("QueryDataInconsistency.IndexManagerTestHook is hooked in Remove Index Entry."); + LogWriterUtils.getLogWriter().info("QueryDataInconsistency.IndexManagerTestHook is hooked in Remove Index Entry."); while(hooked) { - pause(100); + Wait.pause(100); } assertEquals(hooked, false); break; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java index 1ebe01d..5e9df71 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java @@ -61,12 +61,17 @@ import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.LocalRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegion; +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.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.SerializableRunnable; +import com.gemstone.gemfire.test.dunit.ThreadUtils; import com.gemstone.gemfire.test.dunit.VM; -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.util.test.TestUtil; public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { @@ -130,17 +135,17 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { public void setUp() throws Exception { super.setUp(); //Workaround for #52008 - addExpectedException("Failed to create index"); + IgnoredException.addIgnoredException("Failed to create index"); } - public void tearDown2() throws Exception { - super.tearDown2(); + @Override + protected final void postTearDownCacheTestCase() throws Exception { // Get the disk store name. GemFireCacheImpl cache = (GemFireCacheImpl)getCache(); String diskStoreName = cache.getDefaultDiskStoreName(); //reset TestHook - invokeInEveryVM(resetTestHook()); + Invoke.invokeInEveryVM(resetTestHook()); // close the cache. closeCache(); disconnectFromDS(); @@ -161,20 +166,20 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); AsyncInvocation asyInvk0 = vm0.invokeAsync(createIndexThrougXML("vm0testCreateIndexThroughXML", name, fileName)); AsyncInvocation asyInvk1 = vm1.invokeAsync(createIndexThrougXML("vm1testCreateIndexThroughXML", name, fileName)); - DistributedTestCase.join(asyInvk1, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk1, 30 * 1000); if (asyInvk1.exceptionOccurred()) { - fail("asyInvk1 failed", asyInvk1.getException()); + Assert.fail("asyInvk1 failed", asyInvk1.getException()); } - DistributedTestCase.join(asyInvk0, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk0, 30 * 1000); if (asyInvk0.exceptionOccurred()) { - fail("asyInvk0 failed", asyInvk0.getException()); + Assert.fail("asyInvk0 failed", asyInvk0.getException()); } // Check index for PR @@ -228,7 +233,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); vm0.invoke(createIndexThrougXML("vm0testCreateIndexWhileDoingGII", name, fileName)); @@ -283,7 +288,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); vm0.invoke(createIndexThrougXML("vm0testRRegionCreateIndexWhileDoingGII", repRegName, fileName)); @@ -331,7 +336,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); vm0.invoke(createIndexThrougXML("vm0testPersistentPRRegion", persistentRegName, fileName)); @@ -396,7 +401,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info("### in testCreateIndexWhileDoingGIIWithEmptyPRRegion."); + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("### in testCreateIndexWhileDoingGIIWithEmptyPRRegion."); vm0.invoke(createIndexThrougXML("vm0testGIIWithEmptyPRRegion", name, fileName)); @@ -433,14 +438,14 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); AsyncInvocation asyInvk0 = vm0.invokeAsync(createIndexThrougXML("vm0testAsyncIndexWhileDoingGII", name, fileName)); - DistributedTestCase.join(asyInvk0, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk0, 30 * 1000); if (asyInvk0.exceptionOccurred()) { - fail("asyInvk0 failed", asyInvk0.getException()); + Assert.fail("asyInvk0 failed", asyInvk0.getException()); } // LoadRegion @@ -451,16 +456,16 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { vm0.invoke(prIndexCreationCheck(name, statusIndex, 50)); - DistributedTestCase.join(asyInvk1, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk1, 30 * 1000); if (asyInvk1.exceptionOccurred()) { - fail("asyInvk1 failed", asyInvk1.getException()); + Assert.fail("asyInvk1 failed", asyInvk1.getException()); } vm1.invoke(prIndexCreationCheck(name, statusIndex, 50)); - DistributedTestCase.join(asyInvk0, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk0, 30 * 1000); if (asyInvk0.exceptionOccurred()) { - fail("asyInvk0 failed", asyInvk0.getException()); + Assert.fail("asyInvk0 failed", asyInvk0.getException()); } vm1.invoke(resetTestHook()); @@ -479,7 +484,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); vm0.invoke(createIndexThrougXML("vm0testIndexCompareQResults", name, fileName)); @@ -542,13 +547,13 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); AsyncInvocation asyInvk0 = vm0.invokeAsync(createIndexThrougXML("vm0testCreateAsyncIndexGIIAndQuery", name, fileName)); - DistributedTestCase.join(asyInvk0, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk0, 30 * 1000); if (asyInvk0.exceptionOccurred()) { - fail("asyInvk0 failed", asyInvk0.getException()); + Assert.fail("asyInvk0 failed", asyInvk0.getException()); } // LoadRegion @@ -558,13 +563,13 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { AsyncInvocation asyInvk1 = vm1.invokeAsync(createIndexThrougXML("vm1testCreateAsyncIndexGIIAndQuery", name, fileName)); - DistributedTestCase.join(asyInvk1, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk1, 30 * 1000); if (asyInvk1.exceptionOccurred()) { - fail("asyInvk1 failed", asyInvk1.getException()); + Assert.fail("asyInvk1 failed", asyInvk1.getException()); } - DistributedTestCase.join(asyInvk0, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk0, 30 * 1000); if (asyInvk0.exceptionOccurred()) { - fail("asyInvk0 failed", asyInvk0.getException()); + Assert.fail("asyInvk0 failed", asyInvk0.getException()); } vm0.invoke(prIndexCreationCheck(name, statusIndex, 50)); @@ -592,7 +597,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); vm0.invoke(createIndexThrougXML("vm0testAsyncIndexAndCompareQResults", name, fileName)); @@ -611,9 +616,9 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { vm1.invoke(setTestHook()); vm1.invoke(createIndexThrougXML("vm1testAsyncIndexAndCompareQResults", name, fileName)); - DistributedTestCase.join(asyInvk0, 30 * 1000, getLogWriter()); + ThreadUtils.join(asyInvk0, 30 * 1000); if (asyInvk0.exceptionOccurred()) { - fail("asyInvk0 failed", asyInvk0.getException()); + Assert.fail("asyInvk0 failed", asyInvk0.getException()); } vm1.invoke(prIndexCreationCheck(persistentRegName, "secIndex", 50)); @@ -635,7 +640,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { VM vm1 = host.getVM(1); final String fileName = "IndexCreation.xml"; - getLogWriter().info( + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info( "Creating index using an xml file name : " + fileName); //create index using xml vm0.invoke(createIndexThrougXML("vm0testIndexCreationForReplicatedPersistentOverFlowRegionOnRestart", persistentOverFlowRegName, fileName)); @@ -781,7 +786,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { return "Number of Indexed Bucket is less than the expected number. "+ bucketCount + ", " + index.getNumberOfIndexedBuckets(); } }; - DistributedTestCase.waitForCriterion(ev, MAX_TIME, 200, true); + Wait.waitForCriterion(ev, MAX_TIME, 200, true); return true; } @@ -882,7 +887,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { } // compare. - getLogWriter().info("Execute query : \n queryStr with index: " + s[0] + " \n queryStr without index: " + s[1]); + com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("Execute query : \n queryStr with index: " + s[0] + " \n queryStr without index: " + s[1]); ssORrs.CompareQueryResultsWithoutAndWithIndexes(sr, 1, s); } } @@ -942,7 +947,7 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { new Exception("TEST DEBUG###" + diskStoreId).printStackTrace(); if (system == null || !system.isConnected()) { // Figure out our distributed system properties - Properties p = getAllDistributedSystemProperties(getDistributedSystemProperties()); + Properties p = DistributedTestUtils.getAllDistributedSystemProperties(getDistributedSystemProperties()); system = (InternalDistributedSystem)DistributedSystem.connect(p); } return system; @@ -956,13 +961,13 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true"); cache = CacheFactory.create(system); } catch (CacheExistsException e) { - fail("the cache already exists", e); + Assert.fail("the cache already exists", e); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { - fail("Checked exception while initializing cache??", ex); + Assert.fail("Checked exception while initializing cache??", ex); } finally { System.clearProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE"); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/820cfd63/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java index 8030f09..5984576 100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryParamsAuthorizationDUnitTest.java @@ -32,6 +32,7 @@ import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.NetworkUtils; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.VM; @@ -83,7 +84,7 @@ public class QueryParamsAuthorizationDUnitTest extends CacheTestCase { @Override public Object call() throws Exception { ClientCacheFactory ccf = new ClientCacheFactory() - .addPoolServer(getServerHostName(server1.getHost()), port) + .addPoolServer(NetworkUtils.getServerHostName(server1.getHost()), port) .set("security-client-auth-init", "templates.security.UserPasswordAuthInit.create") .set("security-username", "root").set("security-password", "root");