http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java deleted file mode 100644 index afa03d5..0000000 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropogationDUnitTest.java +++ /dev/null @@ -1,1065 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.gemstone.gemfire.internal.cache.wan.misc; - -import org.junit.Ignore; -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 com.gemstone.gemfire.cache.CacheClosedException; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.internal.cache.ForceReattemptException; -import com.gemstone.gemfire.internal.cache.wan.WANTestBase; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -import com.gemstone.gemfire.test.dunit.IgnoredException; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.Wait; - -@Category(DistributedTest.class) -public class ReplicatedRegion_ParallelWANPropogationDUnitTest extends WANTestBase{ - - public ReplicatedRegion_ParallelWANPropogationDUnitTest() { - super(); - // TODO Auto-generated constructor stub - } - - final String expectedExceptions = null; - - - /** - * - */ - private static final long serialVersionUID = 1L; - - @Test - public void test_DR_PGS_1Nodes_Put_Receiver() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2); - vm2.invoke(() -> WANTestBase.createReceiver()); - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - - createCacheInVMs(lnPort, vm4); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true )); - - vm4.invoke(() -> WANTestBase.startSender( "ln1" )); - fail("Expected GatewaySenderConfigException where parallel gateway sender can not be used with replicated region"); - } - catch (Exception e) { - if (!e.getCause().getMessage() - .contains("can not be used with replicated region")) { - fail("Expected GatewaySenderConfigException where parallel gateway sender can not be used with replicated region"); - } - } - } - - /*1. Validate that parallelGAtewaySenderId can be added to distributed region - *Region distributed ack/noack + PGS - *1. Find out the restrictions on totalNumBuckets on shadowPR - *2. Find out the restrictions on redundancy on shadowPR - *3. Find out the restrictions on localMaxMemory on shadowPR - *4. Find out the best way user will specify PR attributes to PGS - *5. Find out the restrictions on ordering. - *6. put on region populates the queue - *7. put on region reaches to remote site. Dispatcher works as expected - *8. m1 and m2 has DR(ack/noack). put on DR from m1 populates queue on both m1 and m2. Validate that remote site got all the events - *9. m1 and m2 has DR(ack/noack). create/put/destroy/operations populates the queue. Validate that remote site got correct events - *10. m1 and m2 has DR(ack/noack). localDestory is called on m1's DR. This locally destroys M1's shadowPr - *11. m1 and m2 has DR(ack/noack). destory is called on m1's DR. This destroys entire shadowPr on m1 and m2 - *12. m1 and m2 has DR(ack/noack). close Region is called on m1's DR. This locally destroys shadowPr on m1 - *13. m1 and m2 has DR(ack/noack). cache.close on m1'. This locally destroys shadowPr on m1 - *14. Validate HA scenario does not cause any event loss - *15. PDX events of DR are propagated to remote sites - *16. validate stats - *17: PR and DR regions with same name.. Can this be created. If yes then how to differentiate these 2 different shadowPR. - *18. test for redundancy. FOR SPR's redundancy will be equal to the number of nodes where DR is present. Max is 3. I know this needs to be figure it out at runtime. - *19. test without prviding diskstorename..I suspect some problem with this code. diskStoreName=null looks like this is not handled very well. need to verify - *20. PAralleGatewaySenderQueue#addPR method has multiple check for inPersistenceEnabled. Can's we do it with only one check. - */ - - /** - * Test to validate that created parallel gatewaySenderls id can be added to - * distributed region - * Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0 - */ - @Ignore - @Test - public void test_PGS_Started_DR_CREATED_NO_RECEIVER() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - vm4.invoke(() -> WANTestBase.createCache( lnPort )); -/* ExpectedException exp1 = addExpectedException(GatewaySenderException.class - .getName(), vm4); - ExpectedException exp2 = addExpectedException(InterruptedException.class - .getName(), vm4); - try { -*/ vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, false )); - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - vm4.invoke(() -> WANTestBase.doPuts( - getTestMethodName() + "_RR", 1000 )); - vm4.invoke(() -> WANTestBase.validateQueueContents( - "ln1", 1000 )); - -/* } - finally { - exp1.remove(); - exp2.remove(); - } -*/ } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /** - * Test to validate that distributed region with given paralleGAtewaySender id - * is created first and then a same parallelGatewaySender is created - * a single put in DR is enqueued in parallelQueue - * Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0 - */ - @Ignore - @Test - public void test_DR_CREATED_PGS_STARTED_NO_RECEIVER() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - vm4.invoke(() -> WANTestBase.createCache( lnPort )); - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); -/* ExpectedException exp1 = addExpectedException(GatewaySenderException.class - .getName(), vm4); - ExpectedException exp2 = addExpectedException(InterruptedException.class - .getName(), vm4); - try {*/ - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, false )); - vm4.invoke(() -> WANTestBase.doPuts( - getTestMethodName() + "_RR", 1000 )); - vm4.invoke(() -> WANTestBase.validateQueueContents( - "ln1", 1000 )); -/* } - finally { - exp1.remove(); - exp2.remove(); - } -*/ } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_1Node_Put_ValidateQueue_No_Receiver() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - vm4.invoke(() -> WANTestBase.createCache( lnPort )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - -/* ExpectedException exp1 = addExpectedException(GatewaySenderException.class - .getName(), vm4); - ExpectedException exp2 = addExpectedException(InterruptedException.class - .getName(), vm4); - try {*/ - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true )); - vm4.invoke(() -> WANTestBase.startSender( "ln1" )); - - vm4.invoke(() -> WANTestBase.doPuts( - getTestMethodName() + "_RR", 10000 )); - - vm4.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 10000 )); - vm4.invoke(() -> WANTestBase.validateQueueContents( - "ln1", 10000 )); -/* } - finally { - exp1.remove(); - exp2.remove(); - } - */ - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_2Nodes_Put_ValidateQueue_No_Receiver() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - vm4.invoke(() -> WANTestBase.createCache( lnPort )); - vm5.invoke(() -> WANTestBase.createCache( lnPort )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - -/* ExpectedException exp1 = addExpectedException( - GatewaySenderException.class.getName()); - ExpectedException exp2 = addExpectedException( - InterruptedException.class.getName()); - ExpectedException exp3 = addExpectedException( - CacheClosedException.class.getName()); - try { -*/ vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true )); - vm5.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true )); - - startSenderInVMs("ln1", vm4, vm5); - - vm4.invoke(() -> WANTestBase.doPuts( - getTestMethodName() + "_RR", 1000 )); - - vm4.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - vm5.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - - vm4.invoke(() -> WANTestBase.validateQueueContents( - "ln1", 1000 )); - vm5.invoke(() -> WANTestBase.validateQueueContents( - "ln1", 1000 )); - -/* } - finally { - exp1.remove(); - exp2.remove(); - exp3.remove(); - } -*/ - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - -// public void test_DR_PGS_ORDERPOLICY_PARTITION_EXPECTException(){ -// -// } -// public void test_DR_PGS_DISKSTORE_NAME_PROVIDED_VALIDATE_DISK(){ -// -// } -// public void test_DR_PGS_DISKSTORE_NAME_NOT_PROVIDED_VALIDATE_DISK(){ -// -// } -// -// public void test_DR_PGS_START_STOP_START(){ -// -// } -// -// public void test_DR_PGS_PERSISTENCE_START_STOP_START(){ -// -// } -// -// public void test_DR_PGS_START_PAUSE_STOP(){ -// -// } -// -// public void test_DR_PGS_START_PAUSE_RESUME_VALIDATE_RECEIVER(){ -// -// } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_1Nodes_Put_Receiver_2() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2); - vm2.invoke(() -> WANTestBase.createReceiver()); - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - - createCacheInVMs(lnPort, vm4); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true)); - - vm4.invoke(() -> WANTestBase.startSender( "ln1")); - - vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR", - 1000)); - - vm4.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000)); - - vm4.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000)); - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_2Nodes_Put_Receiver() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2); - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - vm2.invoke(() -> WANTestBase.createReceiver()); - - createCacheInVMs(lnPort, vm4, vm5); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true)); - vm5.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true)); - - startSenderInVMs("ln1", vm4, vm5); - - vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR", - 1000 )); - - vm4.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - vm5.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - - vm4.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - vm5.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_2Nodes_EMPTY_Put_Receiver() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - vm2.invoke(() -> WANTestBase.createCache( nyPort )); - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - vm2.invoke(() -> WANTestBase.createReceiver()); - - vm4.invoke(() -> WANTestBase.createCache( lnPort )); - vm5.invoke(() -> WANTestBase.createCache( lnPort )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", Scope.DISTRIBUTED_ACK, DataPolicy.EMPTY, isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", Scope.DISTRIBUTED_ACK, DataPolicy.REPLICATE, isOffHeap() )); - - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true)); - vm5.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true)); - - startSenderInVMs("ln1", vm4, vm5); - - vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR", - 1000 )); - -// vm4.invoke(() -> WANTestBase.validateRegionSize( testName + "_RR", -// 1000 )); - vm5.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - - vm4.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - vm5.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PR_PGS_4Nodes_Put_Receiver_2Nodes() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2, vm3); - vm2.invoke(() -> WANTestBase.createReceiver()); - vm3.invoke(() -> WANTestBase.createReceiver()); - - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - vm3.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - - vm2.invoke(() -> WANTestBase.createPartitionedRegion( - getTestMethodName() + "_PR", null, 1, 100, isOffHeap() )); - vm3.invoke(() -> WANTestBase.createPartitionedRegion( - getTestMethodName() + "_PR", null, 1, 100, isOffHeap() )); - - createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); - - vm4.invoke(() -> WANTestBase.createPartitionedRegion( - getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() )); - vm5.invoke(() -> WANTestBase.createPartitionedRegion( - getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() )); - vm6.invoke(() -> WANTestBase.createPartitionedRegion( - getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() )); - vm7.invoke(() -> WANTestBase.createPartitionedRegion( - getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap() )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm6.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm7.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - - vm4.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 10, 100, false, false, null, true )); - vm5.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 10, 100, false, false, null, true )); - vm6.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 10, 100, false, false, null, true )); - vm7.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 10, 100, false, false, null, true )); - - startSenderInVMs("ln", vm4, vm5, vm6, vm7); - - vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm7.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - - vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR", - 1000 )); - vm5.invoke(() -> WANTestBase.doNextPuts( getTestMethodName() + "_PR", - 1000, 2000 )); - - vm4.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_PR", - 1000 )); - vm5.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - - vm4.invoke(() -> WANTestBase.validateQueueContents( "ln", - 0 )); - vm5.invoke(() -> WANTestBase.validateQueueContents( "ln", - 0 )); - -/* ExpectedException exp1 = addExpectedException(CacheClosedException.class - .getName()); - try {*/ - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - vm3.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_PR", 1000 )); - vm3.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_PR", 1000 )); -/* } - finally { - exp1.remove(); - } -*/ } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_NOMANUALSTART_4Nodes_Put_ValidateReceiver() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2); - vm2.invoke(() -> WANTestBase.createReceiver()); - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - - createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); - - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, false )); - vm5.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, false )); - vm6.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, false )); - vm7.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, false )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - vm6.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - vm7.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln1", isOffHeap() )); - - vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR", - 1000 )); - - vm4.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - vm5.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - vm6.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - vm7.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - - - vm4.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - vm5.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - vm6.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - vm7.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - -/* ExpectedException exp1 = addExpectedException(CacheClosedException.class - .getName()); - try {*/ - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); -/* } - finally { - exp1.remove(); - }*/ - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_4Nodes_Put_CLOSE4NODESCACHE_RECREATE_PUT_ValidateReceiver() - throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2, vm3); - createReceiverInVMs(vm2, vm3); - - createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); - - vm4.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - vm5.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - vm6.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - vm7.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm6.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm7.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - - startSenderInVMs("ln", vm4, vm5, vm6, vm7); - - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - vm3.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - - // before doing any puts, let the senders be running in order to ensure - // that - // not a single event will be lost - vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm7.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - - vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR", - 1000 )); - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - -/* ExpectedException exp1 = addExpectedException(CacheClosedException.class - .getName()); - try {*/ - vm4.invoke(() -> WANTestBase.killSender()); - vm5.invoke(() -> WANTestBase.killSender()); - vm6.invoke(() -> WANTestBase.killSender()); - vm7.invoke(() -> WANTestBase.killSender()); -/* } - finally { - exp1.remove(); - }*/ - - createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); - - vm4.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - vm5.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - vm6.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - vm7.invoke(() -> WANTestBase.createSender( "ln", 2, - true, 100, 10, false, false, null, true )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm6.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm7.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - - startSenderInVMs("ln", vm4, vm5, vm6, vm7); - - vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm7.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - // ------------------------------------------------------------------------------------ - - vm4.invoke(() -> WANTestBase.doNextPuts( - getTestMethodName() + "_RR", 1000, 2000 )); - - // verify all buckets drained on all sender nodes. - vm4.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained( "ln" )); - vm5.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained( "ln" )); - vm6.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained( "ln" )); - vm7.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained( "ln" )); - -/* exp1 = addExpectedException(CacheClosedException.class.getName()); - try {*/ - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 2000 )); - vm3.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 2000 )); -/* } - finally { - exp1.remove(); - }*/ - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_NO_ACK_PGS_2Nodes_Put_ValidateQueue_Receiver() throws Exception { - try { - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2); - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", null, isOffHeap() )); - vm2.invoke(() -> WANTestBase.createReceiver()); - - createCacheInVMs(lnPort, vm4, vm5); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( getTestMethodName() + "_RR", "ln1", - Scope.DISTRIBUTED_NO_ACK, DataPolicy.REPLICATE, isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( getTestMethodName() + "_RR", "ln1", - Scope.DISTRIBUTED_NO_ACK, DataPolicy.REPLICATE, isOffHeap() )); - - vm4.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true)); - vm5.invoke(() -> WANTestBase.createSender( "ln1", 2, - true, 10, 100, false, false, null, true)); - - startSenderInVMs("ln1", vm4, vm5); - - vm4.invoke(() -> WANTestBase.doPuts( getTestMethodName() + "_RR", - 1000 )); - - vm4.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - vm5.invoke(() -> WANTestBase.validateRegionSize( getTestMethodName() + "_RR", - 1000 )); - - vm4.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - vm5.invoke(() -> WANTestBase.validateQueueContents( "ln1", - 0 )); - - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - } - catch (Exception e) { - Assert.fail("Unexpected exception", e); - } - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_2NODES_1NODESDOWN_Validate_Receiver() throws Exception { - - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2, vm3); - createReceiverInVMs(vm2, vm3); - - createCacheInVMs(lnPort, vm4, vm5); - - vm4.invoke(() -> WANTestBase.createSender( "ln", 2, true, - 100, 10, false, false, null, true )); - vm5.invoke(() -> WANTestBase.createSender( "ln", 2, true, - 100, 10, false, false, null, true )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - - startSenderInVMs("ln", vm4, vm5); - - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm3.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - - vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - - Thread.sleep(60000);; - -/* ExpectedException exp1 = addExpectedException(CacheClosedException.class - .getName()); - try {*/ - AsyncInvocation inv1 = vm4.invokeAsync(() -> ReplicatedRegion_ParallelWANPropogationDUnitTest.doPuts0( - getTestMethodName() + "_RR", 1000 )); - Wait.pause(1000); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase.killSender()); - try { - inv1.join(); - inv2.join(); - } - catch (Exception e) { - Assert.fail("UnExpected Exception", e); - } -/* } - finally { - exp1.remove(); - }*/ - - Integer size = (Integer)vm4.invoke(() -> WANTestBase.getQueueContentSize( "ln" )); - LogWriterUtils.getLogWriter().info("The size of the queue is in vm4 " + size); - - - vm4.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained( "ln" )); - - size = (Integer)vm4.invoke(() -> WANTestBase.getQueueContentSize( "ln" )); - LogWriterUtils.getLogWriter().info("The size of the queue is in vm4 " + size); - - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 1000 )); - } - - /**Below test is disabled intentionally - 1> In this release 8.0, for rolling upgrade support queue name is changed to old style - 2>Comman parallel sender for different non colocated regions is not supported in 8.0 so no need to bother about - ParallelGatewaySenderQueue#convertPathToName - 3> We have to enabled it in next release - 4> Version based rolling upgrade support should be provided. based on the version of the gemfire QSTRING should be used between 8.0 - and version prior to 8.0*/ - @Ignore - @Test - public void test_DR_PGS_4NODES_2NODESDOWN_Validate_Receiver() throws Exception { - - Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); - Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); - - createCacheInVMs(nyPort, vm2, vm3); - createReceiverInVMs(vm2, vm3); - - createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); - - vm4.invoke(() -> WANTestBase.createSender( "ln", 2, true, - 100, 10, false, false, null, true )); - vm5.invoke(() -> WANTestBase.createSender( "ln", 2, true, - 100, 10, false, false, null, true )); - vm6.invoke(() -> WANTestBase.createSender( "ln", 2, true, - 100, 10, false, false, null, true )); - vm7.invoke(() -> WANTestBase.createSender( "ln", 2, true, - 100, 10, false, false, null, true )); - - vm4.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm5.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm6.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm7.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - - startSenderInVMs("ln", vm4, vm5, vm6, vm7); - - vm2.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - vm3.invoke(() -> WANTestBase.createReplicatedRegion( - getTestMethodName() + "_RR", "ln", isOffHeap() )); - - vm4.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm5.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm6.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - vm7.invoke(() -> WANTestBase.waitForSenderRunningState( "ln" )); - - Thread.sleep(60000); -/* ExpectedException exp1 = addExpectedException(CacheClosedException.class - .getName()); - try */{ - AsyncInvocation inv1 = vm7.invokeAsync(() -> ReplicatedRegion_ParallelWANPropogationDUnitTest.doPuts0( - getTestMethodName() + "_RR", 10000 )); - Thread.sleep(1000); - AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); - Thread.sleep(2000); - AsyncInvocation inv3 = vm6.invokeAsync(() -> ReplicatedRegion_ParallelWANPropogationDUnitTest.doPuts1( - getTestMethodName() + "_RR", 10000 )); - Thread.sleep(1500); - AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender()); - try { - inv1.join(); - inv2.join(); - inv3.join(); - inv4.join(); - } - catch (Exception e) { - Assert.fail("UnExpected Exception", e); - } - }/* - finally { - exp1.remove(); - }*/ - - vm6.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained( "ln" )); - vm7.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained( "ln" )); - - vm2.invoke(() -> WANTestBase.validateRegionSize( - getTestMethodName() + "_RR", 10000 )); - - } - - public static void doPuts0(String regionName, int numPuts) { - IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class - .getName()); - IgnoredException exp1 = IgnoredException.addIgnoredException(CacheClosedException.class - .getName()); - try { - - Region r = cache.getRegion(Region.SEPARATOR + regionName); - assertNotNull(r); - for (long i = 0; i < numPuts; i++) { - LogWriterUtils.getLogWriter().info("Put : key : " + i); - r.put(i, "0_" + i); - } - } finally { - exp.remove(); - exp1.remove(); - } - } - - public static void doPuts1(String regionName, int numPuts){ - IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class - .getName()); - IgnoredException exp1 = IgnoredException.addIgnoredException(CacheClosedException.class - .getName()); - try { - - Region r = cache.getRegion(Region.SEPARATOR + regionName); - assertNotNull(r); - for (long i = 0; i < numPuts; i++) { - LogWriterUtils.getLogWriter().info("Put : key : " + i); - r.put(i, "1_" + i); - } - } finally { - exp.remove(); - exp1.remove(); - } - } - - public static void doPuts2(String regionName, int numPuts){ - IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class - .getName()); - IgnoredException exp1 = IgnoredException.addIgnoredException(CacheClosedException.class - .getName()); - try { - Region r = cache.getRegion(Region.SEPARATOR + regionName); - assertNotNull(r); - for (long i = 0; i < numPuts; i++) { - LogWriterUtils.getLogWriter().info("Put : key : " + i); - r.put(i, "2_" + i); - } - } finally { - exp.remove(); - exp1.remove(); - } - } - - /** - * Test to validate that put on DR with no ack on multiple nodes are propogated to parallelqueue on multiple nodes - */ - - /** - * Test to validate that the single put in DR is propoagted to remote site through paralleHatewaySender - */ - - -}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java index 2d7a392..0ee78c5 100644 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/SenderWithTransportFilterDUnitTest.java @@ -50,7 +50,7 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest; public class SenderWithTransportFilterDUnitTest extends WANTestBase { @Test - public void testSerialSenderWithTansportFilter() { + public void testSerialSenderWithTransportFilter() { Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); @@ -76,7 +76,7 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase { } @Test - public void testParallelSenderWithTansportFilter() { + public void testParallelSenderWithTransportFilter() { Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); Integer nyPort = (Integer)vm1.invoke(() -> WANTestBase.createFirstRemoteLocator( 2, lnPort )); @@ -115,7 +115,7 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase { fact.setStartPort(port); fact.setEndPort(port); ArrayList<GatewayTransportFilter> transportFilters = new ArrayList<GatewayTransportFilter>(); - transportFilters.add(new CheckSumTranportFilter("CheckSumTranportFilter")); + transportFilters.add(new CheckSumTransportFilter("CheckSumTransportFilter")); if (!transportFilters.isEmpty()) { for (GatewayTransportFilter filter : transportFilters) { fact.addGatewayTransportFilter(filter); @@ -126,14 +126,14 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase { receiver.start(); } catch (IOException e) { - fail("Test " + test.getName() + " failed to start GatewayRecevier on port " + port, e); + fail("Test " + test.getName() + " failed to start GatewayReceiver on port " + port, e); } return port; } public static void createSenderWithTransportFilter(String dsName, int remoteDsId, boolean isParallel, Integer maxMemory, Integer batchSize, - boolean isConflation, boolean isPersistent, boolean isManulaStart) { + boolean isConflation, boolean isPersistent, boolean isManualStart) { File persistentDirectory = new File(dsName + "_disk_" + System.currentTimeMillis() + "_" + VM.getCurrentVMNum()); persistentDirectory.mkdir(); @@ -148,7 +148,7 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase { gateway.setBatchSize(batchSize); ((InternalGatewaySenderFactory)gateway).setLocatorDiscoveryCallback(new MyLocatorCallback()); ArrayList<GatewayTransportFilter> transportFilters = new ArrayList<GatewayTransportFilter>(); - transportFilters.add(new CheckSumTranportFilter("CheckSumTranportFilter")); + transportFilters.add(new CheckSumTransportFilter("CheckSumTransportFilter")); if (!transportFilters.isEmpty()) { for (GatewayTransportFilter filter : transportFilters) { gateway.addGatewayTransportFilter(filter); @@ -172,11 +172,11 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase { .createGatewaySenderFactory(); gateway.setMaximumQueueMemory(maxMemory); gateway.setBatchSize(batchSize); - gateway.setManualStart(isManulaStart); + gateway.setManualStart(isManualStart); ((InternalGatewaySenderFactory)gateway) .setLocatorDiscoveryCallback(new MyLocatorCallback()); ArrayList<GatewayTransportFilter> transportFilters = new ArrayList<GatewayTransportFilter>(); - transportFilters.add(new CheckSumTranportFilter("CheckSumTranportFilter")); + transportFilters.add(new CheckSumTransportFilter("CheckSumTransportFilter")); if (!transportFilters.isEmpty()) { for (GatewayTransportFilter filter : transportFilters) { gateway.addGatewayTransportFilter(filter); @@ -196,13 +196,13 @@ public class SenderWithTransportFilterDUnitTest extends WANTestBase { } } - static class CheckSumTranportFilter implements GatewayTransportFilter { + static class CheckSumTransportFilter implements GatewayTransportFilter { Adler32 checker = new Adler32(); private String name; - public CheckSumTranportFilter(String name){ + public CheckSumTransportFilter(String name){ this.name = name; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java index 0380433..6e2581e 100644 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java @@ -129,7 +129,7 @@ public class ShutdownAllPersistentGatewaySenderDUnitTest extends WANTestBase { public void run() { final Region region = cache.getRegion(getTestMethodName() + "_PR"); cache.getLogger().info( - "vm1's region size before restart gatewayhub is " + region.size()); + "vm1's region size before restart gatewayHub is " + region.size()); } }); vm2.invoke(() -> WANTestBase.createReceiver()); @@ -149,13 +149,13 @@ public class ShutdownAllPersistentGatewaySenderDUnitTest extends WANTestBase { final Region region = cache.getRegion(getTestMethodName() + "_PR"); cache.getLogger().info( - "vm1's region size after restart gatewayhub is " + region.size()); + "vm1's region size after restart gatewayHub is " + region.size()); Wait.waitForCriterion(new WaitCriterion() { public boolean done() { - Object lastvalue = region.get(NUM_KEYS - 1); - if (lastvalue != null && lastvalue.equals(NUM_KEYS - 1)) { + Object lastValue = region.get(NUM_KEYS - 1); + if (lastValue != null && lastValue.equals(NUM_KEYS - 1)) { region.getCache().getLogger().info( - "Last key has arrived, its value is " + lastvalue + "Last key has arrived, its value is " + lastValue + ", end of wait."); return true; } @@ -174,7 +174,7 @@ public class ShutdownAllPersistentGatewaySenderDUnitTest extends WANTestBase { } - private AsyncInvocation shutDownAllMembers(VM vm, final int expnum, final long timeout) { + private AsyncInvocation shutDownAllMembers(VM vm, final int expectedNumber, final long timeout) { AsyncInvocation future = vm.invokeAsync(new SerializableRunnable("Shutdown all the members") { public void run() { @@ -188,7 +188,7 @@ public class ShutdownAllPersistentGatewaySenderDUnitTest extends WANTestBase { adminDS.connect(); Set members = adminDS.shutDownAllMembers(timeout); int num = members == null ? 0 : members.size(); - assertEquals(expnum, num); + assertEquals(expectedNumber, num); } catch (AdminException e) { throw new RuntimeException(e); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANConfigurationJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANConfigurationJUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANConfigurationJUnitTest.java index d6b339c..b504f87 100644 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANConfigurationJUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANConfigurationJUnitTest.java @@ -62,7 +62,7 @@ public class WANConfigurationJUnitTest { fact.setParallel(true); GatewaySender sender1 = fact.create("NYSender", 2); sender1.start(); - fail("Expectd IllegalStateException but not thrown"); + fail("Expected IllegalStateException but not thrown"); } catch (Exception e) { if ((e instanceof IllegalStateException && e @@ -72,7 +72,7 @@ public class WANConfigurationJUnitTest { .toLocalizedString()))) { } else { - fail("Expectd IllegalStateException but received :" + e); + fail("Expected IllegalStateException but received :" + e); } } } @@ -89,7 +89,7 @@ public class WANConfigurationJUnitTest { fact.setManualStart(true); fact.create("NYSender", 2); fact.create("NYSender", 2); - fail("Expectd IllegalStateException but not thrown"); + fail("Expected IllegalStateException but not thrown"); } catch (Exception e) { if (e instanceof IllegalStateException @@ -97,7 +97,7 @@ public class WANConfigurationJUnitTest { } else { - fail("Expectd IllegalStateException but received :" + e); + fail("Expected IllegalStateException but received :" + e); } } } @@ -116,7 +116,7 @@ public class WANConfigurationJUnitTest { AttributesFactory factory = new AttributesFactory(); factory.addGatewaySenderId(sender1.getId()); factory.addGatewaySenderId(sender1.getId()); - fail("Expectd IllegalArgumentException but not thrown"); + fail("Expected IllegalArgumentException but not thrown"); } catch (Exception e) { if (e instanceof IllegalArgumentException @@ -124,7 +124,7 @@ public class WANConfigurationJUnitTest { } else { - fail("Expectd IllegalStateException but received :" + e); + fail("Expected IllegalStateException but received :" + e); } } } @@ -170,12 +170,12 @@ public class WANConfigurationJUnitTest { .create("test_GatewaySender_Parallel_DistributedRegion"); } catch (Exception e) { - fail("Unexpectd Exception :" + e); + fail("Unexpected Exception :" + e); } } @Test - public void test_GatewaySender_Parallel_MultipleDispatherThread() { + public void test_GatewaySender_Parallel_MultipleDispatcherThread() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); GatewaySenderFactory fact = cache.createGatewaySenderFactory(); fact.setParallel(true); @@ -185,25 +185,25 @@ public class WANConfigurationJUnitTest { GatewaySender sender1 = fact.create("NYSender", 2); } catch (GatewaySenderException e) { - fail("UnExpectd Exception " + e); + fail("UnExpected Exception " + e); } } @Test - public void test_GatewaySender_Serial_ZERO_DispatherThread() { + public void test_GatewaySender_Serial_ZERO_DispatcherThread() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); GatewaySenderFactory fact = cache.createGatewaySenderFactory(); fact.setManualStart(true); fact.setDispatcherThreads(0); try { GatewaySender sender1 = fact.create("NYSender", 2); - fail("Expectd GatewaySenderException but not thrown"); + fail("Expected GatewaySenderException but not thrown"); } catch (GatewaySenderException e) { if (e.getMessage().contains("can not be created with dispatcher threads less than 1")) { } else { - fail("Expectd IllegalStateException but received :" + e); + fail("Expected IllegalStateException but received :" + e); } } } @@ -229,10 +229,10 @@ public class WANConfigurationJUnitTest { fact.setMaximumTimeBetweenPings(2000); fact.setSocketBufferSize(200); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - GatewayTransportFilter myStreamfilter2 = new MyGatewayTransportFilter2(); - fact.addGatewayTransportFilter(myStreamfilter2); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + GatewayTransportFilter myStreamFilter2 = new MyGatewayTransportFilter2(); + fact.addGatewayTransportFilter(myStreamFilter2); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver1 = fact.create(); @@ -271,10 +271,10 @@ public class WANConfigurationJUnitTest { fact.setMaximumTimeBetweenPings(2000); fact.setSocketBufferSize(200); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - GatewayTransportFilter myStreamfilter2 = new MyGatewayTransportFilter2(); - fact.addGatewayTransportFilter(myStreamfilter2); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + GatewayTransportFilter myStreamFilter2 = new MyGatewayTransportFilter2(); + fact.addGatewayTransportFilter(myStreamFilter2); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver1 = fact.create(); assertTrue(receiver1.isRunning()); } @@ -294,12 +294,12 @@ public class WANConfigurationJUnitTest { fact.setDiskStoreName("FORNY"); fact.setMaximumQueueMemory(200); fact.setAlertThreshold(1200); - GatewayEventFilter myeventfilter1 = new MyGatewayEventFilter1(); - fact.addGatewayEventFilter(myeventfilter1); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); - GatewayTransportFilter myStreamfilter2 = new MyGatewayTransportFilter2(); - fact.addGatewayTransportFilter(myStreamfilter2); + GatewayEventFilter myEventFilter1 = new MyGatewayEventFilter1(); + fact.addGatewayEventFilter(myEventFilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); + GatewayTransportFilter myStreamFilter2 = new MyGatewayTransportFilter2(); + fact.addGatewayTransportFilter(myStreamFilter2); GatewaySender sender1 = fact.create("TKSender", 2); @@ -349,12 +349,12 @@ public class WANConfigurationJUnitTest { fact.setDiskStoreName("FORNY"); fact.setMaximumQueueMemory(200); fact.setAlertThreshold(1200); - GatewayEventFilter myeventfilter1 = new MyGatewayEventFilter1(); - fact.addGatewayEventFilter(myeventfilter1); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); - GatewayTransportFilter myStreamfilter2 = new MyGatewayTransportFilter2(); - fact.addGatewayTransportFilter(myStreamfilter2); + GatewayEventFilter myEventFilter1 = new MyGatewayEventFilter1(); + fact.addGatewayEventFilter(myEventFilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); + GatewayTransportFilter myStreamFilter2 = new MyGatewayTransportFilter2(); + fact.addGatewayTransportFilter(myStreamFilter2); GatewaySender sender1 = fact.create("TKSender", 2); @@ -423,7 +423,7 @@ public class WANConfigurationJUnitTest { } @Test - public void test_ValidateGatwayReceiverAttributes() { + public void test_ValidateGatewayReceiverAttributes_2() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); GatewayReceiverFactory fact = cache.createGatewayReceiverFactory(); fact.setStartPort(50504); @@ -431,8 +431,8 @@ public class WANConfigurationJUnitTest { fact.setSocketBufferSize(4000); fact.setEndPort(70707); fact.setManualStart(true); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver = fact.create(); try { @@ -451,13 +451,13 @@ public class WANConfigurationJUnitTest { /** * This test takes a minimum of 120s to execute. It is known to hang on Mac OS * X Yosemite do to changes in the the message string checked in - * GatewayRecieverImpl around line 167. Expects + * GatewayReceiverImpl around line 167. Expects * "Cannot assign requested address" but gets - * "Can't assign requested address". Timout after 150s to safeguard against + * "Can't assign requested address". Timeout after 150s to safeguard against * hanging on other platforms that may differ. */ @Test(timeout = 150000) - public void test_ValidateGatwayReceiverAttributes_WrongBindAddress() { + public void test_ValidateGatewayReceiverAttributes_WrongBindAddress() { if (System.getProperty("os.name").equals("Mac OS X")) { fail("Failing to avoid known hang on Mac OS X."); } @@ -469,13 +469,13 @@ public class WANConfigurationJUnitTest { fact.setEndPort(70707); fact.setManualStart(true); fact.setBindAddress("200.112.204.10"); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver = fact.create(); try { receiver.start(); - fail("Expected GAtewayReceiverException"); + fail("Expected GatewayReceiverException"); } catch (GatewayReceiverException gRE){ assertTrue(gRE.getMessage().contains("Failed to create server socket on")); @@ -487,14 +487,14 @@ public class WANConfigurationJUnitTest { } @Test - public void test_ValidateGatwayReceiverDefaultStartPortAndDefaultEndPort() { + public void test_ValidateGatewayReceiverDefaultStartPortAndDefaultEndPort() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); GatewayReceiverFactory fact = cache.createGatewayReceiverFactory(); fact.setMaximumTimeBetweenPings(1000); fact.setSocketBufferSize(4000); fact.setManualStart(true); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver = fact.create(); try { @@ -504,22 +504,21 @@ public class WANConfigurationJUnitTest { fail("The test failed with IOException"); } int port = receiver.getPort(); - System.out.println("SKSKSK The port of receiver is " + port); if((port < 5000) || (port > 5500)) { fail("GatewayReceiver started on out of range port"); } } @Test - public void test_ValidateGatwayReceiverDefaultStartPortAndEndPortProvided() { + public void test_ValidateGatewayReceiverDefaultStartPortAndEndPortProvided() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); GatewayReceiverFactory fact = cache.createGatewayReceiverFactory(); fact.setMaximumTimeBetweenPings(1000); fact.setSocketBufferSize(4000); fact.setEndPort(50707); fact.setManualStart(true); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver = fact.create(); try { @@ -535,15 +534,15 @@ public class WANConfigurationJUnitTest { } @Test - public void test_ValidateGatwayReceiverWithManualStartFALSE() { + public void test_ValidateGatewayReceiverWithManualStartFALSE() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); GatewayReceiverFactory fact = cache.createGatewayReceiverFactory(); fact.setMaximumTimeBetweenPings(1000); fact.setSocketBufferSize(4000); fact.setStartPort(5303); fact.setManualStart(false); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver = fact.create(); int port = receiver.getPort(); if ((port < 5303) || (port > GatewayReceiver.DEFAULT_END_PORT)) { @@ -552,15 +551,15 @@ public class WANConfigurationJUnitTest { } @Test - public void test_ValidateGatwayReceiverWithStartPortAndDefaultEndPort() { + public void test_ValidateGatewayReceiverWithStartPortAndDefaultEndPort() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); GatewayReceiverFactory fact = cache.createGatewayReceiverFactory(); fact.setMaximumTimeBetweenPings(1000); fact.setSocketBufferSize(4000); fact.setStartPort(5303); fact.setManualStart(true); - GatewayTransportFilter myStreamfilter1 = new MyGatewayTransportFilter1(); - fact.addGatewayTransportFilter(myStreamfilter1); + GatewayTransportFilter myStreamFilter1 = new MyGatewayTransportFilter1(); + fact.addGatewayTransportFilter(myStreamFilter1); GatewayReceiver receiver = fact.create(); try { @@ -576,7 +575,7 @@ public class WANConfigurationJUnitTest { } @Test - public void test_ValidateGatwayReceiverWithWrongEndPortProvided() { + public void test_ValidateGatewayReceiverWithWrongEndPortProvided() { cache = new CacheFactory().set(MCAST_PORT, "0").create(); try { GatewayReceiverFactory fact = cache.createGatewayReceiverFactory(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java index 0d16804..7973c05 100644 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WANLocatorServerDUnitTest.java @@ -126,7 +126,7 @@ public class WANLocatorServerDUnitTest extends WANTestBase { receiver.start(); } catch (IOException e) { - fail("Test " + test.getName() + " failed to start GatewayRecevier on port " + port, e); + fail("Test " + test.getName() + " failed to start GatewayReceiver on port " + port, e); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java index a84f393..fc16571 100644 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java @@ -86,7 +86,7 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase { */ @Ignore @Test - public void test_AllLocatorsinDSShouldHaveDistributedSystemId() throws Exception { + public void test_AllLocatorsInDSShouldHaveDistributedSystemId() throws Exception { try { Integer lnLocPort1 = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1)); @@ -197,7 +197,7 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase { } @Test - public void test_NY_Recognises_TK_AND_HK_Simeltenously() { + public void test_NY_Recognises_TK_AND_HK_Simultaneously() { Map<Integer, ArrayList<Integer>> dsVsPort = new HashMap<Integer, ArrayList<Integer>>(); ArrayList<Integer> locatorPortsln = new ArrayList<Integer>(); @@ -251,7 +251,7 @@ public class WanAutoDiscoveryDUnitTest extends WANTestBase { @Test - public void test_LN_Sender_recogises_ALL_NY_Locators() { + public void test_LN_Sender_recognises_ALL_NY_Locators() { Integer lnLocPort1 = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java index a3dcb5d..073056f 100644 --- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/misc/WanValidationsDUnitTest.java @@ -107,7 +107,7 @@ public class WanValidationsDUnitTest extends WANTestBase { * * Below test is disabled intentionally Replicated region with Parallel Async * Event queue is not supported. Test is added for the same - * ReplicatedRegion_ParallelWANPropogationDUnitTest#test_DR_PGS_1Nodes_Put_Receiver + * ReplicatedRegion_ParallelWANPropagationDUnitTest#test_DR_PGS_1Nodes_Put_Receiver * * We are gone support this configuration in upcoming releases */ @@ -176,7 +176,7 @@ public class WanValidationsDUnitTest extends WANTestBase { @Test - public void testReplicatedSerialAsyncEventQueueWithPeristenceEnabled() { + public void testReplicatedSerialAsyncEventQueueWithPersistenceEnabled() { IgnoredException.addIgnoredException("another cache has the same region defined"); try { Integer lnPort = (Integer)vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId( 1 )); @@ -405,7 +405,7 @@ public class WanValidationsDUnitTest extends WANTestBase { try { vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, true, 100, false, false, null, null, true, false )); - fail("Expected IllegateStateException : Sender names should be different."); + fail("Expected IllegalStateException : Sender names should be different."); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) || !(e.getCause().getMessage() @@ -430,7 +430,7 @@ public class WanValidationsDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 3, false, 100, false, false, null, null, true, false )); - fail("Expected IllegateStateException : Remote Ds Ids should match"); + fail("Expected IllegalStateException : Remote Ds Ids should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -455,7 +455,7 @@ public class WanValidationsDUnitTest extends WANTestBase { try { vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, true, 100, false, false, null, null, true, false )); - fail("Expected IllegateStateException : is not serial Gateway Sender"); + fail("Expected IllegalStateException : is not serial Gateway Sender"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -482,7 +482,7 @@ public class WanValidationsDUnitTest extends WANTestBase { .invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false,null, null, true, false )); - fail("Expected IllegateStateException : is not parallel Gateway Sender"); + fail("Expected IllegalStateException : is not parallel Gateway Sender"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -508,11 +508,11 @@ public class WanValidationsDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100,true, false, null, null, true, false )); - fail("Expected IllegateStateException : isBatchConflation Should match"); + fail("Expected IllegalStateException : isBatchConflation Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) - || !(e.getCause().getMessage().contains("another cache has the same Gateway Sender defined with isBatchConfaltionEnabled"))) { + || !(e.getCause().getMessage().contains("another cache has the same Gateway Sender defined with isBatchConflationEnabled"))) { Assert.fail("Expected IllegalStateException", e); } } @@ -531,7 +531,7 @@ public class WanValidationsDUnitTest extends WANTestBase { try { vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100,false, true, null, null, true, false )); - fail("Expected IllegateStateException : isPersistentEnabled Should match"); + fail("Expected IllegalStateException : isPersistentEnabled Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -553,7 +553,7 @@ public class WanValidationsDUnitTest extends WANTestBase { try { vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 50, false, false, null, null, true, false )); - fail("Expected IllegateStateException : alertThreshold Should match"); + fail("Expected IllegalStateException : alertThreshold Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -575,7 +575,7 @@ public class WanValidationsDUnitTest extends WANTestBase { try { vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, null, null, false, false )); - fail("Expected IllegateStateException : manualStart Should match"); + fail("Expected IllegalStateException : manualStart Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -591,18 +591,18 @@ public class WanValidationsDUnitTest extends WANTestBase { createCacheInVMs(lnPort, vm1, vm2); - ArrayList<GatewayEventFilter> eventFiletrs = new ArrayList<GatewayEventFilter>(); - eventFiletrs.add(new MyGatewayEventFilter()); + ArrayList<GatewayEventFilter> eventFilters = new ArrayList<GatewayEventFilter>(); + eventFilters.add(new MyGatewayEventFilter()); vm1.invoke(() -> WANTestBase.createSenderForValidations( - "ln", 2, false, 100, false, false, eventFiletrs, + "ln", 2, false, 100, false, false, eventFilters, null, true, false )); try { - eventFiletrs.clear(); - eventFiletrs.add(new Filter70()); + eventFilters.clear(); + eventFilters.add(new Filter70()); vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, - eventFiletrs, null, true, false )); - fail("Expected IllegateStateException : GatewayEventFileters Should match"); + eventFilters, null, true, false )); + fail("Expected IllegalStateException : GatewayEventFilters Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -619,19 +619,19 @@ public class WanValidationsDUnitTest extends WANTestBase { createCacheInVMs(lnPort, vm1, vm2); - ArrayList<GatewayEventFilter> eventFiletrs = new ArrayList<GatewayEventFilter>(); - eventFiletrs.add(new MyGatewayEventFilter()); + ArrayList<GatewayEventFilter> eventFilters = new ArrayList<GatewayEventFilter>(); + eventFilters.add(new MyGatewayEventFilter()); vm1.invoke(() -> WANTestBase.createSenderForValidations( - "ln", 2, false, 100, false, false, eventFiletrs, + "ln", 2, false, 100, false, false, eventFilters, null, true, false )); try { - eventFiletrs.clear(); - eventFiletrs.add(new MyGatewayEventFilter()); - eventFiletrs.add(new Filter70()); + eventFilters.clear(); + eventFilters.add(new MyGatewayEventFilter()); + eventFilters.add(new Filter70()); vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, - eventFiletrs, null, true, false )); - fail("Expected IllegateStateException : GatewayEventFileters Should match"); + eventFilters, null, true, false )); + fail("Expected IllegalStateException : GatewayEventFilters Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -648,20 +648,20 @@ public class WanValidationsDUnitTest extends WANTestBase { createCacheInVMs(lnPort, vm1, vm2); - ArrayList<GatewayTransportFilter> transportFiletrs = new ArrayList<GatewayTransportFilter>(); - transportFiletrs.add(new MyGatewayTransportFilter1()); - transportFiletrs.add(new MyGatewayTransportFilter2()); + ArrayList<GatewayTransportFilter> transportFilters = new ArrayList<GatewayTransportFilter>(); + transportFilters.add(new MyGatewayTransportFilter1()); + transportFilters.add(new MyGatewayTransportFilter2()); vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, null, - transportFiletrs, true, false )); + transportFilters, true, false )); try { - transportFiletrs.clear(); - transportFiletrs.add(new MyGatewayTransportFilter3()); - transportFiletrs.add(new MyGatewayTransportFilter4()); + transportFilters.clear(); + transportFilters.add(new MyGatewayTransportFilter3()); + transportFilters.add(new MyGatewayTransportFilter4()); vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, - null, transportFiletrs, true, false )); - fail("Expected IllegateStateException : GatewayEventFileters Should match"); + null, transportFilters, true, false )); + fail("Expected IllegalStateException : GatewayEventFilters Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -678,20 +678,20 @@ public class WanValidationsDUnitTest extends WANTestBase { createCacheInVMs(lnPort, vm1, vm2); - ArrayList<GatewayTransportFilter> transportFiletrs = new ArrayList<GatewayTransportFilter>(); - transportFiletrs.add(new MyGatewayTransportFilter1()); - transportFiletrs.add(new MyGatewayTransportFilter2()); + ArrayList<GatewayTransportFilter> transportFilters = new ArrayList<GatewayTransportFilter>(); + transportFilters.add(new MyGatewayTransportFilter1()); + transportFilters.add(new MyGatewayTransportFilter2()); vm1.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, null, - transportFiletrs, true, false )); + transportFilters, true, false )); try { - transportFiletrs.clear(); - transportFiletrs.add(new MyGatewayTransportFilter2()); - transportFiletrs.add(new MyGatewayTransportFilter1()); + transportFilters.clear(); + transportFilters.add(new MyGatewayTransportFilter2()); + transportFilters.add(new MyGatewayTransportFilter1()); vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, - null, transportFiletrs, true, false )); - fail("Expected IllegateStateException : GatewayEventFileters Should match"); + null, transportFilters, true, false )); + fail("Expected IllegalStateException : GatewayEventFilters Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -717,7 +717,7 @@ public class WanValidationsDUnitTest extends WANTestBase { vm2.invoke(() -> WANTestBase.createSenderForValidations( "ln", 2, false, 100, false, false, null, null, true, true )); - fail("Expected IllegateStateException : isDiskSynchronous Should match"); + fail("Expected IllegalStateException : isDiskSynchronous Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -794,7 +794,7 @@ public class WanValidationsDUnitTest extends WANTestBase { try { vm2.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2, true, 100, 10, false, false, null, true, 4, OrderPolicy.KEY )); - fail("Expected IllegateStateException : dispatcher threads Should match"); + fail("Expected IllegalStateException : dispatcher threads Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) @@ -807,7 +807,7 @@ public class WanValidationsDUnitTest extends WANTestBase { // dispatcher threads are same across all the nodes for ParallelGatewaySender /* - * For Parallel sender, thread policy is not supported whcih is checked at the + * For Parallel sender, thread policy is not supported which is checked at the * time of sender creation. policy KEY and Partition are same for PGS. Hence * disabling the tests */ @@ -825,7 +825,7 @@ public class WanValidationsDUnitTest extends WANTestBase { try { vm2.invoke(() -> WANTestBase.createConcurrentSender( "ln", 2, true, 100, 10, false, false, null, true, 5, OrderPolicy.PARTITION )); - fail("Expected IllegateStateException : order policy Should match"); + fail("Expected IllegalStateException : order policy Should match"); } catch (Exception e) { if (!(e.getCause() instanceof IllegalStateException) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/6f37769c/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationConcurrentOpsOffHeapDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationConcurrentOpsOffHeapDUnitTest.java b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationConcurrentOpsOffHeapDUnitTest.java new file mode 100644 index 0000000..1dca0c9 --- /dev/null +++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/offheap/ParallelWANPropagationConcurrentOpsOffHeapDUnitTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gemstone.gemfire.internal.cache.wan.offheap; + +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 com.gemstone.gemfire.internal.cache.wan.parallel.ParallelWANPropagationConcurrentOpsDUnitTest; + +@SuppressWarnings("serial") +@Category(DistributedTest.class) +public class ParallelWANPropagationConcurrentOpsOffHeapDUnitTest extends + ParallelWANPropagationConcurrentOpsDUnitTest { + + public ParallelWANPropagationConcurrentOpsOffHeapDUnitTest() { + super(); + } + + @Override + public boolean isOffHeap() { + return true; + } + +}
