GEODE-1050: add JUnit 4 versions of DistributedTestCase and CacheTestCase * refactor DistributedTestCase into two implementations that delegate: JUnit3DistributedTestCase and JUnit4DistributedTestCase * refactor CacheTestCase into two implementations that delegate: JUnit3CacheTestCase and JUnit4CacheTestCase * refactor super.setUp() hierarchy into template method chain like tearDown() * change all variables in CacheTestCase and DistributedTestCase to private and use methods to access them * change some tests to use getDistributedSystemProperties() and getSystem()
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/57c8600b Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/57c8600b Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/57c8600b Branch: refs/heads/develop Commit: 57c8600be29ab1d61f499f4e53c40e2fe3f8c605 Parents: 09cd330 Author: Kirk Lund <[email protected]> Authored: Fri Mar 18 14:45:06 2016 -0700 Committer: Kirk Lund <[email protected]> Committed: Fri Mar 18 14:45:06 2016 -0700 ---------------------------------------------------------------------- .../LauncherLifecycleCommandsDUnitTest.java | 7 +- ...stAPIOnRegionFunctionExecutionDUnitTest.java | 64 +- .../web/controllers/RestAPITestBase.java | 15 +- .../RestAPIsAndInterOpsDUnitTest.java | 4 +- ...tAPIsOnGroupsFunctionExecutionDUnitTest.java | 4 - ...APIsOnMembersFunctionExecutionDUnitTest.java | 5 - .../controllers/RestAPIsWithSSLDUnitTest.java | 4 +- .../cache/CacheRegionClearStatsDUnitTest.java | 6 +- .../cache/ClientServerTimeSyncDUnitTest.java | 4 +- .../cache/ConnectionPoolAndLoaderDUnitTest.java | 6 +- .../cache/ConnectionPoolAutoDUnitTest.java | 7 +- .../gemfire/cache/ConnectionPoolDUnitTest.java | 10 +- .../ClientServerRegisterInterestsDUnitTest.java | 5 +- .../internal/AutoConnectionSourceDUnitTest.java | 6 +- .../CacheServerSSLConnectionDUnitTest.java | 130 +-- .../cache/client/internal/LocatorTestBase.java | 2 +- .../internal/SSLNoClientAuthDUnitTest.java | 7 +- .../management/MemoryThresholdsDUnitTest.java | 3 +- .../MemoryThresholdsOffHeapDUnitTest.java | 6 +- .../query/dunit/CompactRangeIndexDUnitTest.java | 9 +- .../cache/query/dunit/HashIndexDUnitTest.java | 6 +- ...itionedRegionCompactRangeIndexDUnitTest.java | 7 +- .../dunit/QueryDataInconsistencyDUnitTest.java | 13 +- .../dunit/QueryIndexUsingXMLDUnitTest.java | 26 +- .../QueryUsingFunctionContextDUnitTest.java | 12 +- .../query/dunit/QueryUsingPoolDUnitTest.java | 27 +- .../cache/query/dunit/RemoteQueryDUnitTest.java | 43 +- ...esourceManagerWithQueryMonitorDUnitTest.java | 3 +- ...pdateWithInplaceObjectModFalseDUnitTest.java | 5 +- ...ConcurrentIndexUpdateWithoutWLDUnitTest.java | 6 +- .../index/CopyOnReadIndexDUnitTest.java | 10 +- .../index/MultiIndexCreationDUnitTest.java | 8 +- .../index/PutAllWithIndexPerfDUnitTest.java | 6 +- .../snapshot/ParallelSnapshotDUnitTest.java | 8 +- .../snapshot/SnapshotByteArrayDUnitTest.java | 6 +- .../cache/snapshot/SnapshotDUnitTest.java | 6 +- .../snapshot/SnapshotPerformanceDUnitTest.java | 6 +- .../gemfire/cache30/CacheMapTxnDUnitTest.java | 9 +- .../gemstone/gemfire/cache30/CacheTestCase.java | 623 +---------- .../gemfire/cache30/CacheXmlTestCase.java | 8 +- .../cache30/CachedAllEventsDUnitTest.java | 26 +- .../cache30/ClearMultiVmCallBkDUnitTest.java | 6 +- .../gemfire/cache30/ClearMultiVmDUnitTest.java | 5 +- .../cache30/ClientMembershipDUnitTest.java | 10 +- .../ClientRegisterInterestDUnitTest.java | 2 +- .../cache30/ClientServerCCEDUnitTest.java | 2 +- .../gemfire/cache30/ClientServerTestCase.java | 15 +- .../cache30/DistAckMapMethodsDUnitTest.java | 5 +- ...tedAckOverflowRegionCCEOffHeapDUnitTest.java | 2 +- ...dAckPersistentRegionCCEOffHeapDUnitTest.java | 2 +- ...DistributedAckRegionCCEOffHeapDUnitTest.java | 2 +- .../DistributedAckRegionOffHeapDUnitTest.java | 2 +- .../DistributedMulticastRegionDUnitTest.java | 5 +- ...stributedNoAckRegionCCEOffHeapDUnitTest.java | 2 +- .../DistributedNoAckRegionOffHeapDUnitTest.java | 2 +- .../gemfire/cache30/DynamicRegionDUnitTest.java | 8 +- .../GlobalRegionCCEOffHeapDUnitTest.java | 2 +- .../cache30/GlobalRegionOffHeapDUnitTest.java | 2 +- .../gemfire/cache30/MultiVMRegionTestCase.java | 13 +- .../OffHeapLRUEvictionControllerDUnitTest.java | 2 +- .../PartitionedRegionOffHeapDUnitTest.java | 2 +- .../cache30/PutAllCallBkRemoteVMDUnitTest.java | 5 +- .../cache30/PutAllCallBkSingleVMDUnitTest.java | 5 +- .../gemfire/cache30/PutAllMultiVmDUnitTest.java | 5 +- .../gemfire/cache30/ReconnectDUnitTest.java | 17 +- .../ReconnectedCacheServerDUnitTest.java | 23 +- .../RegionMembershipListenerDUnitTest.java | 7 +- .../cache30/RegionReliabilityTestCase.java | 2 +- .../gemfire/cache30/RegionTestCase.java | 2 +- .../cache30/RemoveAllMultiVmDUnitTest.java | 5 +- .../gemfire/cache30/SearchAndLoadDUnitTest.java | 2 +- .../gemfire/cache30/SlowRecDUnitTest.java | 13 +- .../gemfire/cache30/TXDistributedDUnitTest.java | 4 +- .../distributed/DistributedMemberDUnitTest.java | 39 +- .../distributed/DistributedSystemDUnitTest.java | 76 +- .../distributed/HostedLocatorsDUnitTest.java | 7 +- .../gemfire/distributed/LocatorDUnitTest.java | 15 +- .../distributed/SystemAdminDUnitTest.java | 47 +- .../distributed/internal/Bug40751DUnitTest.java | 2 +- .../ConsoleDistributionManagerDUnitTest.java | 8 +- .../internal/DistributionAdvisorDUnitTest.java | 8 +- .../internal/DistributionManagerDUnitTest.java | 42 +- .../internal/ProductUseLogDUnitTest.java | 66 +- .../GemFireDeadlockDetectorDUnitTest.java | 2 +- .../TcpServerBackwardCompatDUnitTest.java | 5 +- .../gemfire/disttx/CacheMapDistTXDUnitTest.java | 17 +- .../disttx/DistTXDebugDUnitDisabledTest.java | 1016 ++++++++++++++++++ .../gemfire/disttx/DistTXDebugDUnitTest.java | 1014 ----------------- .../disttx/DistTXDistributedTestSuite.java | 42 - .../disttx/DistTXPersistentDebugDUnitTest.java | 15 +- .../disttx/DistributedTransactionDUnitTest.java | 13 +- ...wardCompatibilitySerializationDUnitTest.java | 8 +- .../gemfire/internal/JarDeployerDUnitTest.java | 2 +- .../gemfire/internal/cache/BackupDUnitTest.java | 2 +- .../internal/cache/Bug33359DUnitTest.java | 5 +- .../internal/cache/Bug33726DUnitTest.java | 2 +- .../internal/cache/Bug37241DUnitTest.java | 8 +- .../internal/cache/Bug37377DUnitTest.java | 10 +- .../internal/cache/Bug39079DUnitTest.java | 13 +- .../internal/cache/Bug40299DUnitTest.java | 8 +- .../internal/cache/Bug41091DUnitTest.java | 2 +- .../internal/cache/Bug41733DUnitTest.java | 2 +- .../internal/cache/Bug41957DUnitTest.java | 2 +- .../internal/cache/Bug45164DUnitTest.java | 6 +- .../internal/cache/Bug47667DUnitTest.java | 3 +- .../internal/cache/CacheAdvisorDUnitTest.java | 6 +- .../internal/cache/ClearDAckDUnitTest.java | 5 +- .../internal/cache/ClearGlobalDUnitTest.java | 6 +- .../cache/ClientServerGetAllDUnitTest.java | 2 +- ...ServerInvalidAndDestroyedEntryDUnitTest.java | 6 +- .../ClientServerTransactionCCEDUnitTest.java | 7 +- .../cache/ClientServerTransactionDUnitTest.java | 12 +- .../ConcurrentDestroySubRegionDUnitTest.java | 3 +- .../cache/ConnectDisconnectDUnitTest.java | 2 +- .../cache/DeltaPropagationDUnitTest.java | 7 +- .../cache/DeltaPropagationStatsDUnitTest.java | 6 +- .../cache/DiskRegByteArrayDUnitTest.java | 9 +- ...DistrbutedRegionProfileOffHeapDUnitTest.java | 2 +- .../cache/DistributedCacheTestCase.java | 10 +- .../internal/cache/EventTrackerDUnitTest.java | 2 +- .../cache/EvictionObjectSizerDUnitTest.java | 5 - .../internal/cache/EvictionStatsDUnitTest.java | 4 +- .../internal/cache/EvictionTestBase.java | 4 +- .../internal/cache/GIIDeltaDUnitTest.java | 8 +- .../internal/cache/GIIFlowControlDUnitTest.java | 2 +- .../HAOverflowMemObjectSizerDUnitTest.java | 6 +- .../cache/IncrementalBackupDUnitTest.java | 6 +- .../cache/InterruptClientServerDUnitTest.java | 4 +- .../internal/cache/InterruptsDUnitTest.java | 4 +- .../cache/OffHeapEvictionDUnitTest.java | 2 +- .../cache/OffHeapEvictionStatsDUnitTest.java | 2 +- .../cache/P2PDeltaPropagationDUnitTest.java | 9 +- .../cache/PartitionedRegionAPIDUnitTest.java | 43 +- ...gionBucketCreationDistributionDUnitTest.java | 67 +- .../cache/PartitionedRegionDUnitTestCase.java | 2 +- ...rtitionedRegionDelayedRecoveryDUnitTest.java | 2 +- ...rtitionedRegionOffHeapEvictionDUnitTest.java | 2 +- ...artitionedRegionRedundancyZoneDUnitTest.java | 2 +- .../PartitionedRegionSingleHopDUnitTest.java | 22 +- ...RegionSingleHopWithServerGroupDUnitTest.java | 21 +- .../internal/cache/PutAllDAckDUnitTest.java | 5 +- .../internal/cache/PutAllGlobalDUnitTest.java | 5 +- .../cache/RemoteTransactionDUnitTest.java | 14 +- .../internal/cache/RemoveAllDAckDUnitTest.java | 5 +- .../internal/cache/RemoveDAckDUnitTest.java | 5 +- .../internal/cache/RemoveGlobalDUnitTest.java | 5 +- .../internal/cache/SingleHopStatsDUnitTest.java | 20 +- .../internal/cache/SystemFailureDUnitTest.java | 6 +- .../control/RebalanceOperationDUnitTest.java | 2 +- .../cache/execute/Bug51193DUnitTest.java | 6 +- .../ClientServerFunctionExecutionDUnitTest.java | 5 +- .../execute/ColocationFailoverDUnitTest.java | 6 +- ...ributedRegionFunctionExecutionDUnitTest.java | 5 +- .../execute/FunctionServiceStatsDUnitTest.java | 4 +- .../cache/execute/LocalDataSetDUnitTest.java | 18 +- .../execute/LocalDataSetIndexingDUnitTest.java | 3 +- .../LocalFunctionExecutionDUnitTest.java | 13 +- .../MemberFunctionExecutionDUnitTest.java | 7 +- .../MultiRegionFunctionExecutionDUnitTest.java | 7 +- .../OnGroupsFunctionExecutionDUnitTest.java | 2 +- ...ntServerFunctionExecutionNoAckDUnitTest.java | 3 - ...tServerRegionFunctionExecutionDUnitTest.java | 5 - ...egionFunctionExecutionFailoverDUnitTest.java | 3 +- ...onFunctionExecutionNoSingleHopDUnitTest.java | 4 - ...onExecutionSelectorNoSingleHopDUnitTest.java | 4 - ...gionFunctionExecutionSingleHopDUnitTest.java | 3 +- .../cache/execute/PRClientServerTestBase.java | 22 +- .../cache/execute/PRColocationDUnitTest.java | 5 +- .../cache/execute/PRTransactionDUnitTest.java | 2 +- .../execute/SingleHopGetAllPutAllDUnitTest.java | 5 - .../cache/ha/Bug36853EventsExpiryDUnitTest.java | 20 +- .../internal/cache/ha/Bug48571DUnitTest.java | 6 +- .../internal/cache/ha/Bug48879DUnitTest.java | 6 +- .../cache/ha/EventIdOptimizationDUnitTest.java | 7 +- .../internal/cache/ha/FailoverDUnitTest.java | 7 +- .../internal/cache/ha/HABugInPutDUnitTest.java | 11 +- .../internal/cache/ha/HAClearDUnitTest.java | 8 +- .../cache/ha/HAConflationDUnitTest.java | 46 +- .../internal/cache/ha/HADuplicateDUnitTest.java | 7 +- .../cache/ha/HAEventIdPropagationDUnitTest.java | 7 +- .../internal/cache/ha/HAExpiryDUnitTest.java | 8 +- .../internal/cache/ha/HAGIIBugDUnitTest.java | 8 +- .../internal/cache/ha/HAGIIDUnitTest.java | 7 +- .../cache/ha/HARQueueNewImplDUnitTest.java | 7 +- .../internal/cache/ha/HARegionDUnitTest.java | 7 +- .../cache/ha/HARegionQueueDUnitTest.java | 7 +- .../cache/ha/HASlowReceiverDUnitTest.java | 7 +- .../ha/OperationsPropagationDUnitTest.java | 8 +- .../internal/cache/ha/PutAllDUnitTest.java | 7 +- .../internal/cache/ha/StatsBugDUnitTest.java | 7 +- .../cache/locks/TXLockServiceDUnitTest.java | 7 +- .../cache/partitioned/Bug43684DUnitTest.java | 6 +- .../cache/partitioned/Bug47388DUnitTest.java | 6 +- .../cache/partitioned/Bug51400DUnitTest.java | 7 +- .../partitioned/PartitionResolverDUnitTest.java | 6 +- .../PartitionedRegionLoaderWriterDUnitTest.java | 5 - ...tentColocatedPartitionedRegionDUnitTest.java | 8 +- .../PersistentPartitionedRegionTestBase.java | 7 +- ...rtitionedRegionWithTransactionDUnitTest.java | 6 +- .../cache/partitioned/ShutdownAllDUnitTest.java | 4 +- .../fixed/FixedPartitioningDUnitTest.java | 5 +- .../fixed/FixedPartitioningTestBase.java | 2 +- ...ngWithColocationAndPersistenceDUnitTest.java | 5 +- .../PersistentReplicatedTestBase.java | 5 +- .../internal/cache/tier/Bug40396DUnitTest.java | 6 +- ...mpatibilityHigherVersionClientDUnitTest.java | 5 +- .../cache/tier/sockets/Bug36269DUnitTest.java | 7 +- .../cache/tier/sockets/Bug36457DUnitTest.java | 8 +- .../cache/tier/sockets/Bug36805DUnitTest.java | 8 +- .../cache/tier/sockets/Bug36829DUnitTest.java | 6 +- .../cache/tier/sockets/Bug36995DUnitTest.java | 8 +- .../cache/tier/sockets/Bug37210DUnitTest.java | 8 +- .../cache/tier/sockets/Bug37805DUnitTest.java | 6 +- .../CacheServerTransactionsDUnitTest.java | 7 +- .../tier/sockets/ClearPropagationDUnitTest.java | 7 +- .../tier/sockets/ClientConflationDUnitTest.java | 6 +- .../sockets/ClientInterestNotifyDUnitTest.java | 10 +- .../tier/sockets/ClientServerMiscDUnitTest.java | 13 +- .../cache/tier/sockets/ConflationDUnitTest.java | 6 +- .../DataSerializerPropogationDUnitTest.java | 5 +- .../DestroyEntryPropagationDUnitTest.java | 8 +- .../sockets/DurableClientBug39997DUnitTest.java | 16 +- .../DurableClientQueueSizeDUnitTest.java | 5 +- .../DurableClientReconnectDUnitTest.java | 8 +- .../sockets/DurableClientStatsDUnitTest.java | 5 +- .../sockets/DurableRegistrationDUnitTest.java | 6 +- .../sockets/DurableResponseMatrixDUnitTest.java | 7 +- .../sockets/EventIDVerificationDUnitTest.java | 8 +- .../EventIDVerificationInP2PDUnitTest.java | 7 +- ...ForceInvalidateOffHeapEvictionDUnitTest.java | 2 +- .../cache/tier/sockets/HABug36738DUnitTest.java | 178 +-- .../cache/tier/sockets/HAInterestTestCase.java | 5 +- .../sockets/HAStartupAndFailoverDUnitTest.java | 9 +- .../InstantiatorPropagationDUnitTest.java | 6 +- .../tier/sockets/InterestListDUnitTest.java | 8 +- .../sockets/InterestListEndpointDUnitTest.java | 7 +- .../sockets/InterestListFailoverDUnitTest.java | 6 +- .../sockets/InterestListRecoveryDUnitTest.java | 7 +- .../sockets/InterestRegrListenerDUnitTest.java | 6 +- .../sockets/InterestResultPolicyDUnitTest.java | 7 +- .../sockets/NewRegionAttributesDUnitTest.java | 6 +- .../tier/sockets/RedundancyLevelTestBase.java | 8 +- .../tier/sockets/RegionCloseDUnitTest.java | 8 +- ...erInterestBeforeRegionCreationDUnitTest.java | 11 +- .../sockets/RegisterInterestKeysDUnitTest.java | 7 +- .../sockets/ReliableMessagingDUnitTest.java | 10 +- .../sockets/UnregisterInterestDUnitTest.java | 6 +- .../sockets/UpdatePropagationDUnitTest.java | 7 +- .../VerifyEventIDGenerationInP2PDUnitTest.java | 7 +- ...UpdatesFromNonInterestEndPointDUnitTest.java | 9 +- .../cache/wan/AsyncEventQueueTestBase.java | 32 +- .../asyncqueue/AsyncEventListenerDUnitTest.java | 4 - .../AsyncEventQueueStatsDUnitTest.java | 4 - .../ConcurrentAsyncEventQueueDUnitTest.java | 4 - .../CommonParallelAsyncEventQueueDUnitTest.java | 4 - .../CompressionCacheConfigDUnitTest.java | 5 - .../CompressionCacheListenerDUnitTest.java | 5 +- .../CompressionRegionConfigDUnitTest.java | 5 - .../CompressionRegionFactoryDUnitTest.java | 5 - .../CompressionRegionOperationsDUnitTest.java | 6 +- .../internal/jta/dunit/ExceptionsDUnitTest.java | 6 +- .../jta/dunit/IdleTimeOutDUnitTest.java | 6 +- .../jta/dunit/MaxPoolSizeDUnitTest.java | 6 +- .../jta/dunit/TransactionTimeOutDUnitTest.java | 6 +- .../dunit/TxnManagerMultiThreadDUnitTest.java | 7 +- .../internal/jta/dunit/TxnTimeOutDUnitTest.java | 10 +- .../offheap/OutOfOffHeapMemoryDUnitTest.java | 9 +- .../process/LocalProcessLauncherDUnitTest.java | 3 +- .../statistics/StatisticsDUnitTest.java | 9 +- .../management/CacheManagementDUnitTest.java | 5 - .../management/ClientHealthStatsDUnitTest.java | 9 +- .../management/CompositeTypeTestDUnitTest.java | 5 - .../management/DLockManagementDUnitTest.java | 5 - .../management/DiskManagementDUnitTest.java | 5 +- .../management/DistributedSystemDUnitTest.java | 6 - .../management/LocatorManagementDUnitTest.java | 4 +- .../gemfire/management/ManagementTestBase.java | 12 +- .../MemberMBeanAttributesDUnitTest.java | 5 - .../management/OffHeapManagementDUnitTest.java | 5 +- .../gemfire/management/QueryDataDUnitTest.java | 6 +- .../management/RegionManagementDUnitTest.java | 5 - ...ersalMembershipListenerAdapterDUnitTest.java | 6 +- .../stats/DistributedSystemStatsDUnitTest.java | 6 +- .../internal/cli/CliUtilDUnitTest.java | 2 +- .../cli/commands/CliCommandTestBase.java | 6 +- .../cli/commands/ConfigCommandsDUnitTest.java | 2 +- .../cli/commands/DeployCommandsDUnitTest.java | 4 +- ...WithCacheLoaderDuringCacheMissDUnitTest.java | 4 +- ...stAndDescribeDiskStoreCommandsDUnitTest.java | 3 +- .../cli/commands/ListIndexCommandDUnitTest.java | 3 +- .../cli/commands/MemberCommandsDUnitTest.java | 5 +- .../cli/commands/QueueCommandsDUnitTest.java | 4 +- .../SharedConfigurationCommandsDUnitTest.java | 2 +- .../cli/commands/ShellCommandsDUnitTest.java | 4 +- .../cli/commands/ShowDeadlockDUnitTest.java | 7 +- .../cli/commands/UserCommandsDUnitTest.java | 5 +- .../SharedConfigurationDUnitTest.java | 2 +- .../internal/pulse/TestClientIdsDUnitTest.java | 6 +- .../internal/pulse/TestFunctionsDUnitTest.java | 5 - .../internal/pulse/TestHeapDUnitTest.java | 7 +- .../internal/pulse/TestLocatorsDUnitTest.java | 5 - .../pulse/TestSubscriptionsDUnitTest.java | 6 +- .../ClientsWithVersioningRetryDUnitTest.java | 5 +- .../pdx/JSONPdxClientServerDUnitTest.java | 2 +- .../gemfire/pdx/PdxSerializableDUnitTest.java | 6 - .../gemfire/pdx/PdxTypeExportDUnitTest.java | 6 +- .../gemfire/redis/RedisDistDUnitTest.java | 5 +- .../security/ClientAuthenticationDUnitTest.java | 6 +- .../security/ClientAuthorizationDUnitTest.java | 6 +- .../security/ClientMultiUserAuthzDUnitTest.java | 7 +- .../DeltaClientAuthorizationDUnitTest.java | 6 +- .../DeltaClientPostAuthorizationDUnitTest.java | 7 +- .../security/P2PAuthenticationDUnitTest.java | 5 +- .../gemfire/security/SecurityTestUtil.java | 10 +- .../gemfire/test/dunit/DistributedTestCase.java | 503 +-------- .../dunit/cache/internal/CacheTestFixture.java | 40 + .../cache/internal/JUnit3CacheTestCase.java | 223 ++++ .../cache/internal/JUnit4CacheTestCase.java | 567 ++++++++++ .../dunit/internal/DistributedTestFixture.java | 87 ++ .../internal/JUnit3DistributedTestCase.java | 247 +++++ .../internal/JUnit4DistributedTestCase.java | 610 +++++++++++ .../internal/tests/JUnit3BasicDUnitTest.java | 189 ++++ .../JUnit3GetDefaultDiskStoreNameDUnitTest.java | 66 ++ .../tests/JUnit3GetTestMethodNameDUnitTest.java | 53 + .../dunit/internal/tests/JUnit3VMDUnitTest.java | 192 ++++ .../internal/tests/JUnit4BasicDUnitTest.java | 202 ++++ .../JUnit4GetDefaultDiskStoreNameDUnitTest.java | 65 ++ .../tests/JUnit4GetTestMethodNameDUnitTest.java | 52 + .../dunit/internal/tests/JUnit4VMDUnitTest.java | 200 ++++ .../test/dunit/tests/BasicDUnitTest.java | 201 ++-- .../tests/GetDefaultDiskStoreNameDUnitTest.java | 12 +- .../dunit/tests/GetTestMethodNameDUnitTest.java | 8 +- ...ingGetPropertiesDisconnectsAllDUnitTest.java | 57 + .../gemfire/test/dunit/tests/VMDUnitTest.java | 192 ++-- .../cache/query/cq/dunit/CqDataDUnitTest.java | 12 +- .../dunit/CqDataOptimizedExecuteDUnitTest.java | 8 +- .../cq/dunit/CqDataUsingPoolDUnitTest.java | 18 +- ...qDataUsingPoolOptimizedExecuteDUnitTest.java | 12 +- .../cache/query/cq/dunit/CqPerfDUnitTest.java | 9 +- .../cq/dunit/CqPerfUsingPoolDUnitTest.java | 9 +- .../cache/query/cq/dunit/CqQueryDUnitTest.java | 12 +- .../dunit/CqQueryOptimizedExecuteDUnitTest.java | 8 +- .../cq/dunit/CqQueryUsingPoolDUnitTest.java | 12 +- ...QueryUsingPoolOptimizedExecuteDUnitTest.java | 6 +- .../cq/dunit/CqResultSetUsingPoolDUnitTest.java | 20 +- ...ltSetUsingPoolOptimizedExecuteDUnitTest.java | 8 +- .../cache/query/cq/dunit/CqStatsDUnitTest.java | 12 +- .../dunit/CqStatsOptimizedExecuteDUnitTest.java | 8 +- .../cq/dunit/CqStatsUsingPoolDUnitTest.java | 12 +- ...StatsUsingPoolOptimizedExecuteDUnitTest.java | 8 +- ...dRegionCqQueryOptimizedExecuteDUnitTest.java | 6 +- .../PrCqUsingPoolOptimizedExecuteDUnitTest.java | 8 +- .../cache/query/dunit/PdxQueryCQTestBase.java | 2 +- .../query/dunit/QueryMonitorDUnitTest.java | 2 +- .../cache/snapshot/ClientSnapshotDUnitTest.java | 6 +- .../cache/PRDeltaPropagationDUnitTest.java | 6 +- .../cache/RemoteCQTransactionDUnitTest.java | 2 +- .../internal/cache/ha/CQListGIIDUnitTest.java | 7 +- .../cache/ha/HADispatcherDUnitTest.java | 8 +- .../sockets/ClientToServerDeltaDUnitTest.java | 5 +- .../DeltaPropagationWithCQDUnitTest.java | 6 +- ...ToRegionRelationCQRegistrationDUnitTest.java | 6 +- .../sockets/DurableClientCrashDUnitTest.java | 4 +- .../tier/sockets/DurableClientTestCase.java | 11 +- .../CacheServerManagementDUnitTest.java | 4 +- .../cli/commands/ClientCommandsDUnitTest.java | 2 +- .../DurableClientCommandsDUnitTest.java | 2 +- .../internal/pulse/TestCQDUnitTest.java | 5 - .../internal/pulse/TestClientsDUnitTest.java | 5 - .../internal/pulse/TestServerDUnitTest.java | 5 - .../ClientAuthorizationTwoDUnitTest.java | 6 +- .../security/ClientAuthzObjectModDUnitTest.java | 10 +- .../ClientCQPostAuthorizationDUnitTest.java | 7 +- .../ClientPostAuthorizationDUnitTest.java | 7 +- .../gemfire/security/MultiuserAPIDUnitTest.java | 6 +- .../MultiuserDurableCQAuthzDUnitTest.java | 4 +- .../LuceneFunctionReadPathDUnitTest.java | 3 +- .../internal/cache/UpdateVersionDUnitTest.java | 10 +- .../gemfire/internal/cache/wan/WANTestBase.java | 85 +- ...oncurrentParallelGatewaySenderDUnitTest.java | 4 - ...allelGatewaySenderOperation_1_DUnitTest.java | 6 +- ...allelGatewaySenderOperation_2_DUnitTest.java | 6 +- .../cache/wan/disttx/DistTXWANDUnitTest.java | 6 +- ...wWANConcurrencyCheckForDestroyDUnitTest.java | 4 - .../cache/wan/misc/PDXNewWanDUnitTest.java | 4 - .../SenderWithTransportFilterDUnitTest.java | 6 +- ...downAllPersistentGatewaySenderDUnitTest.java | 3 +- .../wan/misc/WANLocatorServerDUnitTest.java | 11 +- .../cache/wan/misc/WANSSLDUnitTest.java | 4 - .../wan/misc/WanAutoDiscoveryDUnitTest.java | 5 +- .../cache/wan/misc/WanValidationsDUnitTest.java | 4 - ...arallelGatewaySenderOperationsDUnitTest.java | 6 +- ...llelGatewaySenderQueueOverflowDUnitTest.java | 8 +- .../ParallelWANConflationDUnitTest.java | 4 +- ...ersistenceEnabledGatewaySenderDUnitTest.java | 6 +- ...llelWANPropagationClientServerDUnitTest.java | 4 - ...lelWANPropagationConcurrentOpsDUnitTest.java | 4 - .../ParallelWANPropagationDUnitTest.java | 4 - ...ParallelWANPropagationLoopBackDUnitTest.java | 4 - .../wan/parallel/ParallelWANStatsDUnitTest.java | 4 +- ...tewaySenderDistributedDeadlockDUnitTest.java | 4 - ...rialGatewaySenderEventListenerDUnitTest.java | 4 - .../SerialGatewaySenderOperationsDUnitTest.java | 4 +- .../SerialGatewaySenderQueueDUnitTest.java | 9 +- ...ersistenceEnabledGatewaySenderDUnitTest.java | 4 - .../SerialWANPropagationLoopBackDUnitTest.java | 4 - .../serial/SerialWANPropogationDUnitTest.java | 4 +- ...NPropogation_PartitionedRegionDUnitTest.java | 5 - .../SerialWANPropogationsFeatureDUnitTest.java | 4 - .../wan/serial/SerialWANStatsDUnitTest.java | 4 +- .../wan/wancommand/WANCommandTestBase.java | 42 +- ...anCommandCreateGatewayReceiverDUnitTest.java | 24 +- .../WanCommandCreateGatewaySenderDUnitTest.java | 24 +- ...WanCommandGatewayReceiverStartDUnitTest.java | 14 +- .../WanCommandGatewayReceiverStopDUnitTest.java | 14 +- .../WanCommandGatewaySenderStartDUnitTest.java | 16 +- .../WanCommandGatewaySenderStopDUnitTest.java | 14 +- .../wan/wancommand/WanCommandListDUnitTest.java | 14 +- .../WanCommandPauseResumeDUnitTest.java | 24 +- .../wancommand/WanCommandStatusDUnitTest.java | 16 +- 420 files changed, 5646 insertions(+), 4402 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java index f0eaaac..36f63b0 100644 --- a/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java +++ b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsDUnitTest.java @@ -145,12 +145,7 @@ public class LauncherLifecycleCommandsDUnitTest extends CliCommandTestBase { } @Override - public void setUp() throws Exception { - super.setUp(); - } - - @Override - protected final void postTearDown() throws Exception { + public final void postTearDown() throws Exception { LauncherLifecycleCommands launcherLifecycleCommands = new LauncherLifecycleCommands(); Integer pid; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java index ed622e8..d04a1b1 100644 --- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java +++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIOnRegionFunctionExecutionDUnitTest.java @@ -50,10 +50,6 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { super(name); } - public void setUp() throws Exception { - super.setUp(); - } - private class SampleFunction extends RestFunctionTemplate { public static final String Id = "SampleFunction"; @@ -63,22 +59,22 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { if (context instanceof RegionFunctionContext) { RegionFunctionContext rfContext = (RegionFunctionContext) context; rfContext.getDataSet().getCache().getLogger() - .info("Executing function : SampleFunction.execute(hasResult=true) with filter: " + rfContext.getFilter() + " " + rfContext); + .info("Executing function : SampleFunction.execute(hasResult=true) with filter: " + rfContext.getFilter() + " " + rfContext); if (rfContext.getArguments() instanceof Boolean) { /* return rfContext.getArguments(); */ if (hasResult()) { rfContext.getResultSender().lastResult( - (Serializable) rfContext.getArguments()); + (Serializable) rfContext.getArguments()); } else { rfContext - .getDataSet() - .getCache() - .getLogger() - .info( - "Executing function : SampleFunction.execute(hasResult=false) " + rfContext); + .getDataSet() + .getCache() + .getLogger() + .info( + "Executing function : SampleFunction.execute(hasResult=false) " + rfContext); while (true && !rfContext.getDataSet().isDestroyed()) { rfContext.getDataSet().getCache().getLogger() - .info("For Bug43513 "); + .info("For Bug43513 "); try { Thread.sleep(100); } catch (InterruptedException ie) { @@ -95,7 +91,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { Thread.sleep(2000); } catch (InterruptedException e) { rfContext.getDataSet().getCache().getLogger() - .warning("Got Exception : Thread Interrupted" + e); + .warning("Got Exception : Thread Interrupted" + e); } } if (PartitionRegionHelper.isPartitionedRegion(rfContext.getDataSet())) { @@ -105,11 +101,11 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { * rfContext).get(key); */ rfContext.getResultSender().lastResult( - (Serializable) PartitionRegionHelper.getLocalDataForContext( - rfContext).get(key)); + (Serializable) PartitionRegionHelper.getLocalDataForContext( + rfContext).get(key)); } else { rfContext.getResultSender().lastResult( - (Serializable) rfContext.getDataSet().get(key)); + (Serializable) rfContext.getDataSet().get(key)); } /* return (Serializable)rfContext.getDataSet().get(key); */ } else if (rfContext.getArguments() instanceof Set) { @@ -117,7 +113,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { ArrayList vals = new ArrayList(); for (Object key : origKeys) { Object val = PartitionRegionHelper - .getLocalDataForContext(rfContext).get(key); + .getLocalDataForContext(rfContext).get(key); if (val != null) { vals.add(val); } @@ -141,10 +137,10 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { DistributedSystem ds = InternalDistributedSystem.getAnyInstance(); LogWriter logger = ds.getLogWriter(); logger.info("Executing in SampleFunction on Server : " - + ds.getDistributedMember() + "with Context : " + context); + + ds.getDistributedMember() + "with Context : " + context); while (ds.isConnected()) { logger - .fine("Just executing function in infinite loop for Bug43513"); + .fine("Just executing function in infinite loop for Bug43513"); try { Thread.sleep(250); } catch (InterruptedException e) { @@ -187,7 +183,7 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { private boolean createPeerWithPR() { RegionAttributes ra = PartitionedRegionTestHelper.createRegionAttrsForPR(0, - 10); + 10); AttributesFactory raf = new AttributesFactory(ra); PartitionAttributesImpl pa = new PartitionAttributesImpl(); pa.setAll(ra.getPartitionAttributes()); @@ -313,13 +309,13 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { vm3.invoke("populatePRRegion",() -> populatePRRegion()); String jsonBody = "[" - + "{\"@type\": \"double\",\"@value\": 210}" - + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\"," - + "\"itemNo\":\"599\",\"description\":\"Part X Free on Bumper Offer\"," - + "\"quantity\":\"2\"," - + "\"unitprice\":\"5\"," - + "\"totalprice\":\"10.00\"}" - + "]"; + + "{\"@type\": \"double\",\"@value\": 210}" + + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\"," + + "\"itemNo\":\"599\",\"description\":\"Part X Free on Bumper Offer\"," + + "\"quantity\":\"2\"," + + "\"unitprice\":\"5\"," + + "\"totalprice\":\"10.00\"}" + + "]"; CloseableHttpResponse response = executeFunctionThroughRestCall("SampleFunction", PR_REGION_NAME, null, jsonBody, null, null); assertEquals(200, response.getStatusLine().getStatusCode()); @@ -329,13 +325,13 @@ public class RestAPIOnRegionFunctionExecutionDUnitTest extends RestAPITestBase { assertCorrectInvocationCount(4, vm0, vm1, vm2, vm3); jsonBody = "[" - + "{\"@type\": \"double\",\"@value\": 220}" - + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\"," - + "\"itemNo\":\"609\",\"description\":\"Part X Free on Bumper Offer\"," - + "\"quantity\":\"3\"," - + "\"unitprice\":\"9\"," - + "\"totalprice\":\"12.00\"}" - + "]"; + + "{\"@type\": \"double\",\"@value\": 220}" + + ",{\"@type\":\"com.gemstone.gemfire.rest.internal.web.controllers.Item\"," + + "\"itemNo\":\"609\",\"description\":\"Part X Free on Bumper Offer\"," + + "\"quantity\":\"3\"," + + "\"unitprice\":\"9\"," + + "\"totalprice\":\"12.00\"}" + + "]"; resetInvocationCounts(vm0,vm1,vm2,vm3); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java index ba709b7..fc71fd8 100644 --- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java +++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPITestBase.java @@ -60,14 +60,13 @@ public class RestAPITestBase extends DistributedTestCase { } @Override - public void setUp() throws Exception { - super.setUp(); + public final void postSetUp() throws Exception { disconnectAllFromDS(); AgentUtil agentUtil = new AgentUtil(GemFireVersion.getGemFireVersion()); if (agentUtil.findWarLocation("geode-web-api") == null) { fail("unable to locate geode-web-api WAR file"); } - Wait.pause(1000); + Wait.pause(1000); // TODO: replace this with Awaitility final Host host = Host.getHost(0); vm0 = host.getVM(0); vm1 = host.getVM(1); @@ -76,13 +75,17 @@ public class RestAPITestBase extends DistributedTestCase { // gradle sets a property telling us where the build is located final String buildDir = System.getProperty("geode.build.dir", System.getProperty("user.dir")); Invoke.invokeInEveryVM(() -> System.setProperty("geode.build.dir", buildDir)); + postSetUpRestAPITestBase(); + } + + protected void postSetUpRestAPITestBase() throws Exception { } /** * close the clients and teh servers */ @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { vm0.invoke(() -> closeCache()); vm1.invoke(() -> closeCache()); vm2.invoke(() -> closeCache()); @@ -128,7 +131,7 @@ public class RestAPITestBase extends DistributedTestCase { } protected CloseableHttpResponse executeFunctionThroughRestCall(String function, String regionName, String filter, String jsonBody, String groups, - String members) { + String members) { LogWriterUtils.getLogWriter().info("Entering executeFunctionThroughRestCall"); try { CloseableHttpClient httpclient = HttpClients.createDefault(); @@ -196,7 +199,7 @@ public class RestAPITestBase extends DistributedTestCase { HttpEntity entity = response.getEntity(); InputStream content = entity.getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader( - content)); + content)); String line; StringBuffer sb = new StringBuffer(); while ((line = reader.readLine()) != null) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java index 0245fa0..fcdf5aa 100644 --- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java +++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java @@ -170,9 +170,9 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase { } - public void setUp() throws Exception { + @Override + public final void preSetUp() throws Exception { disconnectAllFromDS(); - super.setUp(); } @Override http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java index 0419c78..61e0925 100644 --- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java +++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnGroupsFunctionExecutionDUnitTest.java @@ -33,10 +33,6 @@ public class RestAPIsOnGroupsFunctionExecutionDUnitTest extends RestAPITestBase super(name); } - public void setUp() throws Exception { - super.setUp(); - } - @Override protected String getFunctionID() { return OnGroupsFunction.Id; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java index f8bf20e..ca01830 100644 --- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java +++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java @@ -38,11 +38,6 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase super(name); } - @Override - public void setUp() throws Exception { - super.setUp(); - } - private class OnMembersFunction extends RestFunctionTemplate { public static final String Id = "OnMembersFunction"; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java index 29aab32..852591f 100644 --- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java +++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java @@ -89,9 +89,9 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase { } - public void setUp() throws Exception { + @Override + public final void preSetUp() throws Exception { disconnectAllFromDS(); - super.setUp(); } @Override http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java index 88a32a3..73edcd2 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/CacheRegionClearStatsDUnitTest.java @@ -61,8 +61,8 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase { super(name); } - public void setUp() throws Exception { - super.setUp(); + @Override + public final void postSetUp() throws Exception { final Host host = Host.getHost(0); server1 = host.getVM(0); client1 = host.getVM(1); @@ -187,7 +187,7 @@ public class CacheRegionClearStatsDUnitTest extends DistributedTestCase { } @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { client1.invoke(() -> CacheRegionClearStatsDUnitTest.closeCache()); // then close the servers server1.invoke(() -> CacheRegionClearStatsDUnitTest.closeCache()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java index 8b04ab5..12f5340 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java @@ -74,7 +74,7 @@ public class ClientServerTimeSyncDUnitTest extends CacheTestCase { } // now set an artificial time offset for the test - system.getClock().setCacheTimeOffset(null, TEST_OFFSET, true); + basicGetSystem().getClock().setCacheTimeOffset(null, TEST_OFFSET, true); LogWriterUtils.getLogWriter().info("Done creating and starting CacheServer on port " + server.getPort()); return server.getPort(); @@ -151,7 +151,7 @@ public class ClientServerTimeSyncDUnitTest extends CacheTestCase { } // now set an artificial time offset for the test - system.getClock().setCacheTimeOffset(null, -TEST_OFFSET, true); + basicGetSystem().getClock().setCacheTimeOffset(null, -TEST_OFFSET, true); LogWriterUtils.getLogWriter().info("Done creating and starting CacheServer on port " + server.getPort()); return server.getPort(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java index ee382ab..9ce5bed 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAndLoaderDUnitTest.java @@ -48,12 +48,8 @@ public class ConnectionPoolAndLoaderDUnitTest extends CacheTestCase { super(name); } - public void setUp() throws Exception { - super.setUp(); - } - @Override - protected final void preTearDownCacheTestCase() { + public final void preTearDownCacheTestCase() { //TODO grid. This is a hack. The next dunit test to run after //this one is the ConnectionPoolAutoDUnit test. That ends up calling //getSystem() with no arguments and expects to get a system without http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java index bf5a22c..3b43ab8 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolAutoDUnitTest.java @@ -29,10 +29,9 @@ public class ConnectionPoolAutoDUnitTest extends ConnectionPoolDUnitTest { public ConnectionPoolAutoDUnitTest(String name) { super(name); } - - public void setUp() throws Exception { - super.setUp(); - // TODO Auto-generated method stub + + @Override + protected final void postSetUpConnectionPoolDUnitTest() throws Exception { ClientServerTestCase.AUTO_LOAD_BALANCE = true; Invoke.invokeInEveryVM(new SerializableRunnable("setupAutoMode") { public void run() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java index e09a4c9..2acab3a 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/ConnectionPoolDUnitTest.java @@ -106,8 +106,8 @@ public class ConnectionPoolDUnitTest extends CacheTestCase { super(name); } - public void setUp() throws Exception { - super.setUp(); + @Override + public final void postSetUp() throws Exception { // avoid IllegalStateException from HandShake by connecting all vms to // system before creating pool getSystem(); @@ -116,10 +116,14 @@ public class ConnectionPoolDUnitTest extends CacheTestCase { getSystem(); } }); + postSetUpConnectionPoolDUnitTest(); + } + + protected void postSetUpConnectionPoolDUnitTest() throws Exception { } @Override - protected final void postTearDownCacheTestCase() throws Exception { + public final void postTearDownCacheTestCase() throws Exception { Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { Map pools = PoolManager.getAll(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java index 58844b0..1b7eb78 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java @@ -65,15 +65,14 @@ public class ClientServerRegisterInterestsDUnitTest extends DistributedTestCase } @Override - public void setUp() throws Exception { - super.setUp(); + public final void postSetUp() throws Exception { disconnectAllFromDS(); setupGemFireCacheServer(); IgnoredException.addIgnoredException("java.net.ConnectException"); } @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { serverPort.set(0); entryEvents.clear(); gemfireServerVm.invoke(new SerializableRunnable() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java index 03368de..a38bc05 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java @@ -55,9 +55,9 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase { protected static final Object BRIDGE_LISTENER = "BRIDGE_LISTENER"; private static final long MAX_WAIT = 60000; - - public void setUp() throws Exception { - super.setUp(); + + @Override + public final void postSetUp() throws Exception { IgnoredException.addIgnoredException("NoAvailableLocatorsException"); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java index c59ed4f..15f5d52 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/CacheServerSSLConnectionDUnitTest.java @@ -43,7 +43,7 @@ import com.gemstone.gemfire.util.test.TestUtil; * Tests cacheserver ssl support added. See https://svn.gemstone.com/trac/gemfire/ticket/48995 for details */ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { - + private static final long serialVersionUID = 1L; private static final String TRUSTED_STORE = "trusted.keystore"; @@ -60,14 +60,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { private int cacheServerPort; private String hostName; - public void setUp() throws Exception { + @Override + public final void preSetUp() throws Exception { disconnectAllFromDS(); - super.setUp(); } public CacheServerSSLConnectionDUnitTest(String name) { super(name); - } + } public Cache createCache(Properties props) throws Exception { @@ -79,7 +79,7 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { } return cache; } - + private void createServer() throws IOException{ cacheServerPort = AvailablePortHelper.getRandomAvailableTCPPort(); cacheServer = cache.addCacheServer(); @@ -87,20 +87,20 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { cacheServer.start(); hostName = cacheServer.getHostnameForClients(); } - + public int getCacheServerPort(){ return cacheServerPort; } - + public String getCacheServerHost(){ return hostName; } - + public void stopCacheServer(){ this.cacheServer.stop(); } - - + + @SuppressWarnings("rawtypes") public void setUpServerVM(boolean cacheServerSslenabled) throws Exception { Properties gemFireProps = new Properties(); @@ -109,14 +109,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { String cacheServerSslciphers = "any"; boolean cacheServerSslRequireAuth = true; gemFireProps.put(DistributionConfig.SERVER_SSL_ENABLED_NAME, - String.valueOf(cacheServerSslenabled)); + String.valueOf(cacheServerSslenabled)); gemFireProps.put(DistributionConfig.SERVER_SSL_PROTOCOLS_NAME, - cacheServerSslprotocols); + cacheServerSslprotocols); gemFireProps.put(DistributionConfig.SERVER_SSL_CIPHERS_NAME, - cacheServerSslciphers); + cacheServerSslciphers); gemFireProps.put( - DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME, - String.valueOf(cacheServerSslRequireAuth)); + DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME, + String.valueOf(cacheServerSslRequireAuth)); String keyStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_KEY_STORE); String trustStore = TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, SERVER_TRUST_STORE); @@ -125,21 +125,21 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_PASSWORD_NAME, "password"); gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, trustStore); gemFireProps.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_PASSWORD_NAME, "password"); - + StringWriter sw = new StringWriter(); PrintWriter writer = new PrintWriter(sw); gemFireProps.list(writer); System.out.println("Starting cacheserver ds with following properties \n" + sw); createCache(gemFireProps); - + RegionFactory factory = cache.createRegionFactory(RegionShortcut.REPLICATE); Region r = factory.create("serverRegion"); r.put("serverkey", "servervalue"); } - + public void setUpClientVM(String host, int port, - boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, - String keyStore, String trustStore, boolean subscription) { + boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, + String keyStore, String trustStore, boolean subscription) { Properties gemFireProps = new Properties(); @@ -150,14 +150,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { String trustStorePath = TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, trustStore); //using new server-ssl-* properties gemFireProps.put(DistributionConfig.SERVER_SSL_ENABLED_NAME, - String.valueOf(cacheServerSslenabled)); + String.valueOf(cacheServerSslenabled)); gemFireProps.put(DistributionConfig.SERVER_SSL_PROTOCOLS_NAME, - cacheServerSslprotocols); + cacheServerSslprotocols); gemFireProps.put(DistributionConfig.SERVER_SSL_CIPHERS_NAME, - cacheServerSslciphers); + cacheServerSslciphers); gemFireProps.put( - DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME, - String.valueOf(cacheServerSslRequireAuth)); + DistributionConfig.SERVER_SSL_REQUIRE_AUTHENTICATION_NAME, + String.valueOf(cacheServerSslRequireAuth)); gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_TYPE_NAME, "jks"); gemFireProps.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, keyStorePath); @@ -169,90 +169,90 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { PrintWriter writer = new PrintWriter(sw); gemFireProps.list(writer); System.out.println("Starting client ds with following properties \n" + sw.getBuffer()); - + ClientCacheFactory clientCacheFactory = new ClientCacheFactory(gemFireProps); clientCacheFactory.setPoolSubscriptionEnabled(subscription).addPoolServer(host, port); clientCache = clientCacheFactory.create(); - + ClientRegionFactory<String,String> regionFactory = clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY); - Region<String, String> region = regionFactory.create("serverRegion"); + Region<String, String> region = regionFactory.create("serverRegion"); assertNotNull(region); } - + public void doClientRegionTest(){ Region<String, String> region = clientCache.getRegion("serverRegion"); assertEquals("servervalue",region.get("serverkey")); region.put("clientkey", "clientvalue"); assertEquals("clientvalue",region.get("clientkey")); } - + public void doServerRegionTest(){ Region<String, String> region = cache.getRegion("serverRegion"); - assertEquals("servervalue",region.get("serverkey")); + assertEquals("servervalue",region.get("serverkey")); assertEquals("clientvalue",region.get("clientkey")); } - - + + public static void setUpServerVMTask(boolean cacheServerSslenabled) throws Exception{ instance.setUpServerVM(cacheServerSslenabled); } - + public static void createServerTask() throws Exception { instance.createServer(); } - + public static void setUpClientVMTask(String host, int port, - boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore) - throws Exception { + boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore) + throws Exception { instance.setUpClientVM(host, port, cacheServerSslenabled, - cacheServerSslRequireAuth, keyStore, trustStore, true); + cacheServerSslRequireAuth, keyStore, trustStore, true); } public static void setUpClientVMTaskNoSubscription(String host, int port, - boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore) - throws Exception { + boolean cacheServerSslenabled, boolean cacheServerSslRequireAuth, String keyStore, String trustStore) + throws Exception { instance.setUpClientVM(host, port, cacheServerSslenabled, - cacheServerSslRequireAuth, keyStore, trustStore, false); + cacheServerSslRequireAuth, keyStore, trustStore, false); } - + public static void doClientRegionTestTask() { instance.doClientRegionTest(); } - + public static void doServerRegionTestTask() { instance.doServerRegionTest(); } - + public static Object[] getCacheServerEndPointTask() { // TODO: avoid Object[] Object[] array = new Object[2]; array[0] = instance.getCacheServerHost(); array[1] = instance.getCacheServerPort(); return array; } - + public static void closeCacheTask(){ if (instance != null && instance.cache != null) { instance.cache.close(); } } - + public static void closeClientCacheTask(){ if (instance != null && instance.clientCache != null) { instance.clientCache.close(); } } - + public void testCacheServerSSL() throws Exception { final Host host = Host.getHost(0); VM serverVM = host.getVM(1); VM clientVM = host.getVM(2); - + boolean cacheServerSslenabled = true; boolean cacheClientSslenabled = true; boolean cacheClientSslRequireAuth = true; - + serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled)); serverVM.invoke(() -> createServerTask()); - + Object array[] = (Object[])serverVM.invoke(() -> getCacheServerEndPointTask()); String hostName = (String)array[0]; int port = (Integer) array[1]; @@ -260,22 +260,22 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { clientVM.invoke(() -> setUpClientVMTask(hostName, port, cacheClientSslenabled, cacheClientSslRequireAuth, CLIENT_KEY_STORE, CLIENT_TRUST_STORE)); clientVM.invoke(() -> doClientRegionTestTask()); serverVM.invoke(() -> doServerRegionTestTask()); - + } - - + + public void testNonSSLClient() throws Exception { final Host host = Host.getHost(0); VM serverVM = host.getVM(1); VM clientVM = host.getVM(2); - + boolean cacheServerSslenabled = true; boolean cacheClientSslenabled = false; boolean cacheClientSslRequireAuth = true; - + serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled)); serverVM.invoke(() -> createServerTask()); - + Object array[] = (Object[])serverVM.invoke(() -> getCacheServerEndPointTask()); String hostName = (String)array[0]; int port = (Integer) array[1]; @@ -298,14 +298,14 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { } else { //getLogWriter().error("Unexpected exception ", e); fail("Unexpected Exception: " + e + " expected: " - + AuthenticationRequiredException.class); + + AuthenticationRequiredException.class); } } finally { expect.remove(); expect2.remove(); } } - + public void testSSLClientWithNoAuth() throws Exception { final Host host = Host.getHost(0); VM serverVM = host.getVM(1); @@ -337,23 +337,23 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { } else { //getLogWriter().error("Unexpected exception ", e); fail("Unexpected Exception...expected " - + AuthenticationRequiredException.class); + + AuthenticationRequiredException.class); } } } - + public void testSSLClientWithNonSSLServer() throws Exception { final Host host = Host.getHost(0); VM serverVM = host.getVM(1); VM clientVM = host.getVM(2); - + boolean cacheServerSslenabled = false; boolean cacheClientSslenabled = true; boolean cacheClientSslRequireAuth = true; - + serverVM.invoke(() -> setUpServerVMTask(cacheServerSslenabled)); serverVM.invoke(() -> createServerTask()); - + Object array[] = (Object[])serverVM.invoke(() -> getCacheServerEndPointTask()); String hostName = (String)array[0]; int port = (Integer) array[1]; @@ -371,9 +371,9 @@ public class CacheServerSSLConnectionDUnitTest extends DistributedTestCase { expect.remove(); } } - + @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { final Host host = Host.getHost(0); VM serverVM = host.getVM(1); VM clientVM = host.getVM(2); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java index a89d648..74822d5 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/LocatorTestBase.java @@ -72,7 +72,7 @@ public abstract class LocatorTestBase extends DistributedTestCase { } @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { SerializableRunnable tearDown = new SerializableRunnable("tearDown") { public void run() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java index e23fb76..dd146a6 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/client/internal/SSLNoClientAuthDUnitTest.java @@ -54,10 +54,9 @@ public class SSLNoClientAuthDUnitTest extends DistributedTestCase { private static SSLNoClientAuthDUnitTest instance = new SSLNoClientAuthDUnitTest("SSLNoClientAuthDUnitTest"); - - public void setUp() throws Exception { + @Override + public final void preSetUp() throws Exception { disconnectAllFromDS(); - super.setUp(); } public SSLNoClientAuthDUnitTest(String name) { @@ -267,7 +266,7 @@ public class SSLNoClientAuthDUnitTest extends DistributedTestCase { } @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { final Host host = Host.getHost(0); VM serverVM = host.getVM(1); VM clientVM = host.getVM(2); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java index c93848b..17529b8 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java @@ -135,8 +135,7 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase { } @Override - public void setUp() throws Exception { - super.setUp(); + protected final void postSetUpClientServerTestCase() throws Exception { Invoke.invokeInEveryVM(this.setHeapMemoryMonitorTestMode); IgnoredException.addIgnoredException(expectedEx); IgnoredException.addIgnoredException(expectedBelow); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java index 3cf7b09..7c61788 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java @@ -105,16 +105,12 @@ public class MemoryThresholdsOffHeapDUnitTest extends ClientServerTestCase { super(name); } - - @Override - public void setUp() throws Exception { + public final void postSetUpClientServerTestCase() throws Exception { IgnoredException.addIgnoredException(expectedEx); IgnoredException.addIgnoredException(expectedBelow); } - - @Override protected void preTearDownClientServerTestCase() throws Exception { Invoke.invokeInEveryVM(this.resetResourceManager); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java index df655a2..86f629d 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/CompactRangeIndexDUnitTest.java @@ -45,8 +45,8 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{ super(name); } - public void setUp() throws Exception { - super.setUp(); + @Override + public final void postSetUp() throws Exception { getSystem(); Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") { public void run() { @@ -60,8 +60,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{ utils.createReplicateRegion("exampleRegion", vm0); utils.createIndex(vm0,"type", "\"type\"", "/exampleRegion"); } - - + /* * Tests that the message component of the exception is not null */ @@ -178,7 +177,7 @@ public class CompactRangeIndexDUnitTest extends DistributedTestCase{ } @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { Thread.sleep(5000); removeHook(); utils.closeServer(vm0); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java index 76f850d..4db6fc0 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/HashIndexDUnitTest.java @@ -39,8 +39,8 @@ public class HashIndexDUnitTest extends DistributedTestCase{ super(name); } - public void setUp() throws Exception { - super.setUp(); + @Override + public final void postSetUp() throws Exception { getSystem(); Invoke.invokeInEveryVM(new SerializableRunnable("getSystem") { public void run() { @@ -134,7 +134,7 @@ public class HashIndexDUnitTest extends DistributedTestCase{ } @Override - protected final void preTearDown() throws Exception { + public final void preTearDown() throws Exception { Thread.sleep(5000); utils.closeServer(vm0); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java index 8be017c..3e746e7 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/PartitionedRegionCompactRangeIndexDUnitTest.java @@ -15,6 +15,7 @@ * limitations under the License. */ package com.gemstone.gemfire.cache.query.dunit; + import java.io.File; import java.util.HashMap; import java.util.Map; @@ -54,12 +55,12 @@ public class PartitionedRegionCompactRangeIndexDUnitTest extends DistributedTest return props; } - public void setUp() throws Exception { - this.disconnectAllFromDS(); + public void postSetUp() throws Exception { + disconnectAllFromDS(); } @Override - protected void preTearDown() throws Exception { + public void preTearDown() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java index 0227836..5c4f982 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryDataInconsistencyDUnitTest.java @@ -95,18 +95,13 @@ public class QueryDataInconsistencyDUnitTest extends CacheTestCase { } @Override - protected final void preTearDownCacheTestCase() throws Exception { - Invoke.invokeInEveryVM(CacheTestCase.class, "disconnectFromDS"); - } - - @Override - protected final void postTearDownCacheTestCase() throws Exception { - Invoke.invokeInEveryVM(QueryObserverHolder.class, "reset"); + public final void postTearDownCacheTestCase() throws Exception { + Invoke.invokeInEveryVM(() -> disconnectFromDS()); + Invoke.invokeInEveryVM(() -> QueryObserverHolder.reset()); } @Override - public void setUp() throws Exception { - super.setUp(); + public final void postSetUp() throws Exception { Host host = Host.getHost(0); server = host.getVM(0); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java index 5e9df71..6e4ed11 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java @@ -58,6 +58,7 @@ import com.gemstone.gemfire.cache30.CertifiableTestCacheListener; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; +import com.gemstone.gemfire.internal.FileUtil; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.cache.LocalRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegion; @@ -132,27 +133,18 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { super(name); } - public void setUp() throws Exception { - super.setUp(); + @Override + public final void postSetUp() throws Exception { //Workaround for #52008 IgnoredException.addIgnoredException("Failed to create index"); } @Override - protected final void postTearDownCacheTestCase() throws Exception { - // Get the disk store name. - GemFireCacheImpl cache = (GemFireCacheImpl)getCache(); - String diskStoreName = cache.getDefaultDiskStoreName(); - - //reset TestHook + public final void postTearDownCacheTestCase() throws Exception { + // avoid creating a new cache just to get the diskstore name Invoke.invokeInEveryVM(resetTestHook()); - // close the cache. - closeCache(); disconnectFromDS(); - - // remove the disk store. - File diskDir = new File(diskStoreName).getAbsoluteFile(); - com.gemstone.gemfire.internal.FileUtil.delete(diskDir); + FileUtil.delete(new File(GemFireCacheImpl.DEFAULT_DS_NAME).getAbsoluteFile()); } /** @@ -945,12 +937,12 @@ public class QueryIndexUsingXMLDUnitTest extends CacheTestCase { public final InternalDistributedSystem getSystem(String diskStoreId) { new Exception("TEST DEBUG###" + diskStoreId).printStackTrace(); - if (system == null || !system.isConnected()) { + if (basicGetSystem() == null || !basicGetSystem().isConnected()) { // Figure out our distributed system properties Properties p = DistributedTestUtils.getAllDistributedSystemProperties(getDistributedSystemProperties()); - system = (InternalDistributedSystem)DistributedSystem.connect(p); + getSystem(p); } - return system; + return basicGetSystem(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java index 1e3e973..f19e7f0 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java @@ -135,20 +135,19 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase { } @Override - protected final void preTearDownCacheTestCase() throws Exception { - Invoke.invokeInEveryVM(CacheTestCase.class, "disconnectFromDS"); + public final void preTearDownCacheTestCase() throws Exception { + Invoke.invokeInEveryVM(() -> disconnectFromDS()); } @Override - protected final void postTearDownCacheTestCase() throws Exception { - Invoke.invokeInEveryVM(QueryObserverHolder.class, "reset"); + public final void postTearDownCacheTestCase() throws Exception { + Invoke.invokeInEveryVM(() -> QueryObserverHolder.reset()); cache = null; Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } }); } @Override - public void setUp() throws Exception { - super.setUp(); + public final void postSetUp() throws Exception { Host host = Host.getHost(0); server1 = host.getVM(0); server2 = host.getVM(1); @@ -159,7 +158,6 @@ public class QueryUsingFunctionContextDUnitTest extends CacheTestCase { registerFunctionOnServers(); } - /** * Test on Replicated Region. */ http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c8600b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java index 4df1f81..cddfa83 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java @@ -97,15 +97,14 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { //////// Test Methods @Override - public void setUp() throws Exception { - super.setUp(); + public final void postSetUp() throws Exception { disconnectAllFromDS(); IgnoredException.addIgnoredException("Connection reset"); IgnoredException.addIgnoredException("Socket input is shutdown"); } @Override - protected final void postTearDownCacheTestCase() throws Exception { + public final void postTearDownCacheTestCase() throws Exception { disconnectAllFromDS(); } @@ -171,7 +170,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + InternalDistributedSystem system = getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(name, rootRegionName, factory.create()); @@ -308,7 +307,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(name, factory.create()); @@ -440,7 +439,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(name, factory.create()); @@ -577,7 +576,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("mcast-port", "0"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); getCache(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); @@ -636,7 +635,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(name, factory.create()); @@ -1666,7 +1665,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(name+"1", factory.create()); @@ -1769,7 +1768,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(name, factory.create()); @@ -1907,7 +1906,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); Wait.pause(1000); try { @@ -2003,7 +2002,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(name, factory.create()); @@ -2161,7 +2160,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { public void run2() throws CacheException { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); Wait.pause(1000); try { @@ -2377,7 +2376,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase { protected void configAndStartBridgeServer() { Properties config = new Properties(); config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); - system = (InternalDistributedSystem) DistributedSystem.connect(config); + getSystem(config); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.LOCAL); createRegion(this.regionName, this.rootRegionName, factory.create());
