Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 56B08200ACA for ; Thu, 9 Jun 2016 19:06:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 55542160A5E; Thu, 9 Jun 2016 17:06:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1E1FA160A5C for ; Thu, 9 Jun 2016 19:06:00 +0200 (CEST) Received: (qmail 43395 invoked by uid 500); 9 Jun 2016 17:06:00 -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 43381 invoked by uid 99); 9 Jun 2016 17:06:00 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2016 17:06:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A5FC31A0626 for ; Thu, 9 Jun 2016 17:05:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 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=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id hCKdubS1YKDT for ; Thu, 9 Jun 2016 17:05:40 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id A9A7A60CD1 for ; Thu, 9 Jun 2016 17:05:20 +0000 (UTC) Received: (qmail 39007 invoked by uid 99); 9 Jun 2016 17:05:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2016 17:05:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9E9AFE1810; Thu, 9 Jun 2016 17:05:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Thu, 09 Jun 2016 17:05:52 -0000 Message-Id: In-Reply-To: <950410947b7f4235a05149c73b1a2447@git.apache.org> References: <950410947b7f4235a05149c73b1a2447@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [35/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4 archived-at: Thu, 09 Jun 2016 17:06:03 -0000 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java index 06d0e08..8f962f7 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/DistributedTransactionDUnitTest.java @@ -16,34 +16,68 @@ */ package com.gemstone.gemfire.disttx; -import com.gemstone.gemfire.cache.*; +import static org.junit.Assert.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.CountDownLatch; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheTransactionManager; +import com.gemstone.gemfire.cache.CommitConflictException; +import com.gemstone.gemfire.cache.CommitIncompleteException; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.DiskStore; +import com.gemstone.gemfire.cache.InterestPolicy; +import com.gemstone.gemfire.cache.PartitionAttributesFactory; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionAttributes; +import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.SubscriptionAttributes; import com.gemstone.gemfire.cache.server.CacheServer; -import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.i18n.LogWriterI18n; import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.internal.cache.*; +import com.gemstone.gemfire.internal.cache.BucketRegion; +import com.gemstone.gemfire.internal.cache.CacheServerImpl; +import com.gemstone.gemfire.internal.cache.DistTXState; +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.internal.cache.RegionEntry; +import com.gemstone.gemfire.internal.cache.TXManagerImpl; +import com.gemstone.gemfire.internal.cache.TXStateInterface; +import com.gemstone.gemfire.internal.cache.TXStateProxyImpl; import com.gemstone.gemfire.internal.cache.execute.CustomerIDPartitionResolver; import com.gemstone.gemfire.internal.cache.execute.data.CustId; import com.gemstone.gemfire.internal.cache.execute.data.Customer; import com.gemstone.gemfire.internal.cache.execute.data.Order; import com.gemstone.gemfire.internal.cache.execute.data.OrderId; -import com.gemstone.gemfire.test.dunit.*; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.CountDownLatch; +import com.gemstone.gemfire.test.dunit.Assert; +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.SerializableCallable; +import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; @SuppressWarnings("deprecation") -public class DistributedTransactionDUnitTest extends CacheTestCase { - final protected String CUSTOMER_PR = "customerPRRegion"; - final protected String ORDER_PR = "orderPRRegion"; - final protected String D_REFERENCE = "distrReference"; - final protected String PERSISTENT_CUSTOMER_PR = "persistentCustomerPRRegion"; +@Category(DistributedTest.class) +public class DistributedTransactionDUnitTest extends JUnit4CacheTestCase { - final protected String CUSTOMER_RR = "customerRRRegion"; + protected final String CUSTOMER_PR = "customerPRRegion"; + protected final String ORDER_PR = "orderPRRegion"; + protected final String D_REFERENCE = "distrReference"; + protected final String PERSISTENT_CUSTOMER_PR = "persistentCustomerPRRegion"; + + protected final String CUSTOMER_RR = "customerRRRegion"; @Override public final void postSetUp() throws Exception{ @@ -84,8 +118,8 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } - public DistributedTransactionDUnitTest(String name) { - super(name); + public DistributedTransactionDUnitTest() { + super(); } public Object execute(VM vm, SerializableCallable c) { @@ -337,9 +371,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } - - - + @Test public void testTransactionalPutOnReplicatedRegion() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -409,6 +441,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testTransactionalPutOnPartitionedRegion() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -490,6 +523,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { } @SuppressWarnings("serial") + @Test public void testCommitOnPartitionedAndReplicatedRegions() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -534,6 +568,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testGetIsolated() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -578,6 +613,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testCommitAndRollback() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -616,6 +652,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { * We create 2 partitioned regions one on each server and have a third node * as accessor and fire transactional operations on it. */ + @Test public void testNonColocatedPutByPartitioning() { Host host = Host.getHost(0); VM server1 = host.getVM(0); // datastore @@ -723,6 +760,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testTransactionalKeyBasedUpdates() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -774,6 +812,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testTransactionalKeyBasedDestroys_PR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -819,6 +858,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testTransactionalKeyBasedDestroys_RR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -862,6 +902,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testTransactionalUpdates() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -918,6 +959,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testPutAllWithTransactions() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1035,6 +1077,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testRemoveAllWithTransactions() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1104,6 +1147,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testTxWithSingleDataStore() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); // datastore @@ -1179,6 +1223,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { }); } + @Test public void testMultipleOpsOnSameKeyInTx() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1478,6 +1523,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { execute(secondary, verifySecondary); } + @Test public void testBasicDistributedTX() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1513,6 +1559,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { } + @Test public void testRegionAndEntryVersionsPR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1606,6 +1653,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { } + @Test public void testRegionAndEntryVersionsRR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1699,6 +1747,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { } + @Test public void testTxWorksWithNewNodeJoining() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1847,6 +1896,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { * Start two concurrent transactions that put same entries. Make sure that * conflict is detected at the commit time. */ + @Test public void testCommitConflicts_PR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1867,6 +1917,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { * Start two concurrent transactions that put same entries. Make sure that * conflict is detected at the commit time. */ + @Test public void testCommitConflicts_RR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -1994,6 +2045,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { * transaction in a new thread that modifies same entries as in the earlier * transaction. Make sure that conflict is detected */ + @Test public void testCommitConflicts_PR_after_locks_acquired() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -2011,6 +2063,7 @@ public class DistributedTransactionDUnitTest extends CacheTestCase { * transaction in a new thread that modifies same entries as in the earlier * transaction. Make sure that conflict is detected */ + @Test public void testCommitConflicts_RR_after_locks_acquired() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); @@ -2121,7 +2174,8 @@ private class TxOps_no_conflicts extends SerializableCallable { * transaction in a new thread that modifies different entries Make sure that * there is no conflict or exception. */ -public void testCommitNoConflicts_PR() throws Exception { + @Test + public void testCommitNoConflicts_PR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); VM server2 = host.getVM(1); @@ -2136,7 +2190,8 @@ public void testCommitNoConflicts_PR() throws Exception { * transaction in a new thread that modifies different entries Make sure that * there is no conflict or exception. */ -public void testCommitNoConflicts_RR() throws Exception { + @Test + public void testCommitNoConflicts_RR() throws Exception { Host host = Host.getHost(0); VM server1 = host.getVM(0); VM server2 = host.getVM(1); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java index 38c033f..362127e 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXDUnitTest.java @@ -16,16 +16,20 @@ */ package com.gemstone.gemfire.disttx; -import com.gemstone.gemfire.internal.cache.execute.PRTransactionDUnitTest; import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; + import java.util.Properties; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.internal.cache.execute.PRTransactionDUnitTest; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; + +@Category(DistributedTest.class) public class PRDistTXDUnitTest extends PRTransactionDUnitTest { - public PRDistTXDUnitTest(String name) { - super(name); - } - @Override public Properties getDistributedSystemProperties() { Properties props = super.getDistributedSystemProperties(); @@ -33,30 +37,33 @@ public class PRDistTXDUnitTest extends PRTransactionDUnitTest { return props; } - // [DISTTX] TODO test overridden and intentionally left blank as they fail. - // Fix this - - @Override + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") + @Test public void testBasicPRTransactionRedundancy0() { } - @Override + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") + @Test public void testBasicPRTransactionRedundancy1() { } - @Override + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") + @Test public void testBasicPRTransactionRedundancy2() { } - @Override + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") + @Test public void testBasicPRTransactionNoDataRedundancy0() { } - @Override + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") + @Test public void testBasicPRTransactionNoDataRedundancy1() { } - @Override + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") + @Test public void testBasicPRTransactionNoDataRedundancy2() { } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java index 5affa6a..880606c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PRDistTXWithVersionsDUnitTest.java @@ -16,19 +16,20 @@ */ package com.gemstone.gemfire.disttx; -import com.gemstone.gemfire.internal.cache.execute.PRTransactionWithVersionsDUnitTest; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; import java.util.Properties; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.internal.cache.execute.PRTransactionWithVersionsDUnitTest; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -public class PRDistTXWithVersionsDUnitTest extends - PRTransactionWithVersionsDUnitTest { +@Category(DistributedTest.class) +public class PRDistTXWithVersionsDUnitTest extends PRTransactionWithVersionsDUnitTest { - public PRDistTXWithVersionsDUnitTest(String name) { - super(name); - } - @Override public Properties getDistributedSystemProperties() { Properties props = super.getDistributedSystemProperties(); @@ -36,30 +37,39 @@ public class PRDistTXWithVersionsDUnitTest extends return props; } - // [DISTTX] TODO test overridden and intentionally left blank as they fail. - // Fix this - + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") @Override + @Test public void testBasicPRTransactionRedundancy0() { } + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") @Override + @Test public void testBasicPRTransactionRedundancy1() { } + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") @Override + @Test public void testBasicPRTransactionRedundancy2() { } + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") @Override + @Test public void testBasicPRTransactionNoDataRedundancy0() { } + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") @Override + @Test public void testBasicPRTransactionNoDataRedundancy1() { } + @Ignore("[DISTTX] TODO test overridden and intentionally left blank as they fail.") @Override + @Test public void testBasicPRTransactionNoDataRedundancy2() { } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java index 4267292..5f28a2e 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/PersistentPartitionedRegionWithDistTXDUnitTest.java @@ -16,18 +16,22 @@ */ package com.gemstone.gemfire.disttx; -import com.gemstone.gemfire.internal.cache.partitioned.PersistentPartitionedRegionWithTransactionDUnitTest; import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; + import java.util.Properties; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.internal.cache.partitioned.PersistentPartitionedRegionWithTransactionDUnitTest; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; /** * Same tests as that of * {@link PersistentPartitionedRegionWithTransactionDUnitTest} after setting * "distributed-transactions" property to true */ -public class PersistentPartitionedRegionWithDistTXDUnitTest extends - PersistentPartitionedRegionWithTransactionDUnitTest { +@Category(DistributedTest.class) +public class PersistentPartitionedRegionWithDistTXDUnitTest extends PersistentPartitionedRegionWithTransactionDUnitTest { @Override public Properties getDistributedSystemProperties() { @@ -35,8 +39,4 @@ public class PersistentPartitionedRegionWithDistTXDUnitTest extends props.setProperty(DISTRIBUTED_TRANSACTIONS, "true"); return props; } - - public PersistentPartitionedRegionWithDistTXDUnitTest(String name) { - super(name); - } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java index ca870cc..b1b6662 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.internal; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +import static org.junit.Assert.*; + +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInput; @@ -42,7 +51,8 @@ import com.gemstone.gemfire.internal.cache.DistributedPutAllOperation.EntryVersi * * */ -public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class BackwardCompatibilitySerializationDUnitTest extends JUnit4CacheTestCase { private transient ByteArrayOutputStream baos; private transient ByteArrayInputStream bais; @@ -56,8 +66,8 @@ public class BackwardCompatibilitySerializationDUnitTest extends CacheTestCase { public TestMessage msg = new TestMessage(); - public BackwardCompatibilitySerializationDUnitTest(String name) { - super(name); + public BackwardCompatibilitySerializationDUnitTest() { + super(); } @Override http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java index b61be01..edc8f3c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/ClassNotFoundExceptionDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.internal; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +import static org.junit.Assert.*; + +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; + import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; @@ -48,19 +57,22 @@ import com.gemstone.gemfire.test.dunit.VM; /** * */ -public class ClassNotFoundExceptionDUnitTest extends CacheTestCase { +@Category(DistributedTest.class) +public class ClassNotFoundExceptionDUnitTest extends JUnit4CacheTestCase { /** * @param name */ - public ClassNotFoundExceptionDUnitTest(String name) { - super(name); + public ClassNotFoundExceptionDUnitTest() { + super(); } + @Test public void testDataSerializable() throws InterruptedException { doTest(new ObjectFactory() { public Object get() { return new ClassNotFoundDataSerializable();} }); } + @Test public void testPdx() throws InterruptedException { doTest(new ObjectFactory() { public Object get() { return new ClassNotFoundPdx(false);} }); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java index 157fe7e..68b81bf 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarClassLoaderJUnitTest.java @@ -16,19 +16,17 @@ */ package com.gemstone.gemfire.internal; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.execute.Function; -import com.gemstone.gemfire.cache.execute.FunctionContext; -import com.gemstone.gemfire.cache.execute.FunctionService; -import com.gemstone.gemfire.cache.execute.ResultSender; -import com.gemstone.gemfire.internal.cache.InternalCache; -import com.gemstone.gemfire.internal.cache.execute.FunctionContextImpl; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; -import org.junit.After; -import org.junit.Test; -import org.junit.experimental.categories.Category; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.RandomAccessFile; import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; @@ -42,39 +40,25 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.regex.Pattern; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT; -import static org.junit.Assert.*; +import org.junit.After; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.execute.Function; +import com.gemstone.gemfire.cache.execute.FunctionContext; +import com.gemstone.gemfire.cache.execute.FunctionService; +import com.gemstone.gemfire.cache.execute.ResultSender; +import com.gemstone.gemfire.internal.cache.InternalCache; +import com.gemstone.gemfire.internal.cache.execute.FunctionContextImpl; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; /** * TODO: Need to fix this testDeclarableFunctionsWithParms and testClassOnClasspath on Windows: - * - * java.io.IOException: The process cannot access the file because another process has locked a portion of the file - at java.io.FileOutputStream.writeBytes(Native Method) - at java.io.FileOutputStream.write(FileOutputStream.java:325) - at com.gemstone.gemfire.internal.JarClassLoaderJUnitTest.writeJarBytesToFile(JarClassLoaderJUnitTest.java:704) - at com.gemstone.gemfire.internal.JarClassLoaderJUnitTest.testDeclarableFunctionsWithParms(JarClassLoaderJUnitTest.java:412) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:606) - at junit.framework.TestCase.runTest(TestCase.java:176) - at junit.framework.TestCase.runBare(TestCase.java:141) - at junit.framework.TestResult$1.protect(TestResult.java:122) - at junit.framework.TestResult.runProtected(TestResult.java:142) - at junit.framework.TestResult.run(TestResult.java:125) - at junit.framework.TestCase.run(TestCase.java:129) - at junit.framework.TestSuite.runTest(TestSuite.java:255) - at junit.framework.TestSuite.run(TestSuite.java:250) - at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) - at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) - at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) */ @Category(IntegrationTest.class) public class JarClassLoaderJUnitTest { + private static final String JAR_PREFIX = "vf.gf#"; private final ClassBuilder classBuilder = new ClassBuilder(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java index 7576756..4c24a61 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/JarDeployerDUnitTest.java @@ -16,20 +16,17 @@ */ package com.gemstone.gemfire.internal; -import com.gemstone.gemfire.cache.execute.Execution; -import com.gemstone.gemfire.cache.execute.FunctionService; -import com.gemstone.gemfire.cache.execute.ResultCollector; -import com.gemstone.gemfire.cache30.CacheTestCase; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.DistributedSystemConfigProperties; -import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; -import org.junit.Test; - -import java.io.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.RandomAccessFile; import java.nio.channels.FileLock; import java.util.Arrays; import java.util.Comparator; @@ -41,20 +38,34 @@ import java.util.concurrent.CyclicBarrier; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.execute.Execution; +import com.gemstone.gemfire.cache.execute.FunctionService; +import com.gemstone.gemfire.cache.execute.ResultCollector; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.DistributedSystemConfigProperties; +import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; +import com.gemstone.gemfire.test.dunit.Assert; +import com.gemstone.gemfire.test.dunit.Host; +import com.gemstone.gemfire.test.dunit.SerializableRunnable; +import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; + /** * Unit tests for the JarDeployer class * * @since GemFire 7.0 */ -public class JarDeployerDUnitTest extends CacheTestCase { - private static final long serialVersionUID = 1L; +@Category(DistributedTest.class) +@SuppressWarnings("serial") +public class JarDeployerDUnitTest extends JUnit4CacheTestCase { + static FileLock savedFileLock = null; private final ClassBuilder classBuilder = new ClassBuilder(); - public JarDeployerDUnitTest(String name) { - super(name); - } - @Override public final void preTearDownCacheTestCase() throws Exception { JarDeployer jarDeployer = new JarDeployer(); @@ -151,7 +162,6 @@ public class JarDeployerDUnitTest extends CacheTestCase { } @Test - @SuppressWarnings("serial") public void testDeployExclusiveLock() throws IOException, ClassNotFoundException { final JarDeployer jarDeployer = new JarDeployer(); final File currentDir = new File(".").getAbsoluteFile(); @@ -208,7 +218,6 @@ public class JarDeployerDUnitTest extends CacheTestCase { } @Test - @SuppressWarnings("serial") public void testDeploySharedLock() throws IOException, ClassNotFoundException { final JarDeployer jarDeployer = new JarDeployer(); final File currentDir = new File(".").getAbsoluteFile(); @@ -273,7 +282,6 @@ public class JarDeployerDUnitTest extends CacheTestCase { } @Test - @SuppressWarnings("serial") public void testUndeploySharedLock() throws IOException, ClassNotFoundException { final JarDeployer jarDeployer = new JarDeployer(); final File currentDir = new File(".").getAbsoluteFile(); @@ -325,7 +333,6 @@ public class JarDeployerDUnitTest extends CacheTestCase { } @Test - @SuppressWarnings("serial") public void testDeployUpdateByAnotherVM() throws IOException, ClassNotFoundException { final JarDeployer jarDeployer = new JarDeployer(); final File currentDir = new File(".").getAbsoluteFile(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java index b507156..4c50ab0 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java @@ -16,8 +16,25 @@ */ package com.gemstone.gemfire.internal; -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.cache30.CacheTestCase; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.CopyOnWriteArrayList; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.DiskStoreFactory; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionFactory; +import com.gemstone.gemfire.cache.RegionShortcut; import com.gemstone.gemfire.internal.cache.DiskStoreImpl; import com.gemstone.gemfire.pdx.PdxInstance; import com.gemstone.gemfire.pdx.PdxReader; @@ -29,23 +46,15 @@ import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.LogWriterUtils; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.List; -import java.util.Properties; -import java.util.concurrent.CopyOnWriteArrayList; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +@Category(DistributedTest.class) +public class PdxDeleteFieldDUnitTest extends JUnit4CacheTestCase { -public class PdxDeleteFieldDUnitTest extends CacheTestCase{ final List filesToBeDeleted = new CopyOnWriteArrayList(); - public PdxDeleteFieldDUnitTest(String name) { - super(name); - } - + @Test public void testPdxDeleteFieldVersioning() throws Exception { final String DS_NAME = "PdxDeleteFieldDUnitTestDiskStore"; final String DS_NAME2 = "PdxDeleteFieldDUnitTestDiskStore2"; @@ -180,8 +189,10 @@ public class PdxDeleteFieldDUnitTest extends CacheTestCase{ } public static class PdxValue implements PdxSerializable { + public int value; public long fieldToDelete = -1L; + public PdxValue() {} // for deserialization public PdxValue(int v, long lv) { this.value = v; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java index f85f750..345cefb 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java @@ -16,8 +16,25 @@ */ package com.gemstone.gemfire.internal; -import com.gemstone.gemfire.cache.*; -import com.gemstone.gemfire.cache30.CacheTestCase; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.CopyOnWriteArrayList; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.DiskStoreFactory; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionFactory; +import com.gemstone.gemfire.cache.RegionShortcut; import com.gemstone.gemfire.internal.cache.DiskStoreImpl; import com.gemstone.gemfire.pdx.PdxInstance; import com.gemstone.gemfire.pdx.PdxReader; @@ -30,23 +47,15 @@ import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.LogWriterUtils; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.List; -import java.util.Properties; -import java.util.concurrent.CopyOnWriteArrayList; - -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +@Category(DistributedTest.class) +public class PdxRenameDUnitTest extends JUnit4CacheTestCase{ -public class PdxRenameDUnitTest extends CacheTestCase{ final List filesToBeDeleted = new CopyOnWriteArrayList(); - public PdxRenameDUnitTest(String name) { - super(name); - } - + @Test public void testPdxRenameVersioning() throws Exception { final String DS_NAME = "PdxRenameDUnitTestDiskStore"; final String DS_NAME2 = "PdxRenameDUnitTestDiskStore2"; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java index cb9135e..62b4adf 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java @@ -16,30 +16,29 @@ */ package com.gemstone.gemfire.internal; -import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; -import junit.framework.AssertionFailedError; -import org.junit.Test; -import org.junit.experimental.categories.Category; +import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; +import static org.junit.Assert.*; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; -import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import com.gemstone.gemfire.test.junit.categories.SecurityTest; /** * Test that DistributionConfigImpl handles SSL options correctly. - * */ -@Category(IntegrationTest.class) +@Category({ IntegrationTest.class, SecurityTest.class }) public class SSLConfigJUnitTest { - private static final Properties SSL_PROPS_MAP = new Properties(); - private static final Properties CLUSTER_SSL_PROPS_MAP = new Properties(); - private static final Properties CLUSTER_SSL_PROPS_SUBSET_MAP = new Properties(); + private static final Properties SSL_PROPS_MAP = new Properties(); + private static final Properties CLUSTER_SSL_PROPS_MAP = new Properties(); + private static final Properties CLUSTER_SSL_PROPS_SUBSET_MAP = new Properties(); private static final Properties JMX_SSL_PROPS_MAP = new Properties(); private static final Properties JMX_SSL_PROPS_SUBSET_MAP = new Properties(); private static final Properties SERVER_SSL_PROPS_MAP = new Properties(); @@ -47,7 +46,6 @@ public class SSLConfigJUnitTest { private static final Properties GATEWAY_SSL_PROPS_MAP = new Properties(); private static final Properties GATEWAY_PROPS_SUBSET_MAP = new Properties(); - static { SSL_PROPS_MAP.put("javax.net.ssl.keyStoreType", "jks"); @@ -102,8 +100,6 @@ public class SSLConfigJUnitTest { } - //----- test methods ------ - @Test public void testMCastPortWithSSL() throws Exception { Properties props = new Properties( ); @@ -113,7 +109,7 @@ public class SSLConfigJUnitTest { try { new DistributionConfigImpl( props ); } catch ( IllegalArgumentException e ) { - if (! e.toString().matches( ".*Could not set \"ssl-enabled.*" ) ) { + if (! e.toString().matches( ".*Could not set \"ssl-enabled.*" ) ) { // TODO: what if this isn't thrown at all?? Is it expected? throw new Exception( "did not get expected exception, got this instead...", e ); } } @@ -141,7 +137,7 @@ public class SSLConfigJUnitTest { } @Test - public void testConfigCopyWithSSL( ) throws Exception { + public void testConfigCopyWithSSL() throws Exception { boolean sslenabled = false; String sslprotocols = "any"; String sslciphers = "any"; @@ -330,7 +326,6 @@ public class SSLConfigJUnitTest { isEqual( config.getGatewaySSLRequireAuthentication(), gatewaySslRequireAuth ); } - @Test public void testManagerConfig() throws Exception { boolean sslenabled = false; @@ -381,7 +376,6 @@ public class SSLConfigJUnitTest { isEqual( config.getJmxManagerSSLRequireAuthentication(), jmxManagerSslRequireAuth ); } - @Test public void testCacheServerConfig() throws Exception { boolean sslenabled = false; @@ -454,7 +448,6 @@ public class SSLConfigJUnitTest { @Test public void testCustomizedClusterSslConfig() throws Exception { - boolean sslenabled = true; String sslprotocols = "SSLv1"; String sslciphers = "RSA_WITH_NOTHING"; @@ -620,7 +613,6 @@ public class SSLConfigJUnitTest { clusterSSLProperties = config.getClusterSSLProperties(); isEqual( SSL_PROPS_MAP, clusterSSLProperties ); - } @Test @@ -689,7 +681,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers); gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforCS(false)); + gemFireProps.putAll(getGfSecurityPropertiesForCS(false)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -732,7 +724,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(GATEWAY_SSL_CIPHERS, gatewaySslciphers); gemFireProps.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION, String.valueOf(gatewaySslRequireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforGateway(false)); + gemFireProps.putAll(getGfSecurityPropertiesForGateway(false)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -750,7 +742,6 @@ public class SSLConfigJUnitTest { isEqual(GATEWAY_SSL_PROPS_MAP.get(GATEWAY_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword()); isEqual(GATEWAY_SSL_PROPS_MAP.get(GATEWAY_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore()); isEqual(GATEWAY_SSL_PROPS_MAP.get(GATEWAY_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword()); - } @Test @@ -802,7 +793,6 @@ public class SSLConfigJUnitTest { isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getJmxManagerSSLTrustStorePassword()); } - @Test public void testPartialCustomizedCacheServerSslConfig() throws Exception { boolean sslenabled = false; @@ -826,7 +816,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers); gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforCS(true)); + gemFireProps.putAll(getGfSecurityPropertiesForCS(true)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -875,7 +865,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(GATEWAY_SSL_CIPHERS, gatewaySslciphers); gemFireProps.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION, String.valueOf(gatewaySslRequireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforGateway(true)); + gemFireProps.putAll(getGfSecurityPropertiesForGateway(true)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -899,11 +889,10 @@ public class SSLConfigJUnitTest { isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword()); isEqual(GATEWAY_PROPS_SUBSET_MAP.get(GATEWAY_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword()); - } @Test - public void testP2pSSLPropsOverriden_ServerPropsNotOverriden(){ + public void testP2pSSLPropsOverriden_ServerPropsNotOverriden() throws Exception { boolean sslenabled = true; String sslprotocols = "overrriden"; String sslciphers = "overrriden"; @@ -921,7 +910,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(CLUSTER_SSL_CIPHERS, sslciphers); gemFireProps.put(CLUSTER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(requireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforCS(true)); + gemFireProps.putAll(getGfSecurityPropertiesForCS(true)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -952,11 +941,10 @@ public class SSLConfigJUnitTest { isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getServerSSLKeyStorePassword()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE), config.getServerSSLTrustStore()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getServerSSLTrustStorePassword()); - } @Test - public void testP2pSSLPropsOverriden_ServerPropsOverriden(){ + public void testP2pSSLPropsOverriden_ServerPropsOverriden() throws Exception { boolean sslenabled = true; String sslprotocols = "overrriden"; String sslciphers = "overrriden"; @@ -979,7 +967,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers); gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforCS(true)); + gemFireProps.putAll(getGfSecurityPropertiesForCS(true)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -1013,7 +1001,7 @@ public class SSLConfigJUnitTest { } @Test - public void testClusterSSLPropsOverriden_GatewayPropsNotOverriden(){ + public void testClusterSSLPropsOverriden_GatewayPropsNotOverriden() throws Exception { boolean sslenabled = true; String sslprotocols = "overrriden"; String sslciphers = "overrriden"; @@ -1031,7 +1019,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(CLUSTER_SSL_CIPHERS, sslciphers); gemFireProps.put(CLUSTER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(requireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforGateway(true)); + gemFireProps.putAll(getGfSecurityPropertiesForGateway(true)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -1062,11 +1050,10 @@ public class SSLConfigJUnitTest { isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword()); - } @Test - public void testP2pSSLPropsOverriden_GatewayPropsOverriden(){ + public void testP2pSSLPropsOverriden_GatewayPropsOverridden() throws Exception { boolean sslenabled = true; String sslprotocols = "overrriden"; String sslciphers = "overrriden"; @@ -1089,7 +1076,7 @@ public class SSLConfigJUnitTest { gemFireProps.put(GATEWAY_SSL_CIPHERS, gatewayServerSslciphers); gemFireProps.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION, String.valueOf(gatewayServerSslRequireAuth)); - gemFireProps.putAll(getGfSecurityPropertiesforGateway(true)); + gemFireProps.putAll(getGfSecurityPropertiesForGateway(true)); DistributionConfigImpl config = new DistributionConfigImpl( gemFireProps ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -1115,11 +1102,10 @@ public class SSLConfigJUnitTest { isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getGatewaySSLKeyStorePassword()); isEqual(GATEWAY_PROPS_SUBSET_MAP.get(GATEWAY_SSL_TRUSTSTORE), config.getGatewaySSLTrustStore()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getGatewaySSLTrustStorePassword()); - } @Test - public void testP2pSSLPropsOverriden_JMXPropsNotOverriden(){ + public void testP2pSSLPropsOverriden_JMXPropsNotOverriden() throws Exception { boolean sslenabled = true; String sslprotocols = "overrriden"; String sslciphers = "overrriden"; @@ -1168,7 +1154,6 @@ public class SSLConfigJUnitTest { isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_KEYSTORE_PASSWORD), config.getJmxManagerSSLKeyStorePassword()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE), config.getJmxManagerSSLTrustStore()); isEqual(CLUSTER_SSL_PROPS_MAP.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD), config.getJmxManagerSSLTrustStorePassword()); - } private static Properties getGfSecurityPropertiesSSL() { @@ -1222,7 +1207,7 @@ public class SSLConfigJUnitTest { return gfSecurityProps; } - private static Properties getGfSecurityPropertiesforCS(boolean partialCSSslConfigOverride) { + private static Properties getGfSecurityPropertiesForCS(boolean partialCSSslConfigOverride) { Properties gfSecurityProps = new Properties(); Set> entrySet = CLUSTER_SSL_PROPS_MAP.entrySet(); @@ -1243,7 +1228,7 @@ public class SSLConfigJUnitTest { return gfSecurityProps; } - private static Properties getGfSecurityPropertiesforGateway(boolean partialGatewaySslConfigOverride) { + private static Properties getGfSecurityPropertiesForGateway(boolean partialGatewaySslConfigOverride) { Properties gfSecurityProps = new Properties(); Set> entrySet = CLUSTER_SSL_PROPS_MAP.entrySet(); @@ -1263,11 +1248,11 @@ public class SSLConfigJUnitTest { return gfSecurityProps; } - public void isEqual( boolean a, boolean e ) throws AssertionFailedError { - assertEquals( a, e ); + private void isEqual(boolean a, boolean e) { + assertEquals(a,e ); } - public void isEqual( Object a, Object e ) throws AssertionFailedError { + private void isEqual(Object a,Object e ) { assertEquals( a, e ); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java index 638a55b..ba87eb6 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.internal.cache; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +import static org.junit.Assert.*; + +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; + import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -65,19 +74,11 @@ import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.SerializableRunnable; import com.gemstone.gemfire.test.dunit.VM; -/** - * - */ +@Category(DistributedTest.class) public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { private static final long MAX_WAIT = 30 * 1000; - - - public BackupDUnitTest(String name) { - super(name); - } - @Override public final void preTearDownCacheTestCase() throws Exception { StringBuilder failures = new StringBuilder(); @@ -87,6 +88,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { } } + @Test public void testBackupPR() throws Throwable { Host host = Host.getHost(0); VM vm0 = host.getVM(0); @@ -155,6 +157,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { * Test of bug 42419 * @throws Throwable */ + @Test public void testBackupFromMemberWithDiskStore() throws Throwable { Host host = Host.getHost(0); VM vm0 = host.getVM(0); @@ -218,6 +221,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { * Test for bug 42419 * @throws Throwable */ + @Test public void testBackupWhileBucketIsCreated() throws Throwable { Host host = Host.getHost(0); final VM vm0 = host.getVM(0); @@ -295,6 +299,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { checkData(vm0, 0, 1, "A", "region1"); } + @Test public void testBackupWhileBucketIsMovedBackupBeforeSendDestroy() throws Throwable { Host host = Host.getHost(0); final VM vm2 = host.getVM(2); @@ -319,6 +324,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { backupWhileBucketIsMoved(observer); } + @Test public void testBackupWhileBucketIsMovedBackupAfterSendDestroy() throws Throwable { Host host = Host.getHost(0); final VM vm0 = host.getVM(0); @@ -358,6 +364,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { backupWhileBucketIsMoved(observer); } + @Test public void testBackupStatusCleanedUpAfterFailureOnOneMember() throws Throwable { IgnoredException.addIgnoredException("Uncaught exception"); IgnoredException.addIgnoredException("Stop processing"); @@ -511,6 +518,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { * data as backed up. * @throws Throwable */ + @Test public void testBackupOverflow() throws Throwable { Host host = Host.getHost(0); VM vm0 = host.getVM(0); @@ -535,6 +543,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase { } + @Test public void testBackupPRWithOfflineMembers() throws Throwable { Host host = Host.getHost(0); VM vm0 = host.getVM(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java index 4c31a38..88385f5 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33359DUnitTest.java @@ -23,6 +23,9 @@ package com.gemstone.gemfire.internal.cache; import java.util.Properties; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheException; @@ -34,20 +37,14 @@ import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.distributed.DistributedSystem; -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.VM; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -/** - * - */ -public class Bug33359DUnitTest extends DistributedTestCase { - - /** Creates a new instance of Bug33359DUnitTest */ - public Bug33359DUnitTest(String name) { - super(name); - } +@Category(DistributedTest.class) +public class Bug33359DUnitTest extends JUnit4DistributedTestCase { // TODO: reformat static Cache cache; static Properties props = new Properties(); @@ -80,7 +77,7 @@ public class Bug33359DUnitTest extends DistributedTestCase { public static void createCacheVM0(){ try{ - ds = (new Bug33359DUnitTest("temp")).getSystem(props); + ds = (new Bug33359DUnitTest()).getSystem(props); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); @@ -98,7 +95,7 @@ public class Bug33359DUnitTest extends DistributedTestCase { } //end of create cache for VM0 public static void createCacheVM1(){ try{ - ds = (new Bug33359DUnitTest("temp")).getSystem(props); + ds = (new Bug33359DUnitTest()).getSystem(props); DistributedSystem.setThreadsSocketPolicy(false); cache = CacheFactory.create(ds); @@ -128,7 +125,8 @@ public class Bug33359DUnitTest extends DistributedTestCase { //test methods - public void testClearMultiVM(){ + @Test + public void testClearMultiVM(){ Host host = Host.getHost(0); VM vm0 = host.getVM(0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java index 16443b3..742211f 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726DUnitTest.java @@ -16,8 +16,13 @@ */ package com.gemstone.gemfire.internal.cache; +import static org.junit.Assert.*; + import java.util.Properties; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheFactory; @@ -28,22 +33,19 @@ import com.gemstone.gemfire.cache.RegionEvent; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -public class Bug33726DUnitTest extends DistributedTestCase { +@Category(DistributedTest.class) +public class Bug33726DUnitTest extends JUnit4DistributedTestCase { static boolean[] flags = new boolean[2]; static Cache cache = null; static DistributedSystem ds = null; static boolean isOK = false; - - public Bug33726DUnitTest(String name){ - super(name); - } - @Override public final void preTearDown() throws Exception { Host host = Host.getHost(0); @@ -63,6 +65,7 @@ public class Bug33726DUnitTest extends DistributedTestCase { } } + @Test public void testAfterRegionCreate() { Host host = Host.getHost(0); VM vm0 = host.getVM(0); @@ -76,7 +79,7 @@ public class Bug33726DUnitTest extends DistributedTestCase { public static void createCacheAndPopulateRegion1() { try { - ds = (new Bug33726DUnitTest("temp")).getSystem(new Properties()); + ds = (new Bug33726DUnitTest()).getSystem(new Properties()); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.GLOBAL); @@ -97,7 +100,7 @@ public class Bug33726DUnitTest extends DistributedTestCase { public static void createCacheAndRegion2() { try { - ds = (new Bug33726DUnitTest("temp")).getSystem(new Properties()); + ds = (new Bug33726DUnitTest()).getSystem(new Properties()); cache = CacheFactory.create(ds); AttributesFactory factory = new AttributesFactory(); factory.setCacheListener(new TestCacheListener()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java index 4eea76d..cbc5e4c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34179TooManyFilesOpenJUnitTest.java @@ -14,25 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.fail; - import java.io.File; import java.util.Arrays; -import org.junit.After; -import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; -import static org.junit.Assert.*; - import com.gemstone.gemfire.LogWriter; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; - /** * Disk region perf test for Persist only with Async writes and Buffer. * Set Rolling oplog to true and setMaxOplogSize to 10240 @@ -43,25 +36,25 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest; * The disk properties will ensure that very many oplog files are created. * * This test is currently not being executed and is marked with an underscore - * */ @Category(IntegrationTest.class) -public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase -{ +public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase { - LogWriter log = null; + private static int ENTRY_SIZE = 1024; + + private static int OP_COUNT = 100000; - DiskRegionProperties diskProps = new DiskRegionProperties(); + private LogWriter log = null; + + private DiskRegionProperties diskProps = new DiskRegionProperties(); - @Before - public void setUp() throws Exception - { - super.setUp(); + @Override + protected final void postSetUp() throws Exception { File file1 = new File("testingDirectory/" + getName()+ "1"); file1.mkdir(); file1.deleteOnExit(); - dirs = new File[1]; - dirs[0] = file1; + dirs = new File[1]; + dirs[0] = file1; diskProps.setDiskDirs(dirs); diskProps.setPersistBackup(true); @@ -75,43 +68,24 @@ public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase log = ds.getLogWriter(); } - @After - public void tearDown() throws Exception - { - super.tearDown(); - - } - - - private static int ENTRY_SIZE = 1024; - - private static int OP_COUNT = 100000; - /** * currently not being executed for congo but after transition to JDK 1.5, this test should be executed. - * */ - public void _testPopulate1kbwrites() - { - try { - final byte[] value = new byte[ENTRY_SIZE]; - Arrays.fill(value, (byte)77); - for (int i = 0; i < OP_COUNT; i++) { - region.put(new Integer(i), value); - } - closeDown(); // closes disk file which will flush all buffers - } - catch (Exception ex) { - fail("IOException occured due to " + ex); + @Ignore("TODO: test is disabled") + @Test + public void testPopulate1kbwrites() { + final byte[] value = new byte[ENTRY_SIZE]; + Arrays.fill(value, (byte)77); + for (int i = 0; i < OP_COUNT; i++) { + region.put(new Integer(i), value); } - + closeDown(); // closes disk file which will flush all buffers } + /** * cleans all the directory of all the files present in them - * */ - protected static void deleteFiles() - { + protected static void deleteFiles() { for (int i = 0; i < dirs.length; i++) { File[] files = dirs[i].listFiles(); for (int j = 0; j < files.length; j++) { @@ -120,11 +94,4 @@ public class Bug34179TooManyFilesOpenJUnitTest extends DiskRegionTestingBase } } - @Test - public void testDoNothing(){ - //dummy method to ensure at least one test is present in this file if the other tests are commented - } - - }// end of Bug34179TooManyFilesOpenJUnitTest - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java index 1b4ca3b..0eda7ba 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37241DUnitTest.java @@ -17,8 +17,14 @@ package com.gemstone.gemfire.internal.cache; +import static org.junit.Assert.*; + import java.io.File; -import java.util.*; +import java.util.Arrays; +import java.util.Properties; + +import org.junit.Test; +import org.junit.experimental.categories.Category; import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; @@ -29,18 +35,19 @@ import com.gemstone.gemfire.cache.RegionAttributes; import com.gemstone.gemfire.cache.Scope; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.internal.ReplyException; -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.VM; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; -/* +/** * Confirms the bug 37241 is fixed. * CleanupFailedInitialization on should also clean disk files created */ +@Category(DistributedTest.class) +public class Bug37241DUnitTest extends JUnit4DistributedTestCase { -public class Bug37241DUnitTest extends DistributedTestCase -{ private static Cache cache = null; static VM server1 = null; @@ -52,11 +59,6 @@ public class Bug37241DUnitTest extends DistributedTestCase static final String expectedReplyException = ReplyException.class.getName(); static final String expectedException = IllegalStateException.class.getName(); - /* Constructor */ - - public Bug37241DUnitTest(String name) { - super(name); - } @Override public final void postSetUp() throws Exception { @@ -71,6 +73,7 @@ public class Bug37241DUnitTest extends DistributedTestCase * 3.Region creation should fail . Check for all files created in the directory for server 2 * gets deleted. */ + @Test public void testBug37241ForNewDiskRegion() { server1.invoke(() -> Bug37241DUnitTest.createRegionOnServer1()); @@ -84,6 +87,7 @@ public class Bug37241DUnitTest extends DistributedTestCase } } + @Test public void testBug37241ForRecreatedDiskRegion() { server1.invoke(() -> Bug37241DUnitTest.createRegionOnServer1()); @@ -110,7 +114,7 @@ public class Bug37241DUnitTest extends DistributedTestCase public static void createRegionOnServer1() throws Exception { - new Bug37241DUnitTest("temp").createCache(new Properties()); + new Bug37241DUnitTest().createCache(new Properties()); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.GLOBAL); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); @@ -133,7 +137,7 @@ public class Bug37241DUnitTest extends DistributedTestCase public static void createRegionOnServer2(Scope scope) throws Exception { - new Bug37241DUnitTest("temp").createCache(new Properties()); + new Bug37241DUnitTest().createCache(new Properties()); AttributesFactory factory = new AttributesFactory(); factory.setScope(scope); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java index f5c1d81..0531100 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37377DUnitTest.java @@ -16,6 +16,15 @@ */ package com.gemstone.gemfire.internal.cache; +import org.junit.experimental.categories.Category; +import org.junit.Test; + +import static org.junit.Assert.*; + +import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; +import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase; +import com.gemstone.gemfire.test.junit.categories.DistributedTest; + import java.io.File; import java.util.Properties; @@ -48,7 +57,8 @@ import com.gemstone.gemfire.test.dunit.Wait; * */ -public class Bug37377DUnitTest extends CacheTestCase +@Category(DistributedTest.class) +public class Bug37377DUnitTest extends JUnit4CacheTestCase { protected static String regionName = "TestRegion"; @@ -67,17 +77,12 @@ public class Bug37377DUnitTest extends CacheTestCase private static final int maxEntries = 10000; - /** - * Constructor - * - * @param name - */ - public Bug37377DUnitTest(String name) { - super(name); - File file1 = new File(name + "1"); + public Bug37377DUnitTest() { + super(); + File file1 = new File(getTestMethodName() + "1"); file1.mkdir(); file1.deleteOnExit(); - File file2 = new File(name + "2"); + File file2 = new File(getTestMethodName() + "2"); file2.mkdir(); file2.deleteOnExit(); dirs = new File[2]; @@ -112,7 +117,7 @@ public class Bug37377DUnitTest extends CacheTestCase { try { - distributedSystem = (new Bug37377DUnitTest("vm0_diskReg")) + distributedSystem = (new Bug37377DUnitTest()) .getSystem(props); assertTrue(distributedSystem != null); cache = CacheFactory.create(distributedSystem); @@ -149,7 +154,7 @@ public class Bug37377DUnitTest extends CacheTestCase public void run2() { try { - distributedSystem = (new Bug37377DUnitTest("vm1_diskReg")) + distributedSystem = (new Bug37377DUnitTest()) .getSystem(props); assertTrue(distributedSystem != null); cache = CacheFactory.create(distributedSystem); @@ -303,6 +308,7 @@ public class Bug37377DUnitTest extends CacheTestCase * */ + @Test public void testGIIputWithClear() { vm0.invoke(createCacheForVM0());