You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/06/07 20:55:05 UTC
[50/62] [abbrv] incubator-geode git commit: Merge remote-tracking
branch 'origin/develop' into feature/GEODE-837
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
index 66c1a0e,2235ca2..4c42a36
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAClearDUnitTest.java
@@@ -16,23 -16,7 +16,24 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@@ -83,10 -70,10 +84,6 @@@ public class HAClearDUnitTest extends J
static boolean gotDestroyRegionCallback = false;
- public HAClearDUnitTest() {
- super();
- public HAClearDUnitTest(String name) {
- super(name);
-- }
--
@Override
public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
@@@ -113,7 -100,7 +110,8 @@@
closeCache();
}
-- /* The test perorms following operations
++ /**
++ * The test perorms following operations
* 1. Create 2 servers and 3 client
* 2. Perform put operations for knows set of keys directy from the client1.
* 3. Perform clear operation from client1
@@@ -185,7 -171,7 +183,8 @@@
server2.invoke(checkSizeRegion(regionSize));
}
-- /* The test perorms following operations
++ /**
++ * The test performs following operations
* 1. Create 2 servers and 3 clients
* 2. Perform put operations for known set of keys directy from the server1.
* 3. Perform clear operation from server1
@@@ -275,7 -260,7 +274,8 @@@
}
-- /* The test perorms following operations
++ /**
++ * The test performs following operations
* 1. Create 2 servers and 3 client
* 2. Perform put operations for knows set of keys directy from the client1.
* 3. Perform destroyRegion operation from client1
@@@ -350,7 -334,7 +350,8 @@@
}
-- /* The test perorms following operations
++ /**
++ * The test performs following operations
* 1. Create 2 servers and 3 clients
* 2. Perform put operations for known set of keys directy from the server1.
* 3. Perform destroyRegion operation from server1
@@@ -605,9 -588,9 +606,9 @@@
boolean isListenerAttached = listenerAttached.booleanValue();
boolean isRegisterInterest = registerInterest.booleanValue();
Properties props = new Properties();
- props.setProperty("mcast-port", "0");
- props.setProperty("locators", "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new HAClearDUnitTest("temp").createCache(props);
+ new HAClearDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
ClientServerTestCase.configureConnectionPool(factory, hostName, new int[] {PORT1,PORT2}, true, -1, 2, null);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
index e3f431a,33b84d9..dca557c
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAConflationDUnitTest.java
@@@ -16,42 -16,20 +16,37 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
- import org.junit.experimental.categories.Category;
- import org.junit.Test;
-
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+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.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;
- import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
- import com.gemstone.gemfire.cache30.ClientServerTestCase;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
--import com.gemstone.gemfire.cache30.CacheTestCase;
+ import com.gemstone.gemfire.cache30.ClientServerTestCase;
import com.gemstone.gemfire.distributed.DistributedSystem;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.cache.CacheServerImpl;
import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
++import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
++import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
* This is Targetted conflation Dunit test.
@@@ -64,13 -42,12 +59,9 @@@
* 3) Do create , then update, update, invalidate. The client should receive 3 callbacks, one for create one for the last update
* and one for the invalidate.
* 4) Do a create , update , update & destroy. The client should receive 3 callbacks ( craete , conflated update & destroy).
-- *
-- *
*/
--
-public class HAConflationDUnitTest extends CacheTestCase
-{
+@Category(DistributedTest.class)
- public class HAConflationDUnitTest extends JUnit4CacheTestCase
- {
++public class HAConflationDUnitTest extends JUnit4CacheTestCase {
VM server1 = null;
@@@ -78,19 -55,19 +69,19 @@@
private static final String regionName = "HAConflationDUnitTest_region";
-- final static String KEY1 = "KEY1";
++ static final String KEY1 = "KEY1";
-- final static String KEY2 = "KEY2";
++ static final String KEY2 = "KEY2";
-- final static String KEY3 = "KEY3";
++ static final String KEY3 = "KEY3";
-- final static String VALUE1 = "VALUE1";
++ static final String VALUE1 = "VALUE1";
-- final static String VALUE2 = "VALUE2";
++ static final String VALUE2 = "VALUE2";
-- final static String VALUE3 = "VALUE3";
++ static final String VALUE3 = "VALUE3";
-- final static String LAST_KEY = "lastkey";
++ static final String LAST_KEY = "lastkey";
static final String LAST_VALUE = "lastvalue";
@@@ -322,9 -295,9 +313,9 @@@
{
int PORT1 = port1.intValue();
Properties props = new Properties();
- props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
- props.setProperty(DistributionConfig.LOCATORS_NAME, "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new HAConflationDUnitTest("temp").createCache(props);
+ new HAConflationDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
ClientServerTestCase.configureConnectionPool(factory, host, new int[] { PORT1 }, true, -1, -1, null);
factory.setScope(Scope.DISTRIBUTED_ACK);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
index ca91b44,b6100b3..54f18cd
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HADuplicateDUnitTest.java
@@@ -16,27 -16,7 +16,28 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@@ -87,10 -72,10 +88,6 @@@ public class HADuplicateDUnitTest exten
static Map storeEvents = new HashMap();
- public HADuplicateDUnitTest() {
- super();
- public HADuplicateDUnitTest(String name) {
- super(name);
-- }
--
@Override
public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
@@@ -154,11 -138,10 +151,9 @@@
server1.invoke(() -> HADuplicateDUnitTest.reSetQRMslow());
}
--
+ @Test
public void testSample() throws Exception
{
--
IgnoredException.addIgnoredException("IOException");
IgnoredException.addIgnoredException("Connection reset");
createClientServerConfiguration();
@@@ -172,10 -155,10 +167,8 @@@
}
});
--
}
--
// function to perform put operations for the known set of keys.
private CacheSerializableRunnable putForKnownKeys()
{
@@@ -213,8 -196,8 +206,6 @@@
return stopserver;
}
--
--
// function to create 2servers and 1 clients
private void createClientServerConfiguration()
{
@@@ -270,9 -253,9 +261,9 @@@
int PORT1 = port1.intValue();
int PORT2 = port2.intValue();
Properties props = new Properties();
- props.setProperty("mcast-port", "0");
- props.setProperty("locators", "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new HADuplicateDUnitTest("temp").createCache(props);
+ new HADuplicateDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
ClientServerTestCase.configureConnectionPool(factory, hostName, new int[] {PORT1,PORT2}, true, -1, 2, null);
@@@ -295,9 -278,9 +286,10 @@@
cache.getDistributedSystem().disconnect();
}
}
--
}
++// TODO: move these classes to be inner static classes
++
// Listener class for the validation purpose
class HAValidateDuplicateListener extends CacheListenerAdapter
{
@@@ -305,7 -288,7 +297,6 @@@
{
System.out.println("After Create");
HADuplicateDUnitTest.storeEvents.put(event.getKey(), event.getNewValue());
--
}
public void afterUpdate(EntryEvent event)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
index 1084969,a5e9b41..d45e66e
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAEventIdPropagationDUnitTest.java
@@@ -16,29 -16,7 +16,30 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
- import static org.junit.Assert.*;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.client.PoolManager;
import com.gemstone.gemfire.cache.client.internal.PoolImpl;
import com.gemstone.gemfire.cache.client.internal.QueueStateImpl.SequenceIdAndExpirationObject;
@@@ -52,23 -30,25 +53,23 @@@ import com.gemstone.gemfire.internal.ca
import com.gemstone.gemfire.internal.cache.EventID;
import com.gemstone.gemfire.internal.cache.RegionEventImpl;
import com.gemstone.gemfire.internal.cache.tier.sockets.ConflationDUnitTest;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
- *
* Test to verify correct propagation of EventID from server to client
*
- * @since 5.1
+ * @since GemFire 5.1
*/
-
-public class HAEventIdPropagationDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class HAEventIdPropagationDUnitTest extends JUnit4DistributedTestCase {
/** server VM * */
VM server1 = null;
@@@ -77,7 -57,7 +78,7 @@@
VM client1 = null;
/** region name* */
-- private static final String REGION_NAME = "HAEventIdPropagationDUnitTest_Region";
++ private static final String REGION_NAME = HAEventIdPropagationDUnitTest.class.getSimpleName() + "_Region";
/** cache * */
private static Cache cache = null;
@@@ -85,11 -65,11 +86,6 @@@
/** server * */
static CacheServerImpl server = null;
-- /** test constructor * */
- public HAEventIdPropagationDUnitTest() {
- super();
- public HAEventIdPropagationDUnitTest(String name) {
- super(name);
-- }
--
/** get the hosts and the VMs * */
@Override
public final void postSetUp() throws Exception {
@@@ -169,9 -149,9 +165,9 @@@
{
int PORT1 = port1.intValue();
Properties props = new Properties();
- props.setProperty("mcast-port", "0");
- props.setProperty("locators", "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new HAEventIdPropagationDUnitTest("temp").createCache(props);
+ new HAEventIdPropagationDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
PoolImpl pi = (PoolImpl)ClientServerTestCase.configureConnectionPool(factory, hostName, new int[] {PORT1}, true, -1, 2, null);
factory.setScope(Scope.DISTRIBUTED_ACK);
@@@ -197,7 -177,7 +193,6 @@@
}
}
--
/**
* function to assert that the ThreadIdtoSequence id Map is not Null but is
* empty *
@@@ -222,7 -202,7 +217,6 @@@
LogWriterUtils.getLogWriter().info("assertThreadIdToSequenceIdMapisNotNullButEmpty: map size is " + map.size());
assertTrue(map.size() == 1);
}
--
}
/**
@@@ -313,10 -293,9 +307,8 @@@
* server 5) asserts that the ThreadIdToSequenceIdMap is not null and has one
* entry (on the client side) and returns the eventId stored in the map 6)
* verifies the equality of the two event ids
-- *
-- * @throws Exception
*/
+ @Test
public void testEventIDPropagation() throws Exception
{
try {
@@@ -374,7 -353,7 +366,6 @@@
}
}
--
client1.invoke(() -> HAEventIdPropagationDUnitTest.setReceivedOperationToFalse());
eventId1 = server1.invoke(() -> HAEventIdPropagationDUnitTest.removePUTALL_KEY1());
assertNotNull(eventId1);
@@@ -422,12 -400,12 +413,11 @@@
if (!eventId1.equals(eventId2)) {
fail("Test failed as the clear eventIds are not equal");
}
--
}
- @Ignore("TODO: test passes")
-
- public void _testEventIDPropagationForDestroyRegion() throws Exception
- {
++ @Ignore("TODO: test is disabled but passes when run")
+ @Test
+ public void testEventIDPropagationForDestroyRegion() throws Exception {
createClientServerConfiguration();
client1.invoke(() -> HAEventIdPropagationDUnitTest.setReceivedOperationToFalse());
Object eventId1 = server1.invoke(() -> HAEventIdPropagationDUnitTest.destroyRegion());
@@@ -461,7 -440,7 +451,7 @@@
return eventId;
}
catch (Exception e) {
-- fail("put failed due to " + e);
++ fail("put failed due to ", e);
}
return null;
}
@@@ -480,7 -459,7 +470,7 @@@
return eventId;
}
catch (Exception e) {
-- fail("put failed due to " + e);
++ fail("put failed due to ", e);
}
return null;
}
@@@ -517,7 -496,7 +507,7 @@@
return evids;
}
catch (Exception e) {
-- fail("put failed due to " + e);
++ fail("put failed due to ", e);
}
return null;
}
@@@ -536,7 -515,7 +526,7 @@@
return eventId;
}
catch (Exception e) {
-- fail("put failed due to " + e);
++ fail("put failed due to ", e);
}
return null;
}
@@@ -555,7 -534,7 +545,7 @@@
return eventId;
}
catch (Exception e) {
-- fail("put failed due to " + e);
++ fail("put failed due to ", e);
}
return null;
}
@@@ -575,7 -554,7 +565,7 @@@
return eventId;
}
catch (Exception e) {
-- fail("put failed due to " + e);
++ fail("put failed due to ", e);
}
return null;
}
@@@ -594,7 -573,7 +584,7 @@@
return eventId;
}
catch (Exception e) {
-- fail("clear failed due to " + e);
++ fail("clear failed due to ", e);
}
return null;
}
@@@ -616,7 -595,7 +606,7 @@@
return eventId;
}
catch (Exception e) {
-- fail("Destroy failed due to " + e);
++ fail("Destroy failed due to ", e);
}
return null;
}
@@@ -639,7 -618,7 +629,7 @@@
lockObject.wait(10000);
}
catch (InterruptedException e) {
-- fail("interrupted");
++ fail("interrupted", e);
}
}
if (!receivedOperation) {
@@@ -652,14 -631,14 +642,12 @@@
/**
* Listener which sends a notification after create to waiting threads and
* also extracts teh event id storing it in a static variable
-- *
*/
-- static class HAEventIdPropagationListenerForClient extends
-- CacheListenerAdapter
-- {
++ static class HAEventIdPropagationListenerForClient extends CacheListenerAdapter {
private int putAllReceivedCount = 0;
++ @Override
public void afterCreate(EntryEvent event)
{
LogWriterUtils.getLogWriter().fine(" entered after created with " + event.getKey());
@@@ -699,6 -678,6 +687,7 @@@
}
}
++ @Override
public void afterUpdate(EntryEvent event)
{
synchronized (lockObject) {
@@@ -707,6 -686,6 +696,7 @@@
}
}
++ @Override
public void afterInvalidate(EntryEvent event)
{
synchronized (lockObject) {
@@@ -715,6 -694,6 +705,7 @@@
}
}
++ @Override
public void afterDestroy(EntryEvent event)
{
synchronized (lockObject) {
@@@ -723,6 -702,6 +714,7 @@@
}
}
++ @Override
public void afterRegionDestroy(RegionEvent event)
{
synchronized (lockObject) {
@@@ -732,6 -711,6 +724,7 @@@
}
}
++ @Override
public void afterRegionClear(RegionEvent event)
{
synchronized (lockObject) {
@@@ -745,14 -724,14 +738,12 @@@
/**
* Listener which sends a notification after create to waiting threads and
* also extracts teh event id storing it in a static variable
-- *
*/
-- static class HAEventIdPropagationListenerForServer extends
-- CacheListenerAdapter
-- {
++ static class HAEventIdPropagationListenerForServer extends CacheListenerAdapter {
private int putAllReceivedCount = 0;
++ @Override
public void afterCreate(EntryEvent event)
{
LogWriterUtils.getLogWriter().fine(" entered after created with " + event.getKey());
@@@ -799,6 -778,6 +790,7 @@@
}
}
++ @Override
public void afterUpdate(EntryEvent event)
{
eventId = ((EntryEventImpl)event).getEventId();
@@@ -809,6 -788,6 +801,7 @@@
}
}
++ @Override
public void afterInvalidate(EntryEvent event)
{
eventId = ((EntryEventImpl)event).getEventId();
@@@ -819,6 -798,6 +812,7 @@@
}
}
++ @Override
public void afterDestroy(EntryEvent event)
{
eventId = ((EntryEventImpl)event).getEventId();
@@@ -829,6 -808,6 +823,7 @@@
}
}
++ @Override
public void afterRegionDestroy(RegionEvent event)
{
LogWriterUtils.getLogWriter().info("Before Regionestroy in Server");
@@@ -841,6 -820,6 +836,7 @@@
LogWriterUtils.getLogWriter().info("After RegionDestroy in Server");
}
++ @Override
public void afterRegionClear(RegionEvent event)
{
eventId = ((RegionEventImpl)event).getEventId();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
index 746e2cc,fabe3e6..62375f9
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HAGIIDUnitTest.java
@@@ -14,28 -14,10 +14,29 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package com.gemstone.gemfire.internal.cache.ha;
- import static org.junit.Assert.*;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
++import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+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;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@@ -75,16 -102,16 +75,11 @@@ public class HAGIIDUnitTest extends JUn
private static VM server1 = null;
private static VM client0 = null;
-- private static final String REGION_NAME = "HAGIIDUnitTest_region";
++ private static final String REGION_NAME = HAGIIDUnitTest.class.getSimpleName() + "_region";
protected static GIIChecker checker = new GIIChecker();
private int PORT2;
-- /** constructor */
- public HAGIIDUnitTest() {
- super();
- public HAGIIDUnitTest(String name) {
- super(name);
-- }
--
@Override
public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
@@@ -139,9 -165,9 +134,9 @@@
int PORT1 = port1.intValue();
int PORT2 = port2.intValue();
Properties props = new Properties();
- props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
- props.setProperty(DistributionConfig.LOCATORS_NAME, "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new HAGIIDUnitTest("temp").createCache(props);
+ new HAGIIDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
ClientServerTestCase.configureConnectionPool(factory, host, new int[] {PORT1,PORT2}, true, -1, 2, null, 1000, -1, false, -1);
factory.setScope(Scope.DISTRIBUTED_ACK);
@@@ -193,6 -219,6 +188,7 @@@
Assert.fail("failed while registering keys ", ex);
}
}
++
public static void createEntries()
{
try {
@@@ -218,7 -244,7 +214,7 @@@
}
}
catch (Exception e) {
-- fail("failed while stopServer()" + e);
++ fail("failed while stopServer()", e);
}
}
@@@ -375,7 -401,7 +371,6 @@@
Wait.waitForCriterion(ev, 60 * 1000, 200, true);
// assertIndexDetailsEquals( "key-2",r.getEntry("key-2").getValue());
--
// wait until
// we have a
// dead server
@@@ -424,48 -450,4 +419,49 @@@
cache.getDistributedSystem().disconnect();
}
}
+
+ private static class GIIChecker extends CacheListenerAdapter {
+
+ private boolean gotFirst = false;
+ private boolean gotSecond = false;
+ private boolean gotThird = false;
+ private int updates = 0;
+
++ @Override
+ public void afterUpdate(EntryEvent event) {
+
+ this.updates++;
+
+ String key = (String) event.getKey();
+ String value = (String) event.getNewValue();
+
+ if (key.equals("key-1") && value.equals("value-1")) {
+ this.gotFirst = true;
+ }
+
+ if (key.equals("key-2") && value.equals("value-2")) {
+ this.gotSecond = true;
+ }
+
+ if (key.equals("key-3") && value.equals("value-3")) {
+ this.gotThird = true;
+ }
+ }
+
+ public int getUpdates() {
+ return this.updates;
+ }
+
+ public boolean gotFirst() {
+ return this.gotFirst;
+ }
+
+ public boolean gotSecond() {
+ return this.gotSecond;
+ }
+
+ public boolean gotThird() {
+ return this.gotThird;
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
index c50c28b,6cb5b47..4bbc49f
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQAddOperationJUnitTest.java
@@@ -16,28 -16,8 +16,29 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.logging.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.internal.cache.Conflatable;
import com.gemstone.gemfire.internal.cache.EventID;
@@@ -90,9 -101,14 +91,9 @@@ public class HARQAddOperationJUnitTest
/**
* Creates the cache instance for the test
- *
- * @return the cache instance
- * @throws CacheException -
- * thrown if any exception occurs in cache creation
*/
- private Cache createCache() throws CacheException
- {
+ private Cache createCache() throws CacheException {
- return new CacheFactory().set("mcast-port", "0").create();
+ return new CacheFactory().set(MCAST_PORT, "0").create();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
index fdba9bc,2843fc0..340f10b
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARQueueNewImplDUnitTest.java
@@@ -14,32 -14,13 +14,33 @@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/**
- *
- */
package com.gemstone.gemfire.internal.cache.ha;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.NetworkUtils.*;
+import static com.gemstone.gemfire.test.dunit.Wait.*;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@@ -61,28 -44,46 +62,28 @@@ import com.gemstone.gemfire.test.dunit.
* This DUnit contains various tests to ensure new implementation of ha region
* queues works as expected.
*
- * @since 5.7
+ * @since GemFire 5.7
- *
*/
-public class HARQueueNewImplDUnitTest extends DistributedTestCase {
- protected static Cache cache = null;
+public class HARQueueNewImplDUnitTest extends JUnit4DistributedTestCase {
- protected static VM serverVM0 = null;
+ private static final String regionName = HARQueueNewImplDUnitTest.class.getSimpleName();
+ private static final Map map = new HashMap();
+ private static Cache cache = null;
+ private static VM serverVM0 = null;
private static VM serverVM1 = null;
+ private static VM clientVM1 = null;
+ private static VM clientVM2 = null;
- protected static VM clientVM1 = null;
-
- protected static VM clientVM2 = null;
+ private static LogWriter logger = null;
+ private static int numOfCreates = 0;
+ private static int numOfUpdates = 0;
+ private static int numOfInvalidates = 0;
+ private static Object[] deletedValues = null;
private int PORT1;
-
private int PORT2;
- private static final String regionName = "HARQueueNewImplDUnitTest";
-
- private static final Map map = new HashMap();
-
- protected static LogWriter logger = null;
-
- protected static int numOfCreates = 0;
-
- protected static int numOfUpdates = 0;
-
- protected static int numOfInvalidates = 0;
-
- private static Object[] deletedValues = null;
-
- /**
- * @param name
- * name of the test
- */
- public HARQueueNewImplDUnitTest(String name) {
- super(name);
- }
-
/**
* Sets up the test.
*/
@@@ -187,9 -185,9 +188,9 @@@
CacheServerTestUtil.disableShufflingOfEndpoints();
Properties props = new Properties();
- props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
- props.setProperty(DistributionConfig.LOCATORS_NAME, "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new HARQueueNewImplDUnitTest("temp").createCache(props);
+ new HARQueueNewImplDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
ClientServerTestCase.configureConnectionPool(factory, host, port1
.intValue(), port2.intValue(), true, Integer.parseInt(rLevel), 2, null,
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
index 060eb9b,d98b3c7..6c027ea
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionJUnitTest.java
@@@ -16,10 -16,13 +16,11 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.internal.cache.EntryEventImpl;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.internal.cache.HARegion;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import junit.framework.Assert;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@@ -77,10 -63,25 +78,10 @@@ public class HARegionJUnitTest
}
/**
- * cache
- */
- private Cache cache = null;
-
- /**
- *
* create the cache
- *
- * @throws TimeoutException
- * @throws CacheWriterException
- * @throws GatewayException
- * @throws CacheExistsException
- * @throws RegionExistsException
*/
- private Cache createCache() throws TimeoutException, CacheWriterException,
- GatewayException, CacheExistsException,
- RegionExistsException
- {
+ private Cache createCache() throws TimeoutException, CacheWriterException, GatewayException, CacheExistsException, RegionExistsException {
- return new CacheFactory().set("mcast-port", "0").create();
+ return new CacheFactory().set(MCAST_PORT, "0").create();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
index 8fd0aa2,59bdcaa..1942c75
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HARegionQueueJUnitTest.java
@@@ -16,24 -16,7 +16,25 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
+ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CyclicBarrier;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.LogWriter;
import com.gemstone.gemfire.SystemFailure;
@@@ -90,9 -100,14 +91,9 @@@ public class HARegionQueueJUnitTest
/**
* Creates the cache instance for the test
- *
- * @return the cache instance
- * @throws CacheException -
- * thrown if any exception occurs in cache creation
*/
- private Cache createCache() throws CacheException
- {
+ private Cache createCache() throws CacheException {
- return new CacheFactory().set("mcast-port", "0").create();
+ return new CacheFactory().set(MCAST_PORT, "0").create();
}
/**
@@@ -343,11 -397,12 +344,9 @@@
protected StringBuffer message = new StringBuffer();
--// private int totalMessages = 0;
--
protected Exception exception = null;
- private synchronized int getCounter()
- {
+ private synchronized int getCounter() {
return ++counter;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
index 4ed06c9,46ad459..1f7e63c
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/HASlowReceiverDUnitTest.java
@@@ -16,23 -16,8 +16,16 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
+import static org.junit.Assert.*;
+
+import java.net.SocketException;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.LogWriter;
- import com.gemstone.gemfire.cache.AttributesFactory;
- import com.gemstone.gemfire.cache.Cache;
- import com.gemstone.gemfire.cache.CacheFactory;
- import com.gemstone.gemfire.cache.DataPolicy;
- import com.gemstone.gemfire.cache.EntryEvent;
- import com.gemstone.gemfire.cache.Region;
- import com.gemstone.gemfire.cache.RegionAttributes;
- import com.gemstone.gemfire.cache.Scope;
+ import com.gemstone.gemfire.cache.*;
import com.gemstone.gemfire.cache.client.PoolManager;
import com.gemstone.gemfire.cache.client.internal.PoolImpl;
import com.gemstone.gemfire.cache.server.CacheServer;
@@@ -43,19 -27,14 +35,20 @@@ import com.gemstone.gemfire.internal.Av
import com.gemstone.gemfire.internal.cache.ClientServerObserverAdapter;
import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder;
import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerTestUtil;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.net.SocketException;
-import java.util.Properties;
-
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
-public class HASlowReceiverDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class HASlowReceiverDUnitTest extends JUnit4DistributedTestCase {
+
protected static Cache cache = null;
private static VM serverVM1 = null;
@@@ -78,10 -57,10 +71,6 @@@
private static boolean isUnresponsiveClientRemoved = false;
- public HASlowReceiverDUnitTest() {
- super();
- public HASlowReceiverDUnitTest(String name) {
- super(name);
-- }
--
@Override
public final void postSetUp() throws Exception {
final Host host = Host.getHost(0);
@@@ -126,9 -105,9 +115,9 @@@
throws Exception {
Properties prop = new Properties();
- prop.setProperty(DistributionConfig.REMOVE_UNRESPONSIVE_CLIENT_PROP_NAME,
+ prop.setProperty(REMOVE_UNRESPONSIVE_CLIENT,
"true");
- new HASlowReceiverDUnitTest("temp").createCache(prop);
+ new HASlowReceiverDUnitTest().createCache(prop);
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.DISTRIBUTED_ACK);
@@@ -156,9 -135,9 +145,9 @@@
CacheServerTestUtil.disableShufflingOfEndpoints();
Properties props = new Properties();
- props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
- props.setProperty(DistributionConfig.LOCATORS_NAME, "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new HASlowReceiverDUnitTest("temp").createCache(props);
+ new HASlowReceiverDUnitTest().createCache(props);
AttributesFactory factory = new AttributesFactory();
PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer("localhost",
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
index d1f757f,eb86bd6..971ced1
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/OperationsPropagationDUnitTest.java
@@@ -16,78 -16,65 +16,54 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache30.ClientServerTestCase;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+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;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache30.ClientServerTestCase;
+import com.gemstone.gemfire.distributed.DistributedSystem;
- import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
- *
* This test verifies that all entry operations (create,put,destroy,invalidate)
* which propagate from one server1 to another server2 do get delivered to the
* client connected to server2 (server2 is primary for client)
- *
*/
+@Category(DistributedTest.class)
+public class OperationsPropagationDUnitTest extends JUnit4DistributedTestCase {
-public class OperationsPropagationDUnitTest extends DistributedTestCase
-{
-
-- /**
-- * Server1
-- */
VM server1 = null;
--
-- /**
-- * Server2
-- */
VM server2 = null;
--
-- /**
-- * Client
-- */
VM client1 = null;
-- /**
-- * Port of server1
-- */
public int PORT1;
--
-- /**
-- * Port of server2
-- */
public int PORT2;
-- /**
-- * Name of the region
-- */
-- private static final String REGION_NAME = "OperationsPropagationDUnitTest_Region";
++ private static final String REGION_NAME = OperationsPropagationDUnitTest.class.getSimpleName() + "_Region";
-- /**
-- * cache
-- */
private static Cache cache = null;
/**
@@@ -123,7 -119,7 +99,6 @@@
/**
* closes the cache and disconnects the vm from teh distributed system
-- *
*/
public static void closeCache()
{
@@@ -135,9 -131,9 +110,6 @@@
/**
* connect to the DS and create a cache
-- *
-- * @param props
-- * @throws Exception
*/
private void createCache(Properties props) throws Exception
{
@@@ -156,9 -152,9 +128,6 @@@
/**
* Create the server
-- *
-- * @return
-- * @throws Exception
*/
public static Integer createServerCache() throws Exception
{
@@@ -176,22 -172,22 +145,18 @@@
server.setNotifyBySubscription(true);
server.start();
return new Integer(server.getPort());
--
}
/**
* create the client and connect it to the server with the given port
-- *
-- * @param port2
-- * @throws Exception
*/
public static void createClientCache(String host, Integer port2) throws Exception
{
int PORT2 = port2.intValue();
Properties props = new Properties();
- props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
- props.setProperty(DistributionConfig.LOCATORS_NAME, "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new OperationsPropagationDUnitTest("temp").createCache(props);
+ new OperationsPropagationDUnitTest().createCache(props);
props.setProperty("retryAttempts", "2");
props.setProperty("endpoints", "ep1="+host+":" + PORT2);
props.setProperty("redundancyLevel", "-1");
@@@ -209,7 -205,7 +174,6 @@@
region = cache.createRegion(REGION_NAME, attrs);
assertNotNull(region);
region.registerInterest("ALL_KEYS");
--
}
public static final String CREATE_KEY = "createKey";
@@@ -239,16 -235,15 +203,18 @@@
public static final String PUTALL_VALUE2 = "putAllValue2";
/**
-- * This test: 1) First the initial keys and values 2) Verify that the initial
-- * keys and values have reached the client 3) Do the operations which we want
-- * to propagate (create, update, invalidate and destroy) 4) Verify the
++ * This test:
++ * 1) First the initial keys and values
++ * 2) Verify that the initial
++ * keys and values have reached the client
++ * 3) Do the operations which we want
++ * to propagate (create, update, invalidate and destroy)
++ * 4) Verify the
* operations reached the client
* 5) Do a removeAll
* 6) Verify it reached the client
-- *
-- * @throws Exception
*/
+ @Test
public void testOperationsPropagation() throws Exception
{
server1.invoke(() -> OperationsPropagationDUnitTest.initialPutKeyValue());
@@@ -261,7 -256,7 +227,6 @@@
/**
* put the initial keys and values
-- *
*/
public static void initialPutKeyValue()
{
@@@ -273,12 -268,12 +238,10 @@@
catch (Exception e) {
Assert.fail(" Test failed due to " + e, e);
}
--
}
/**
* do the operations which you want to propagate
-- *
*/
public static void doOperations()
{
@@@ -295,12 -290,12 +258,10 @@@
catch (Exception e) {
Assert.fail(" Test failed due to " + e, e);
}
--
}
/**
* assert the initial key values are present
-- *
*/
public static void assertKeyValuePresent()
{
@@@ -317,11 -312,11 +278,6 @@@
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-- /*
-- * if (!(region.get(UPDATE_KEY).equals(UPDATE_VALUE1))) { fail(" Expected
-- * value to be " + UPDATE_VALUE1 + " but it is " +
-- * region.get(UPDATE_KEY)); }
-- */
wc = new WaitCriterion() {
String excuse;
public boolean done() {
@@@ -334,11 -329,11 +290,6 @@@
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-- /*
-- * if (!(region.get(INVALIDATE_KEY).equals(INVALIDATE_VALUE))) { fail("
-- * Expected value to be " + INVALIDATE_VALUE + " but it is " +
-- * region.get(INVALIDATE_KEY)); }
-- */
wc = new WaitCriterion() {
String excuse;
public boolean done() {
@@@ -350,27 -345,27 +301,17 @@@
}
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
--
-- /*
-- * if (!(region.get(DESTROY_KEY).equals(DESTROY_VALUE))) { fail(" Expected
-- * value to be " + DESTROY_VALUE + " but it is " +
-- * region.get(DESTROY_KEY)); }
-- */
--
}
catch (Exception e) {
Assert.fail(" Test failed due to " + e, e);
}
--
}
/**
* assert the operations reached the client successfully
-- *
*/
public static void assertOperationsSucceeded()
{
--
try {
//Thread.sleep(5000);
WaitCriterion wc = new WaitCriterion() {
@@@ -385,10 -380,10 +326,6 @@@
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-- /*if (!(region.get(CREATE_KEY).equals(CREATE_VALUE))) {
-- fail("CREATE operation did not propagate to client : Expected value to be "
-- + CREATE_VALUE + " but it is " + region.get(CREATE_KEY));
-- }*/
wc = new WaitCriterion() {
String excuse;
public boolean done() {
@@@ -401,10 -396,10 +338,6 @@@
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-- /*if (!(region.get(UPDATE_KEY).equals(UPDATE_VALUE2))) {
-- fail(" UPDATE operation did not propagate to Client : Expected value to be "
-- + UPDATE_VALUE2 + " but it is " + region.get(UPDATE_KEY));
-- }*/
wc = new WaitCriterion() {
String excuse;
public boolean done() {
@@@ -417,10 -412,10 +350,6 @@@
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-- /*if (region.containsKey(DESTROY_KEY)) {
-- fail(" DESTROY operation did not propagate to Client : Expected "
-- + DESTROY_KEY + " not to be present but it is ");
-- }*/
wc = new WaitCriterion() {
String excuse;
public boolean done() {
@@@ -433,10 -428,10 +362,6 @@@
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-- /*if (!(region.get(INVALIDATE_KEY) == null)) {
-- fail(" INVALIDATE operation did not propagate to Client : Expected value to be null but it is "
-- + region.get(INVALIDATE_KEY));
-- }*/
wc = new WaitCriterion() {
String excuse;
public boolean done() {
@@@ -449,11 -444,11 +374,6 @@@
};
Wait.waitForCriterion(wc, 60 * 1000, 1000, true);
-- /*
-- * if (!(region.get(PUTALL_KEY).equals(PUTALL_VALUE))) { fail("PUTALL
-- * operation did not propagate to client : Expected value to be " +
-- * PUTALL_VALUE + " but it is " + region.get(PUTALL_KEY)); }
-- */
wc = new WaitCriterion() {
String excuse;
public boolean done() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
index b52be46,4cb1849..9868c73
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/PutAllDUnitTest.java
@@@ -16,27 -16,7 +16,28 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+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;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.client.internal.PoolImpl;
import com.gemstone.gemfire.cache.client.internal.QueueStateImpl.SequenceIdAndExpirationObject;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
@@@ -47,20 -27,26 +48,20 @@@ import com.gemstone.gemfire.internal.Av
import com.gemstone.gemfire.internal.cache.CacheServerImpl;
import com.gemstone.gemfire.internal.cache.EntryEventImpl;
import com.gemstone.gemfire.internal.cache.EventID;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
/**
- *
* Test to verify correct propagation of operations eventID's for put all
*
- * @since 5.1
- *
+ * @since GemFire 5.1
*/
-
-public class PutAllDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class PutAllDUnitTest extends JUnit4DistributedTestCase {
/** server1 VM **/
VM server1 = null;
@@@ -181,9 -167,9 +182,9 @@@
{
int PORT1 = port1.intValue();
Properties props = new Properties();
- props.setProperty("mcast-port", "0");
- props.setProperty("locators", "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new PutAllDUnitTest("temp").createCache(props);
+ new PutAllDUnitTest().createCache(props);
props.setProperty("retryAttempts", "2");
props.setProperty("endpoints", "ep1="+host+":" + PORT1);
props.setProperty("redundancyLevel", "-1");
@@@ -212,9 -198,9 +213,9 @@@
{
int PORT1 = port1.intValue();
Properties props = new Properties();
- props.setProperty("mcast-port", "0");
- props.setProperty("locators", "");
+ props.setProperty(MCAST_PORT, "0");
+ props.setProperty(LOCATORS, "");
- new PutAllDUnitTest("temp").createCache(props);
+ new PutAllDUnitTest().createCache(props);
props.setProperty("retryAttempts", "2");
props.setProperty("endpoints", "ep1="+host+":" + PORT1);
props.setProperty("redundancyLevel", "-1");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
index 04f110b,0a66e5e..b7bb6c1
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/StatsBugDUnitTest.java
@@@ -16,22 -16,7 +16,23 @@@
*/
package com.gemstone.gemfire.internal.cache.ha;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.Ignore;
+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;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.client.internal.PoolImpl;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.cache30.ClientServerTestCase;
@@@ -78,7 -68,7 +79,7 @@@ public class StatsBugDUnitTest extends
private static int PORT2;
/** name of the test region */
-- private static final String REGION_NAME = "StatsBugDUnitTest_Region";
++ private static final String REGION_NAME = StatsBugDUnitTest.class.getSimpleName() + "_Region";
/** brige-writer instance( used to get connection proxy handle) */
private static PoolImpl pool = null;
@@@ -95,16 -85,22 +96,6 @@@
/** prefix added to the keys of events generated on secondary */
private static final String secondaryPrefix = "secondary_";
- public StatsBugDUnitTest() {
- super();
- /**
- * Constructor
- *
- * @param name -
- * name for this test instance
- */
- public StatsBugDUnitTest(String name) {
- super(name);
-- }
--
-- /**
-- * Creates the primary and the secondary cache servers
-- *
-- * @throws Exception -
-- * thrown if any problem occurs in initializing the test
-- */
@Override
public final void postSetUp() throws Exception {
disconnectAllFromDS();
@@@ -138,12 -134,12 +129,6 @@@
return cache;
}
-- /**
-- * close the cache instances in server and client during tearDown
-- *
-- * @throws Exception
-- * thrown if any problem occurs in closing cache
-- */
@Override
public final void preTearDown() throws Exception {
// close client
@@@ -163,11 -159,10 +148,8 @@@
* operations from secondary<br>
* 5)Verify that the invalidates stats at the client accounts for the
* operations done by both, primary and secondary.
-- *
-- * @throws Exception -
-- * thrown if any problem occurs in test execution
*/
+ @Test
public void testBug36109() throws Exception
{
LogWriterUtils.getLogWriter().info("testBug36109 : BEGIN");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
index 7722cef,1be5f8e..d939fd4
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/locks/TXLockServiceDUnitTest.java
@@@ -16,19 -16,6 +16,21 @@@
*/
package com.gemstone.gemfire.internal.cache.locks;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
++import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.CommitConflictException;
import com.gemstone.gemfire.distributed.DistributedLockService;
import com.gemstone.gemfire.distributed.DistributedSystem;
@@@ -125,12 -105,12 +127,16 @@@ public class TXLockServiceDUnitTest ext
"destroyServices");
forEachVMInvoke("checkGetAndDestroy", new Object[] {});*/
}
--
-- public void _ttestGetAndDestroyAgain() {
++
++ @Ignore("TODO: test is disabled")
++ @Test
++ public void testGetAndDestroyAgain() {
testGetAndDestroy();
}
--
-- public void disable_testTXRecoverGrantorMessageProcessor() throws Exception {
++
++ @Ignore("TODO: test is disabled")
++ @Test
++ public void testTXRecoverGrantorMessageProcessor() throws Exception {
LogWriterUtils.getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
TXLockService.createDTLS();
checkDLockRecoverGrantorMessageProcessor();
@@@ -189,7 -169,6 +195,8 @@@
}
protected static volatile TXLockId testTXLock_TXLockId;
++
+ @Test
public void testTXLock() {
LogWriterUtils.getLogWriter().info("[testTXLock]");
final int grantorVM = 0;
@@@ -301,7 -280,6 +308,8 @@@
}
protected static volatile TXLockId testTXOriginatorRecoveryProcessor_TXLockId;
++
+ @Test
public void testTXOriginatorRecoveryProcessor() {
LogWriterUtils.getLogWriter().info("[testTXOriginatorRecoveryProcessor]");
final int originatorVM = 0;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
index 281c000,24685e4..2e596e9
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
@@@ -16,51 -16,76 +16,54 @@@
*/
package com.gemstone.gemfire.internal.cache.lru;
-import com.gemstone.gemfire.*;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
+
+import com.gemstone.gemfire.StatisticDescriptor;
+import com.gemstone.gemfire.StatisticsFactory;
+import com.gemstone.gemfire.StatisticsType;
+import com.gemstone.gemfire.StatisticsTypeFactory;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheExistsException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAlgorithm;
+import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.distributed.DistributedSystem;
import com.gemstone.gemfire.internal.StatisticsTypeFactoryImpl;
import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
import com.gemstone.gemfire.internal.cache.PlaceHolderDiskRegion;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Properties;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-/** This class tests the LRUCapacityController's core clock algorithm. */
+/**
+ * This class tests the LRUCapacityController's core clock algorithm.
+ */
@Category(IntegrationTest.class)
-public class LRUClockJUnitTest extends junit.framework.TestCase {
+public class LRUClockJUnitTest {
- private Properties sysProps;
+ private String myTestName;
+
- //static int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-
+ static Properties sysProps = new Properties();
- static {
- //sysProps.setProperty(DistributionConfig.DistributedSystemConfigProperties.MCAST_PORT, String.valueOf(unusedPort));
- // a loner is all this test needs
- sysProps.setProperty(MCAST_PORT, "0");
- sysProps.setProperty(LOCATORS, "");
- }
- public LRUClockJUnitTest( String name ) {
- super( name );
- this.myTestName = name;
- }
+ @Rule
+ public TestName testName = new TestName();
- protected LRUClockJUnitTest( String prefix, String methodName ) {
- super( methodName );
- this.myTestName = prefix + methodName;
- }
-
- /**
- * The JUnit setup method
- *
- * @exception Exception Description of the Exception
- */
@Before
public void setUp() throws Exception {
- super.setUp();
- System.out.println( "\n\n### beginning " + this.myTestName + "###" );
- }
-
- /**
- * The teardown method for JUnit
- *
- * @exception Exception Description of the Exception
- */
- @After
- public void tearDown() throws Exception {
- super.tearDown();
- System.out.println( "### finished " + this.myTestName + "###" );
+ sysProps = new Properties();
- sysProps.setProperty("mcast-port", "0");
- sysProps.setProperty("locators", "");
++ sysProps.setProperty(MCAST_PORT, "0");
++ sysProps.setProperty(LOCATORS, "");
}
- /**
- * A unit test for JUnit
- *
- * @exception Exception Description of the Exception
- */
@Test
public void testAddToClockFace() throws Exception {
NewLRUClockHand clock = getAClockHand( getARegion(), new TestEnableLRU() );
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
index 1cc8cc3,939e09a..2dd4dc3
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java
@@@ -16,20 -16,7 +16,21 @@@
*/
package com.gemstone.gemfire.internal.cache.partitioned;
-import com.gemstone.gemfire.cache.*;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@@ -50,12 -38,13 +51,12 @@@ import com.gemstone.gemfire.test.junit.
/**
* TODO This doesn't really test the optimised RI behaviour but only that RI
* works. But there must be other tests doing the same.
- *
- *
*/
+@Category(DistributedTest.class)
@SuppressWarnings("serial")
-public class Bug43684DUnitTest extends DistributedTestCase {
+public class Bug43684DUnitTest extends JUnit4DistributedTestCase {
-- private static final String REGION_NAME = "Bug43684DUnitTest";
++ private static final String REGION_NAME = Bug43684DUnitTest.class.getSimpleName();
private static GemFireCacheImpl cache;
@@@ -71,10 -60,10 +72,6 @@@
private static int numBuckets = 11;
- public Bug43684DUnitTest() {
- super();
- public Bug43684DUnitTest(String name) {
- super(name);
-- }
--
@Override
public final void postSetUp() throws Exception {
host = Host.getHost(0);
@@@ -254,14 -229,12 +251,12 @@@
@SuppressWarnings("rawtypes")
public static Integer createServerCache(Boolean isReplicated, Boolean isPrimaryEmpty) throws Exception {
- DistributedTestCase.disconnectFromDS();
+ disconnectFromDS();
Properties props = new Properties();
- props.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- // props.setProperty("log-file", "server_" + OSProcess.getId() + ".log");
- // props.setProperty("log-level", "fine");
- props.setProperty("statistic-archive-file", "server_" + OSProcess.getId()
+ props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
+ props.setProperty(STATISTIC_ARCHIVE_FILE, "server_" + OSProcess.getId()
+ ".gfs");
- props.setProperty("statistic-sampling-enabled", "true");
+ props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
CacheFactory cf = new CacheFactory(props);
cache = (GemFireCacheImpl)cf.create();
@@@ -283,13 -256,11 +278,11 @@@
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void createClientCache(Host host, Integer port) {
- DistributedTestCase.disconnectFromDS();
+ disconnectFromDS();
Properties props = new Properties();
- // props.setProperty("log-file", "client_" + OSProcess.getId() + ".log");
- // props.setProperty("log-level", "fine");
- props.setProperty("statistic-archive-file", "client_" + OSProcess.getId()
+ props.setProperty(STATISTIC_ARCHIVE_FILE, "client_" + OSProcess.getId()
+ ".gfs");
- props.setProperty("statistic-sampling-enabled", "true");
+ props.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
ClientCacheFactory ccf = new ClientCacheFactory(props);
ccf.addPoolServer(host.getHostName(), port).setPoolSubscriptionEnabled(true);
cache = (GemFireCacheImpl)ccf.create();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
index 163883b,ba24fe1..d46b0f5
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug47388DUnitTest.java
@@@ -19,19 -19,7 +19,22 @@@
*/
package com.gemstone.gemfire.internal.cache.partitioned;
-import com.gemstone.gemfire.cache.*;
++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.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
@@@ -73,7 -60,14 +75,7 @@@ public class Bug47388DUnitTest extends
private static volatile boolean lastKeyDestroyed = false;
-- public static final String REGION_NAME = "Bug47388DUnitTest_region";
-
- /**
- * @param name
- */
- public Bug47388DUnitTest(String name) {
- super(name);
- }
++ public static final String REGION_NAME = Bug47388DUnitTest.class.getSimpleName() + "_region";
@Override
public final void postSetUp() throws Exception {
@@@ -115,10 -109,10 +117,9 @@@
}
@SuppressWarnings("deprecation")
-- public static Integer createCacheServerWithPRDatastore()//Integer mcastPort)
-- throws Exception {
++ public static Integer createCacheServerWithPRDatastore() throws Exception {
Properties props = new Properties();
- Bug47388DUnitTest test = new Bug47388DUnitTest("Bug47388DUnitTest");
+ Bug47388DUnitTest test = new Bug47388DUnitTest();
DistributedSystem ds = test.getSystem(props);
ds.disconnect();
cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
@@@ -141,15 -135,15 +142,13 @@@
}
@SuppressWarnings("deprecation")
-- public static void createClientCache(Host host, Integer[] ports, Boolean doRI)
-- throws Exception {
--
++ public static void createClientCache(Host host, Integer[] ports, Boolean doRI) throws Exception {
Properties props = new Properties();
- props.setProperty(DistributionConfig.DURABLE_CLIENT_ID_NAME,
+ props.setProperty(DURABLE_CLIENT_ID,
"my-durable-client-" + ports.length);
- props.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, "300000");
+ props.setProperty(DURABLE_CLIENT_TIMEOUT, "300000");
- DistributedSystem ds = new Bug47388DUnitTest("Bug47388DUnitTest").getSystem(props);
+ DistributedSystem ds = new Bug47388DUnitTest().getSystem(props);
ds.disconnect();
ClientCacheFactory ccf = new ClientCacheFactory(props);
ccf.setPoolSubscriptionEnabled(doRI);
@@@ -180,12 -174,12 +179,10 @@@
region.registerInterest("ALL_KEYS", true);
cache.readyForEvents();
}
--
}
@SuppressWarnings("unchecked")
-- public static void doPuts(Integer numOfSets, Integer numOfPuts)
-- throws Exception {
++ public static void doPuts(Integer numOfSets, Integer numOfPuts) throws Exception {
Region<String, String> region = cache.getRegion(REGION_NAME);
for (int i = 0; i < numOfSets; i++) {
@@@ -201,8 -195,8 +198,7 @@@
.getClientProxies().toArray()[0]).isPrimary();
}
-- public static void verifyClientSubscriptionStats(final Boolean isPrimary,
-- final Integer events) throws Exception {
++ public static void verifyClientSubscriptionStats(final Boolean isPrimary, final Integer events) throws Exception {
WaitCriterion wc = new WaitCriterion() {
private long dispatched;
@@@ -260,7 -254,7 +256,9 @@@
Wait.waitForCriterion(wc, 60 * 1000, 500, true);
}
-- public void bug51931_testQRMOfExpiredEventsProcessedSuccessfully() throws Exception {
++ @Ignore("TODO: test is disabled due to bug51931")
++ @Test
++ public void testQRMOfExpiredEventsProcessedSuccessfully() throws Exception {
int numOfSets = 2, numOfPuts = 5;
int totalEvents = 23; // = (numOfSets * numOfPuts) * 2 [eviction-destroys] +
// 2 [last key's put and eviction-destroy] + 1 [marker
@@@ -275,9 -269,8 +273,4 @@@
vm0.invoke(() -> Bug47388DUnitTest.verifyClientSubscriptionStats( isvm0Primary, totalEvents ));
vm1.invoke(() -> Bug47388DUnitTest.verifyClientSubscriptionStats( !isvm0Primary, totalEvents ));
}
- @Test
-- public void testNothingBecauseOfBug51931() {
-- // remove this when bug #51931 is fixed
-- }
--
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
index 7aa6039,9193719..d7366eb
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java
@@@ -19,13 -19,6 +19,14 @@@
*/
package com.gemstone.gemfire.internal.cache.partitioned;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.cache.CacheFactory;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionFactory;
@@@ -89,14 -90,9 +90,9 @@@ public class Bug51400DUnitTest extends
public static Integer createServerCache(Integer mcastPort,
Integer maxMessageCount) throws Exception {
Properties props = new Properties();
- props.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]");
- // props.setProperty("log-file", "server_" + OSProcess.getId() + ".log");
- // props.setProperty("log-level", "fine");
- // props.setProperty("statistic-archive-file", "server_" + OSProcess.getId()
- // + ".gfs");
- // props.setProperty("statistic-sampling-enabled", "true");
+ props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
- Bug51400DUnitTest test = new Bug51400DUnitTest("Bug51400DUnitTest");
+ Bug51400DUnitTest test = new Bug51400DUnitTest();
DistributedSystem ds = test.getSystem(props);
ds.disconnect();
cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
@@@ -119,16 -115,8 +115,8 @@@
public static void createClientCache(String hostName, Integer[] ports,
Integer interval) throws Exception {
Properties props = new Properties();
- // props.setProperty(DistributionConfig.DURABLE_CLIENT_ID_NAME,
- // "my-durable-client-" + ports.length);
- // props.setProperty(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, "300000");
- // props.setProperty("log-file", "client_" + OSProcess.getId() + ".log");
- // props.setProperty("log-level", "fine");
- // props.setProperty("statistic-archive-file", "client_" + OSProcess.getId()
- // + ".gfs");
- // props.setProperty("statistic-sampling-enabled", "true");
- DistributedSystem ds = new Bug51400DUnitTest("Bug51400DUnitTest").getSystem(props);
+ DistributedSystem ds = new Bug51400DUnitTest().getSystem(props);
ds.disconnect();
ClientCacheFactory ccf = new ClientCacheFactory(props);
ccf.setPoolSubscriptionEnabled(true);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
index 5f24f0b,e6a765b..ef63848
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PersistentPartitionedRegionDUnitTest.java
@@@ -16,48 -16,9 +16,49 @@@
*/
package com.gemstone.gemfire.internal.cache.partitioned;
++import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static com.jayway.awaitility.Awaitility.*;
+import static java.util.concurrent.TimeUnit.*;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.*;
+import static org.junit.Assert.fail;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.ConcurrentModificationException;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheClosedException;
+import com.gemstone.gemfire.cache.CustomExpiry;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskAccessException;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.PartitionedRegionStorageException;
+import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.Region.Entry;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.cache.client.PoolFactory;
import com.gemstone.gemfire.cache.client.PoolManager;
import com.gemstone.gemfire.cache.client.ServerOperationException;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bd38e10f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
----------------------------------------------------------------------
diff --cc geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
index 9c669fb,cbef135..8a1a49c
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
@@@ -47,19 -23,14 +47,20 @@@ import com.gemstone.gemfire.cache.contr
import com.gemstone.gemfire.cache.control.ResourceManager;
import com.gemstone.gemfire.cache.partition.PartitionRegionHelper;
import com.gemstone.gemfire.distributed.DistributedSystem;
+ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
import com.gemstone.gemfire.internal.FileUtil;
-import com.gemstone.gemfire.internal.cache.*;
-import com.gemstone.gemfire.internal.cache.execute.data.*;
+import com.gemstone.gemfire.internal.cache.FixedPartitionAttributesImpl;
+import com.gemstone.gemfire.internal.cache.HARegion;
+import com.gemstone.gemfire.internal.cache.PartitionRegionConfig;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionHelper;
+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.internal.cache.execute.data.Shipment;
+import com.gemstone.gemfire.internal.cache.execute.data.ShipmentId;
import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserver;
import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverAdapter;
import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverHolder;
@@@ -74,12 -45,12 +75,10 @@@ import com.gemstone.gemfire.test.junit.
/**
* This is the base class to do operations
*/
+@Category(DistributedTest.class)
+public class FixedPartitioningTestBase extends JUnit4DistributedTestCase {
-public class FixedPartitioningTestBase extends DistributedTestCase {
-
-- private static final long serialVersionUID = 1L;
--
-- protected static String Quarter1 = "Q1";
++ protected static String Quarter1 = "Q1";
protected static String Quarter2 = "Q2";
protected static String Quarter3 = "Q3";
protected static String Quarter4 = "Q4";
@@@ -133,8 -104,8 +132,8 @@@
}
public static void createCacheOnMember_DisableMovePrimary() {
- System.setProperty("gemfire.DISABLE_MOVE_PRIMARIES_ON_STARTUP", "true");
+ System.setProperty(DistributionConfig.GEMFIRE_PREFIX + "DISABLE_MOVE_PRIMARIES_ON_STARTUP", "true");
- new FixedPartitioningTestBase("Temp").createCache();
+ new FixedPartitioningTestBase().createCache();
}
private void createCache() {