You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/04/27 01:17:27 UTC
[15/16] incubator-geode git commit: Updating and fixing tests
Updating and fixing tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ef0a6243
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ef0a6243
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ef0a6243
Branch: refs/heads/feature/GEODE-1276
Commit: ef0a6243009118aaaf1a9818275db94c61954000
Parents: 70c5467
Author: Kirk Lund <kl...@apache.org>
Authored: Tue Apr 26 16:15:16 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Apr 26 16:15:16 2016 -0700
----------------------------------------------------------------------
.../SessionReplicationIntegrationJUnitTest.java | 2 +-
.../session/Tomcat7SessionsJUnitTest.java | 6 +-
.../modules/session/TestSessionsBase.java | 8 +-
.../session/Tomcat6SessionsJUnitTest.java | 6 +-
.../gemstone/gemfire/BundledJarsJUnitTest.java | 4 +-
.../LauncherLifecycleCommandsDUnitTest.java | 4 +-
.../LauncherLifecycleCommandsJUnitTest.java | 194 +--
.../annotations/ExperimentalJUnitTest.java | 1 -
.../gemfire/internal/ClassPathLoader.java | 8 +-
.../gemfire/SystemFailureJUnitTest.java | 1 +
.../java/com/gemstone/gemfire/TXJUnitTest.java | 38 +-
.../cache/AttributesFactoryJUnitTest.java | 25 +-
.../gemfire/cache/Bug36619JUnitTest.java | 77 --
.../gemfire/cache/Bug52289JUnitTest.java | 88 --
.../gemfire/cache/ConnectionPoolDUnitTest.java | 18 +-
...alStaticArrayShouldNotCauseSegFaultTest.java | 86 ++
...MembershipAttributesAreSerializableTest.java | 74 +
.../gemfire/cache/OperationJUnitTest.java | 96 +-
.../gemfire/cache/RoleExceptionJUnitTest.java | 26 +-
.../internal/OpExecutorImplJUnitTest.java | 175 ++-
.../internal/ServerBlackListJUnitTest.java | 25 +-
.../locator/LocatorStatusResponseJUnitTest.java | 1 -
.../pooling/ConnectionManagerJUnitTest.java | 8 +-
.../management/ResourceManagerDUnitTest.java | 2 +-
.../PutOperationContextJUnitTest.java | 34 +-
.../GetOperationContextImplJUnitTest.java | 37 +-
.../PartitionRegionHelperDUnitTest.java | 2 +-
.../gemfire/cache/query/CacheUtils.java | 2 +-
.../query/dunit/PdxStringQueryDUnitTest.java | 148 +-
.../query/dunit/QueryUsingPoolDUnitTest.java | 2 +-
.../cache/query/dunit/RemoteQueryDUnitTest.java | 4 +-
.../query/functional/CountStarJUnitTest.java | 18 +-
.../IUMRMultiIndexesMultiRegionJUnitTest.java | 12 +-
.../IndexMaintenanceAsynchJUnitTest.java | 2 +-
.../functional/JavaSerializationJUnitTest.java | 17 +-
.../query/functional/LimitClauseJUnitTest.java | 8 +-
.../cache/query/functional/MiscJUnitTest.java | 32 +-
.../MultiRegionIndexUsageJUnitTest.java | 32 +-
.../NonDistinctOrderByReplicatedJUnitTest.java | 4 +-
.../NonDistinctOrderByTestImplementation.java | 16 +-
.../functional/OrderByReplicatedJUnitTest.java | 4 +-
.../functional/OrderByTestImplementation.java | 16 +-
.../query/functional/PdxOrderByJUnitTest.java | 2 +-
.../CompiledAggregateFunctionJUnitTest.java | 28 +-
.../query/internal/CompiledInJUnitTest.java | 72 +-
.../internal/NWayMergeResultsJUnitTest.java | 37 +-
...ueryFromClauseCanonicalizationJUnitTest.java | 6 +-
.../QueryObjectSerializationJUnitTest.java | 46 +-
.../query/internal/ResultsBagJUnitTest.java | 52 +-
.../ResultsBagLimitBehaviourJUnitTest.java | 38 +-
.../ResultsCollectionWrapperLimitJUnitTest.java | 29 +-
.../SelectResultsComparatorJUnitTest.java | 24 +-
.../StructBagLimitBehaviourJUnitTest.java | 23 +-
.../query/internal/StructSetJUnitTest.java | 15 +-
.../internal/aggregate/AggregatorJUnitTest.java | 23 +-
.../index/AsynchIndexMaintenanceJUnitTest.java | 8 +-
.../internal/index/HashIndexSetJUnitTest.java | 192 +--
.../internal/index/IndexElemArrayJUnitTest.java | 24 +-
.../index/IndexMaintenanceJUnitTest.java | 16 +-
.../index/IndexStatisticsJUnitTest.java | 12 +-
.../index/MemoryIndexStoreJUnitTest.java | 698 +++++-----
...exStoreWithInplaceModificationJUnitTest.java | 45 +-
.../PRBasicIndexCreationDUnitTest.java | 2 +-
.../PRBasicMultiIndexCreationDUnitTest.java | 2 +-
.../query/partitioned/PRQueryDUnitHelper.java | 6 +-
.../query/partitioned/PRQueryDUnitTest.java | 2 +-
.../internal/ConnectionCountProbeJUnitTest.java | 22 +-
.../cache/util/PasswordUtilJUnitTest.java | 11 +-
.../gemfire/cache30/CacheLoaderTestCase.java | 14 +-
.../gemfire/cache30/CacheMapTxnDUnitTest.java | 2 +-
.../cache30/CacheStatisticsDUnitTest.java | 4 +-
.../gemfire/cache30/CacheXml41DUnitTest.java | 10 +-
.../gemfire/cache30/CacheXml57DUnitTest.java | 2 +-
.../gemfire/cache30/CacheXml58DUnitTest.java | 2 +-
.../gemfire/cache30/CacheXml65DUnitTest.java | 2 +-
.../cache30/ClientMembershipDUnitTest.java | 2 +-
.../gemfire/cache30/DiskRegionDUnitTest.java | 2 +-
.../cache30/DistAckMapMethodsDUnitTest.java | 2 +-
...tributedAckPersistentRegionCCEDUnitTest.java | 28 +-
.../gemfire/cache30/MultiVMRegionTestCase.java | 52 +-
.../gemfire/cache30/PutAllMultiVmDUnitTest.java | 4 +-
.../gemfire/cache30/QueueMsgDUnitTest.java | 2 +-
.../RegionMembershipListenerDUnitTest.java | 6 +-
.../gemfire/cache30/RegionTestCase.java | 4 +-
.../gemfire/cache30/SlowRecDUnitTest.java | 4 +-
.../distributed/AbstractLauncherJUnitTest.java | 4 +-
.../AbstractLauncherServiceStatusJUnitTest.java | 123 +-
.../distributed/LocatorLauncherJUnitTest.java | 13 +-
.../LocatorLauncherLocalJUnitTest.java | 6 +-
.../LocatorLauncherRemoteJUnitTest.java | 8 +-
.../distributed/LocatorStateJUnitTest.java | 46 +-
.../distributed/ServerLauncherJUnitTest.java | 33 +-
.../ServerLauncherLocalJUnitTest.java | 4 +-
.../ServerLauncherRemoteJUnitTest.java | 4 +-
.../AtomicLongWithTerminalStateJUnitTest.java | 13 +-
.../internal/DistributionConfigJUnitTest.java | 85 +-
.../InternalDistributedSystemJUnitTest.java | 6 +-
.../internal/LocatorLoadSnapshotJUnitTest.java | 104 +-
.../internal/ProductUseLogJUnitTest.java | 105 +-
.../internal/ServerLocatorJUnitTest.java | 21 +-
.../internal/SharedConfigurationJUnitTest.java | 1 -
.../internal/StartupMessageDataJUnitTest.java | 34 +-
.../deadlock/DeadlockDetectorJUnitTest.java | 331 -----
.../internal/deadlock/DeadlockDetectorTest.java | 140 ++
.../deadlock/DependencyGraphJUnitTest.java | 24 +-
.../deadlock/UnsafeThreadLocalJUnitTest.java | 47 +-
.../internal/membership/NetViewJUnitTest.java | 51 +-
.../membership/gms/GMSMemberJUnitTest.java | 51 +-
.../gms/auth/GMSAuthenticatorJUnitTest.java | 123 +-
.../locator/GMSLocatorRecoveryJUnitTest.java | 34 +-
.../gms/membership/StatRecorderJUnitTest.java | 57 +-
.../messenger/GMSQuorumCheckerJUnitTest.java | 172 ++-
.../gms/mgr/GMSMembershipManagerJUnitTest.java | 71 +-
.../TcpServerBackwardCompatDUnitTest.java | 8 +-
.../internal/tcpserver/TcpServerJUnitTest.java | 6 +-
.../internal/AbstractConfigJUnitTest.java | 125 +-
.../gemfire/internal/ArrayEqualsJUnitTest.java | 193 ---
.../internal/AvailablePortJUnitTest.java | 12 +-
.../internal/ClassPathLoaderJUnitTest.java | 1261 ------------------
.../gemfire/internal/ClassPathLoaderTest.java | 890 ++++++++++++
.../gemfire/internal/ConfigSourceJUnitTest.java | 9 +-
.../internal/CopyOnWriteHashSetJUnitTest.java | 17 +-
.../internal/DataSerializableJUnitTest.java | 772 +++++------
.../gemfire/internal/FileUtilJUnitTest.java | 7 +-
.../internal/GemFireVersionJUnitTest.java | 16 +-
.../internal/HeapDataOutputStreamJUnitTest.java | 17 +-
.../gemfire/internal/LineWrapUnitJUnitTest.java | 13 +-
.../gemfire/internal/NanoTimerJUnitTest.java | 31 +-
.../gemfire/internal/ObjIdMapJUnitTest.java | 29 +-
.../internal/OneTaskOnlyDecoratorJUnitTest.java | 22 +-
.../PutAllOperationContextJUnitTest.java | 14 +-
...lityShouldUseArrayEqualsIntegrationTest.java | 194 +++
.../gemfire/internal/SocketCloserJUnitTest.java | 6 +-
.../internal/SocketCloserWithWaitJUnitTest.java | 1 +
.../gemfire/internal/StatSamplerJUnitTest.java | 52 +-
.../internal/UniqueIdGeneratorJUnitTest.java | 18 +-
.../AbstractDistributedRegionJUnitTest.java | 8 +-
.../internal/cache/AbstractRegionJUnitTest.java | 2 -
.../internal/cache/AbstractRegionMapTest.java | 23 +-
.../internal/cache/BucketRegionJUnitTest.java | 32 +-
.../internal/cache/DeltaFaultInDUnitTest.java | 2 +-
.../internal/cache/DeltaSizingDUnitTest.java | 2 +-
.../gemfire/internal/cache/DiskIdJUnitTest.java | 51 +-
.../internal/cache/DiskInitFileJUnitTest.java | 35 +-
.../cache/DiskWriteAttributesJUnitTest.java | 99 +-
.../cache/DistributedRegionJUnitTest.java | 29 +-
.../internal/cache/EntryEventImplTest.java | 23 +-
.../cache/EnumListenerEventJUnitTest.java | 22 +-
.../cache/OffHeapValueWrapperJUnitTest.java | 9 +-
.../gemfire/internal/cache/OldVLJUnitTest.java | 19 +-
.../cache/OldValueImporterTestBase.java | 17 +-
.../cache/OplogEntryIdMapJUnitTest.java | 12 +-
.../cache/OplogEntryIdSetJUnitTest.java | 12 +-
.../gemfire/internal/cache/OplogJUnitTest.java | 40 +-
.../internal/cache/OplogRVVJUnitTest.java | 32 +-
.../cache/OrderedTombstoneMapJUnitTest.java | 10 +-
.../cache/PartitionAttributesImplJUnitTest.java | 11 +-
.../PartitionedRegionCacheCloseDUnitTest.java | 2 +-
.../cache/PartitionedRegionDUnitTestCase.java | 2 +-
.../PartitionedRegionDestroyDUnitTest.java | 2 +-
.../PartitionedRegionEvictionDUnitTest.java | 4 +-
.../cache/PartitionedRegionHelperJUnitTest.java | 15 +-
.../PartitionedRegionQueryEvaluatorTest.java | 69 +-
...artitionedRegionRedundancyZoneDUnitTest.java | 6 +-
.../PartitionedRegionSingleHopDUnitTest.java | 2 +-
...onedRegionSingleNodeOperationsJUnitTest.java | 12 +-
.../cache/PartitionedRegionStatsJUnitTest.java | 8 +-
.../PartitionedRegionTestUtilsDUnitTest.java | 12 +-
.../cache/RemoteTransactionDUnitTest.java | 22 +-
.../cache/SearchLoadAndWriteProcessorTest.java | 1 -
.../cache/SimpleDiskRegionJUnitTest.java | 6 +-
.../gemfire/internal/cache/VLJUnitTest.java | 35 +-
.../cache/control/FilterByPathJUnitTest.java | 24 +-
.../control/MemoryThresholdsJUnitTest.java | 7 +-
.../control/RebalanceOperationDUnitTest.java | 28 +-
...onFunctionExecutionNoSingleHopDUnitTest.java | 2 +-
...onExecutionSelectorNoSingleHopDUnitTest.java | 2 +-
...gionFunctionExecutionSingleHopDUnitTest.java | 2 +-
.../execute/PRCustomPartitioningDUnitTest.java | 2 +-
.../execute/PRFunctionExecutionDUnitTest.java | 12 +-
.../execute/PRPerformanceTestDUnitTest.java | 2 +-
.../SimpleExtensionPointJUnitTest.java | 7 +-
.../cache/ha/EventIdOptimizationJUnitTest.java | 129 +-
.../internal/cache/ha/HAGIIDUnitTest.java | 12 +-
.../cache/ha/HARQAddOperationJUnitTest.java | 2 +-
.../cache/ha/HARegionQueueDUnitTest.java | 2 +-
.../cache/ha/ThreadIdentifierJUnitTest.java | 12 +-
.../cache/locks/TXLockServiceDUnitTest.java | 2 +-
.../FetchEntriesMessageJUnitTest.java | 13 +-
.../OfflineMembersDetailsJUnitTest.java | 11 +-
.../PartitionedRegionLoadModelJUnitTest.java | 121 +-
.../persistence/BackupInspectorJUnitTest.java | 52 +-
.../TemporaryResultSetFactoryJUnitTest.java | 44 +-
.../RegionEntryFactoryBuilderJUnitTest.java | 11 +-
.../cache/tier/sockets/Bug37805DUnitTest.java | 2 +-
.../CacheServerTransactionsDUnitTest.java | 8 +-
.../sockets/ClientHealthMonitorJUnitTest.java | 8 +-
.../tier/sockets/ClientServerMiscDUnitTest.java | 22 +-
.../cache/tier/sockets/ConflationDUnitTest.java | 4 +-
.../DurableClientReconnectDUnitTest.java | 2 +-
.../tier/sockets/FilterProfileJUnitTest.java | 20 +-
.../sockets/HAStartupAndFailoverDUnitTest.java | 4 +-
.../sockets/InterestListFailoverDUnitTest.java | 2 +-
.../cache/tier/sockets/MessageJUnitTest.java | 20 +-
.../tier/sockets/ObjectPartListJUnitTest.java | 27 +-
.../sockets/RedundancyLevelPart1DUnitTest.java | 88 +-
.../sockets/RedundancyLevelPart2DUnitTest.java | 96 +-
.../tier/sockets/RedundancyLevelTestBase.java | 4 +-
.../tier/sockets/command/CommitCommandTest.java | 12 +-
.../cache/versions/RVVExceptionJUnitTest.java | 14 +-
.../versions/RegionVersionHolder2JUnitTest.java | 5 +-
.../versions/RegionVersionVectorJUnitTest.java | 39 +-
.../ParallelGatewaySenderQueueJUnitTest.java | 5 +-
.../xmlcache/AbstractEntityResolverTest.java | 17 +-
.../xmlcache/AbstractXmlParserJUnitTest.java | 1 -
.../cache/xmlcache/CacheXmlParserJUnitTest.java | 1 -
.../xmlcache/CacheXmlVersionJUnitTest.java | 1 -
.../xmlcache/GeodeEntityResolverJUnitTest.java | 6 +-
.../PivotalEntityResolverJUnitTest.java | 7 +-
.../gemfire/internal/jndi/ContextJUnitTest.java | 153 +--
.../internal/logging/LogServiceJUnitTest.java | 1 -
.../internal/logging/SortLogFileJUnitTest.java | 7 +-
.../logging/log4j/AlertAppenderJUnitTest.java | 1 -
.../log4j/LocalizedMessageJUnitTest.java | 1 -
.../log4j/LogWriterAppenderJUnitTest.java | 1 -
.../internal/offheap/DataTypeJUnitTest.java | 142 +-
...tingOutOfOffHeapMemoryListenerJUnitTest.java | 2 +
.../internal/offheap/FreeListManagerTest.java | 1 +
.../offheap/LifecycleListenerJUnitTest.java | 2 +-
.../offheap/MemoryAllocatorJUnitTest.java | 11 +
.../offheap/MemoryBlockNodeJUnitTest.java | 3 +-
.../offheap/MemoryInspectorImplJUnitTest.java | 7 +-
.../offheap/OffHeapHelperJUnitTest.java | 3 -
.../offheap/OffHeapStorageJUnitTest.java | 65 +-
...ffHeapStoredObjectAddressStackJUnitTest.java | 1 +
.../offheap/OffHeapStoredObjectJUnitTest.java | 1 -
.../OffHeapStoredObjectSliceJUnitTest.java | 1 -
...ffHeapStoredObjectWithHeapFormJUnitTest.java | 1 -
.../offheap/TinyMemoryBlockJUnitTest.java | 1 -
.../offheap/TinyStoredObjectJUnitTest.java | 502 ++++---
.../process/LocalProcessLauncherJUnitTest.java | 36 +-
.../internal/process/PidFileJUnitTest.java | 4 +-
.../internal/size/ObjectSizerJUnitTest.java | 21 +-
.../internal/size/ObjectTraverserJUnitTest.java | 53 +-
.../size/ReflectionObjectSizerJUnitTest.java | 15 +-
.../size/SizeClassOnceObjectSizerJUnitTest.java | 15 +-
.../size/WellKnownClassSizerJUnitTest.java | 18 +-
.../statistics/SampleCollectorJUnitTest.java | 54 +-
.../statistics/StatMonitorHandlerJUnitTest.java | 12 +-
.../statistics/StatisticsMonitorJUnitTest.java | 51 +-
.../internal/util/ArrayUtilsJUnitTest.java | 1 -
.../gemfire/internal/util/BytesJUnitTest.java | 27 +-
.../internal/util/CollectionUtilsJUnitTest.java | 1 -
.../internal/util/DelayedActionJUnitTest.java | 9 +-
.../CompactConcurrentHashSetJUnitTest.java | 16 +-
.../concurrent/ReentrantSemaphoreJUnitTest.java | 13 +-
.../SemaphoreReadWriteLockJUnitTest.java | 28 +-
...ersalMembershipListenerAdapterDUnitTest.java | 2 +-
.../stats/GatewayReceiverStatsJUnitTest.java | 8 +-
.../bean/stats/RegionStatsJUnitTest.java | 2 +-
.../bean/stats/StatsRateJUnitTest.java | 50 +-
.../internal/JettyHelperJUnitTest.java | 25 +-
.../beans/DistributedSystemBridgeJUnitTest.java | 3 +-
.../internal/cli/CliUtilDUnitTest.java | 2 +-
.../internal/cli/CommandManagerJUnitTest.java | 11 +-
.../cli/CommandSeparatorEscapeJUnitTest.java | 47 +-
.../internal/cli/DataCommandJsonJUnitTest.java | 14 +-
.../internal/cli/GfshParserJUnitTest.java | 18 +-
.../cli/annotations/CliArgumentJUnitTest.java | 179 +--
.../commands/GemfireDataCommandsDUnitTest.java | 2 +-
.../HTTPServiceSSLSupportJUnitTest.java | 2 +-
.../cli/commands/MemberCommandsDUnitTest.java | 2 +-
.../RegionPathConverterJUnitTest.java | 19 +-
.../DescribeDiskStoreFunctionJUnitTest.java | 20 +-
.../functions/ListIndexFunctionJUnitTest.java | 108 +-
.../cli/parser/ParserUtilsJUnitTest.java | 14 +-
.../preprocessor/PreprocessorJUnitTest.java | 7 +-
.../PreprocessorUtilsJUnitTest.java | 17 +-
.../cli/shell/GfshConfigInitFileJUnitTest.java | 20 +-
.../shell/GfshExecutionStrategyJUnitTest.java | 15 +-
.../cli/shell/GfshHistoryJUnitTest.java | 22 +-
.../domain/CacheElementJUnitTest.java | 3 +-
.../configuration/utils/XmlUtilsJUnitTest.java | 1 -
.../WanCommandsControllerJUnitTest.java | 9 +-
.../pdx/JSONPdxClientServerDUnitTest.java | 2 +-
.../pdx/PdxDeserializationDUnitTest.java | 12 +-
.../security/ClientAuthorizationTestCase.java | 2 +-
.../security/NotAuthorizedExceptionTest.java | 4 +-
.../security/templates/PKCSPrincipalTest.java | 3 +-
.../templates/UsernamePrincipalTest.java | 3 +-
.../com/gemstone/gemfire/test/dunit/Assert.java | 2 +-
.../gemfire/test/dunit/RMIException.java | 2 +-
.../test/dunit/SerializableCallable.java | 2 +-
.../test/dunit/SerializableRunnable.java | 2 +-
.../test/process/MainLauncherJUnitTest.java | 1 -
.../cache/query/cq/dunit/CqQueryDUnitTest.java | 2 +-
.../cq/dunit/CqQueryUsingPoolDUnitTest.java | 4 +-
.../cache/query/cq/dunit/CqStatsDUnitTest.java | 2 +-
.../cq/dunit/CqStatsUsingPoolDUnitTest.java | 2 +-
.../PartitionedRegionCqQueryDUnitTest.java | 2 +-
.../internal/cache/PutAllCSDUnitTest.java | 2 +-
.../cache/RemoteCQTransactionDUnitTest.java | 20 +-
.../internal/cache/ha/CQListGIIDUnitTest.java | 2 +-
.../tier/sockets/DurableClientTestCase.java | 8 +-
.../CacheServerManagementDUnitTest.java | 2 +-
.../LuceneIndexForPartitionedRegion.java | 5 +-
.../HeterogeneousLuceneSerializer.java | 82 ++
.../HeterogenousLuceneSerializer.java | 83 --
.../internal/LuceneEventListenerJUnitTest.java | 1 -
.../LuceneIndexRecoveryHAJUnitTest.java | 7 +-
.../LuceneQueryResultsImplJUnitTest.java | 2 -
.../LuceneResultStructImpJUnitTest.java | 2 -
.../internal/LuceneServiceImplJUnitTest.java | 14 +-
.../PartitionedRepositoryManagerJUnitTest.java | 8 +-
.../internal/StringQueryProviderJUnitTest.java | 2 -
.../directory/RegionDirectoryJUnitTest.java | 2 +-
.../DistributedScoringJUnitTest.java | 21 +-
.../distributed/EntryScoreJUnitTest.java | 2 +-
.../LuceneFunctionContextJUnitTest.java | 2 +-
.../distributed/LuceneFunctionJUnitTest.java | 2 +-
.../TopEntriesCollectorJUnitTest.java | 2 +-
.../TopEntriesFunctionCollectorJUnitTest.java | 2 +-
.../distributed/TopEntriesJUnitTest.java | 2 +-
.../internal/filesystem/ChunkKeyJUnitTest.java | 1 -
.../internal/filesystem/FileJUnitTest.java | 5 +-
.../filesystem/FileSystemJUnitTest.java | 4 +-
.../IndexRepositoryImplJUnitTest.java | 6 +-
.../IndexRepositoryImplPerformanceTest.java | 6 +-
.../HeterogeneousLuceneSerializerJUnitTest.java | 86 ++
.../HeterogenousLuceneSerializerJUnitTest.java | 90 --
.../serializer/PdxFieldMapperJUnitTest.java | 2 -
.../ReflectionFieldMapperJUnitTest.java | 2 -
.../xml/LuceneIndexXmlGeneratorJUnitTest.java | 2 -
.../xml/LuceneIndexXmlParserJUnitTest.java | 1 -
geode-pulse/build.gradle | 12 +-
.../controllers/PulseControllerJUnitTest.java | 63 +-
.../tools/pulse/testbed/driver/PulseUITest.java | 2 +-
.../SerialGatewaySenderQueueDUnitTest.java | 2 +-
.../wancommand/WanCommandStatusDUnitTest.java | 6 +-
.../ShellCommandsControllerJUnitTest.java | 15 +-
.../web/http/ClientHttpRequestJUnitTest.java | 8 +-
...ableObjectHttpMessageConverterJUnitTest.java | 6 +-
.../RestHttpOperationInvokerJUnitTest.java | 18 +-
gradle/dependency-versions.properties | 14 +-
gradle/test.gradle | 9 +-
345 files changed, 5735 insertions(+), 6816 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java b/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
index 004f9fe..d3b3751 100644
--- a/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
+++ b/extensions/geode-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
@@ -476,7 +476,7 @@ public class SessionReplicationIntegrationJUnitTest {
// request.setURI("/test/request2");
// response.parse(tester.getResponses(request.generate()));
//
-// assertEquals("null", response.getContent());
+// assertIndexDetailsEquals("null", response.getContent());
//
// Region r = getRegion();
// assertNull("Region should not contain session", r.get(id));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/extensions/geode-modules-tomcat7/src/test/java/com/gemstone/gemfire/modules/session/Tomcat7SessionsJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules-tomcat7/src/test/java/com/gemstone/gemfire/modules/session/Tomcat7SessionsJUnitTest.java b/extensions/geode-modules-tomcat7/src/test/java/com/gemstone/gemfire/modules/session/Tomcat7SessionsJUnitTest.java
index 5ac87ab..99cf9c2 100644
--- a/extensions/geode-modules-tomcat7/src/test/java/com/gemstone/gemfire/modules/session/Tomcat7SessionsJUnitTest.java
+++ b/extensions/geode-modules-tomcat7/src/test/java/com/gemstone/gemfire/modules/session/Tomcat7SessionsJUnitTest.java
@@ -17,13 +17,11 @@
package com.gemstone.gemfire.modules.session;
import com.gemstone.gemfire.modules.session.catalina.Tomcat7DeltaSessionManager;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import org.junit.BeforeClass;
import org.junit.experimental.categories.Category;
-/**
- */
-@Category(UnitTest.class)
+@Category(IntegrationTest.class)
public class Tomcat7SessionsJUnitTest extends TestSessionsBase {
// Set up the session manager we need
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java b/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
index 544658e..194a7c7 100644
--- a/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
+++ b/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/TestSessionsBase.java
@@ -38,10 +38,8 @@ import java.io.PrintWriter;
import static junit.framework.Assert.*;
-/**
- *
- */
public abstract class TestSessionsBase {
+
private static EmbeddedTomcat server;
private static Region<String, HttpSession> region;
@@ -68,7 +66,7 @@ public abstract class TestSessionsBase {
servlet = server.addServlet("/test/*", "default", CommandServlet.class.getName());
server.startContainer();
- /**
+ /*
* Can only retrieve the region once the container has started up
* (and the cache has started too).
*/
@@ -212,7 +210,7 @@ public abstract class TestSessionsBase {
// req.removeParameter("value");
// response = wc.getResponse(req);
//
-// assertEquals(value, response.getText());
+// assertIndexDetailsEquals(value, response.getText());
// }
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/Tomcat6SessionsJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/Tomcat6SessionsJUnitTest.java b/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/Tomcat6SessionsJUnitTest.java
index 7500a3c..26ed697 100644
--- a/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/Tomcat6SessionsJUnitTest.java
+++ b/extensions/geode-modules/src/test/java/com/gemstone/gemfire/modules/session/Tomcat6SessionsJUnitTest.java
@@ -17,13 +17,11 @@
package com.gemstone.gemfire.modules.session;
import com.gemstone.gemfire.modules.session.catalina.Tomcat6DeltaSessionManager;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import org.junit.BeforeClass;
import org.junit.experimental.categories.Category;
-/**
- */
-@Category(UnitTest.class)
+@Category(IntegrationTest.class)
public class Tomcat6SessionsJUnitTest extends TestSessionsBase {
// Set up the session manager we need
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-assembly/src/test/java/com/gemstone/gemfire/BundledJarsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/BundledJarsJUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/BundledJarsJUnitTest.java
index 8ae3b22..9b59f80 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/BundledJarsJUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/BundledJarsJUnitTest.java
@@ -36,10 +36,10 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.internal.FileUtil;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import com.gemstone.gemfire.util.test.TestUtil;
-@Category(UnitTest.class)
+@Category(IntegrationTest.class)
public class BundledJarsJUnitTest {
private static final String VERSION_PATTERN = "[0-9-_.v]{3,}.*\\.jar$";
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/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 b394063..e6fa87b 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
@@ -711,7 +711,7 @@ public class LauncherLifecycleCommandsDUnitTest extends CliCommandTestBase {
// TODO figure out what output to assert and validate on now that 'stop locator' uses Gfsh's logger
// and standard err/out...
- //assertEquals(CliStrings.format(CliStrings.STOP_LOCATOR__SHUTDOWN_MEMBER_MESSAGE, pathname),
+ //assertIndexDetailsEquals(CliStrings.format(CliStrings.STOP_LOCATOR__SHUTDOWN_MEMBER_MESSAGE, pathname),
// StringUtils.trim(toString(result)));
WaitCriterion waitCriteria = new WaitCriterion() {
@@ -789,7 +789,7 @@ public class LauncherLifecycleCommandsDUnitTest extends CliCommandTestBase {
// TODO figure out what output to assert and validate on now that 'stop locator' uses Gfsh's logger
// and standard err/out...
- //assertEquals(CliStrings.format(CliStrings.STOP_LOCATOR__SHUTDOWN_MEMBER_MESSAGE, memberId),
+ //assertIndexDetailsEquals(CliStrings.format(CliStrings.STOP_LOCATOR__SHUTDOWN_MEMBER_MESSAGE, memberId),
// StringUtils.trim(toString(result)));
WaitCriterion waitCriteria = new WaitCriterion() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
index dc89f03..0b5cdfb 100755
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/LauncherLifecycleCommandsJUnitTest.java
@@ -16,6 +16,21 @@
*/
package com.gemstone.gemfire.management.internal.cli.commands;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Stack;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
import com.gemstone.gemfire.GemFireException;
import com.gemstone.gemfire.cache.server.CacheServer;
import com.gemstone.gemfire.distributed.ServerLauncher;
@@ -26,28 +41,6 @@ import com.gemstone.gemfire.internal.lang.SystemUtils;
import com.gemstone.gemfire.internal.util.IOUtils;
import com.gemstone.gemfire.management.internal.cli.i18n.CliStrings;
import com.gemstone.gemfire.test.junit.categories.UnitTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Stack;
-import java.util.jar.Attributes;
-import java.util.jar.Attributes.Name;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import static org.junit.Assert.*;
/**
* The LauncherLifecycleCommandsJUnitTest class is a test suite of test cases testing the contract and functionality of
@@ -62,9 +55,6 @@ import static org.junit.Assert.*;
@Category(UnitTest.class)
public class LauncherLifecycleCommandsJUnitTest {
- private static final String GFSH_DEPENDENCIES_JAR_PATHNAME = IOUtils.appendToPath(System.getenv("GEMFIRE"), "lib",
- "gfsh-dependencies.jar");
-
private LauncherLifecycleCommands launcherCommands;
@Before
@@ -77,18 +67,6 @@ public class LauncherLifecycleCommandsJUnitTest {
launcherCommands = null;
}
- protected LauncherLifecycleCommands getLauncherLifecycleCommands() {
- return launcherCommands;
- }
-
- protected void writePid(final File pidFile, final int pid) throws IOException {
- final FileWriter fileWriter = new FileWriter(pidFile, false);
- fileWriter.write(String.valueOf(pid));
- fileWriter.write("\n");
- fileWriter.flush();
- IOUtils.close(fileWriter);
- }
-
@Test
public void testAddGemFirePropertyFileToCommandLine() {
final List<String> commandLine = new ArrayList<>();
@@ -260,28 +238,6 @@ public class LauncherLifecycleCommandsJUnitTest {
}
@Test
- public void testReadPidWithNonExistingFile() {
- assertEquals(LauncherLifecycleCommands.INVALID_PID,
- getLauncherLifecycleCommands().readPid(new File("/path/to/non_existing/pid.file")));
- }
-
- @Test
- public void testReadPid() throws IOException {
- final int expectedPid = 12345;
-
- File pidFile = new File(getClass().getSimpleName().concat("_testReadPid.pid"));
-
- assertTrue(pidFile.createNewFile());
-
- pidFile.deleteOnExit();
- writePid(pidFile, expectedPid);
-
- final int actualPid = getLauncherLifecycleCommands().readPid(pidFile);
-
- assertEquals(expectedPid, actualPid);
- }
-
- @Test
@SuppressWarnings("deprecation")
public void testGetClasspath() {
assertEquals(System.getProperty("java.class.path"), getLauncherLifecycleCommands().getClasspath(null));
@@ -295,23 +251,6 @@ public class LauncherLifecycleCommandsJUnitTest {
}
@Test
- public void testGemFireCoreClasspath() throws IOException {
- File coreDependenciesJar = new File(LauncherLifecycleCommands.CORE_DEPENDENCIES_JAR_PATHNAME);
-
- assertNotNull(coreDependenciesJar);
- assertTrue(coreDependenciesJar + " is not a file", coreDependenciesJar.isFile());
-
- Collection<String> expectedJarDependencies = Arrays.asList("antlr", "commons-io", "commons-lang", "commons-logging",
- "geode", "jackson-annotations", "jackson-core", "jackson-databind", "jansi", "jline", "snappy-java",
- "spring-core", "spring-shell", "jetty-server", "jetty-servlet", "jetty-webapp", "jetty-util", "jetty-http",
- "servlet-api", "jetty-io", "jetty-security", "jetty-xml"
-
- );
-
- assertJarFileManifestClassPath(coreDependenciesJar, expectedJarDependencies);
- }
-
- @Test
public void testGetSystemClasspath() {
assertEquals(System.getProperty("java.class.path"), getLauncherLifecycleCommands().getSystemClasspath());
}
@@ -342,17 +281,6 @@ public class LauncherLifecycleCommandsJUnitTest {
assertEquals(expectedClasspath, actualClasspath);
}
- private String toPath(Object... pathElements) {
- String path = "";
-
- for (Object pathElement : pathElements) {
- path += (path.isEmpty() ? StringUtils.EMPTY_STRING : File.pathSeparator);
- path += pathElement;
- }
-
- return path;
- }
-
@Test
public void testToClasspath() {
final boolean EXCLUDE_SYSTEM_CLASSPATH = false;
@@ -406,64 +334,6 @@ public class LauncherLifecycleCommandsJUnitTest {
assertEquals(expectedClasspath, actualClasspath);
}
- private void assertJarFileManifestClassPath(final File dependenciesJar,
- final Collection<String> expectedJarDependencies) throws IOException {
- JarFile dependenciesJarFile = new JarFile(dependenciesJar);
- Manifest manifest = dependenciesJarFile.getManifest();
-
- assertNotNull(manifest);
-
- Attributes attributes = manifest.getMainAttributes();
-
- assertNotNull(attributes);
- assertTrue(attributes.containsKey(Name.CLASS_PATH));
-
- String[] actualJarDependencies = attributes.getValue(Name.CLASS_PATH).split(" ");
-
- assertNotNull(actualJarDependencies);
- assertTrue(String.format("Expected the actual number of JAR dependencies to be (%1$d); but was (%2$d)!",
- expectedJarDependencies.size(), actualJarDependencies.length),
- actualJarDependencies.length >= expectedJarDependencies.size());
- //assertTrue(Arrays.asList(actualJarDependencies).containsAll(expectedJarDependencies));
-
- List<String> actualJarDependenciesList = new ArrayList<>(Arrays.asList(actualJarDependencies));
- List<String> missingExpectedJarDependenciesList = new ArrayList<>(expectedJarDependencies.size());
-
- for (String expectedJarDependency : expectedJarDependencies) {
- boolean containsExpectedJar = false;
-
- for (int index = 0, size = actualJarDependenciesList.size(); index < size; index++) {
- if (actualJarDependenciesList.get(index).toLowerCase().contains(expectedJarDependency.toLowerCase())) {
- actualJarDependenciesList.remove(index);
- containsExpectedJar = true;
- break;
- }
- }
-
- if (!containsExpectedJar) {
- missingExpectedJarDependenciesList.add(expectedJarDependency);
- }
- }
-
- assertTrue(String.format(
- "GemFire dependencies JAR file (%1$s) does not contain the expected dependencies (%2$s) in the Manifest Class-Path attribute (%3$s)!",
- dependenciesJar, missingExpectedJarDependenciesList, attributes.getValue(Name.CLASS_PATH)),
- missingExpectedJarDependenciesList.isEmpty());
- }
-
- private String toClasspath(final String... jarFilePathnames) {
- String classpath = StringUtils.EMPTY_STRING;
-
- if (jarFilePathnames != null) {
- for (final String jarFilePathname : jarFilePathnames) {
- classpath += (classpath.isEmpty() ? StringUtils.EMPTY_STRING : File.pathSeparator);
- classpath += jarFilePathname;
- }
- }
-
- return classpath;
- }
-
@Test
public void testGetJavaPathname() {
assertEquals(IOUtils.appendToPath(System.getProperty("java.home"), "bin",
@@ -579,4 +449,38 @@ public class LauncherLifecycleCommandsJUnitTest {
expectedCommandLineElements.isEmpty());
}
+ @Test
+ public void testReadPidWithNonExistingFile() {
+ assertEquals(LauncherLifecycleCommands.INVALID_PID,
+ getLauncherLifecycleCommands().readPid(new File("/path/to/non_existing/pid.file")));
+ }
+
+ private LauncherLifecycleCommands getLauncherLifecycleCommands() {
+ return launcherCommands;
+ }
+
+ private String toClasspath(final String... jarFilePathnames) {
+ String classpath = StringUtils.EMPTY_STRING;
+
+ if (jarFilePathnames != null) {
+ for (final String jarFilePathname : jarFilePathnames) {
+ classpath += (classpath.isEmpty() ? StringUtils.EMPTY_STRING : File.pathSeparator);
+ classpath += jarFilePathname;
+ }
+ }
+
+ return classpath;
+ }
+
+ private String toPath(Object... pathElements) {
+ String path = "";
+
+ for (Object pathElement : pathElements) {
+ path += (path.isEmpty() ? StringUtils.EMPTY_STRING : File.pathSeparator);
+ path += pathElement;
+ }
+
+ return path;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-common/src/test/java/com/gemstone/gemfire/annotations/ExperimentalJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-common/src/test/java/com/gemstone/gemfire/annotations/ExperimentalJUnitTest.java b/geode-common/src/test/java/com/gemstone/gemfire/annotations/ExperimentalJUnitTest.java
index 8067a4a..2df1cd6 100755
--- a/geode-common/src/test/java/com/gemstone/gemfire/annotations/ExperimentalJUnitTest.java
+++ b/geode-common/src/test/java/com/gemstone/gemfire/annotations/ExperimentalJUnitTest.java
@@ -32,7 +32,6 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
* annotation can be applied to Interfaces, Classes, Public and Protected
* Fields, Enums, Enum Constants, Public and Protected Methods, Packages,
* and Constructors.
- *
*/
@Category(UnitTest.class)
public class ExperimentalJUnitTest {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/main/java/com/gemstone/gemfire/internal/ClassPathLoader.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/ClassPathLoader.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/ClassPathLoader.java
index 1cb2332..028a57e 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/ClassPathLoader.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/ClassPathLoader.java
@@ -87,8 +87,11 @@ public final class ClassPathLoader {
// class is found in a directory instead of a JAR file (as when testing),
// then it will be relative to the location of the root of the package and
// class.
- public static final File EXT_LIB_DIR = new File((new File(ClassPathLoader.class.getProtectionDomain().getCodeSource()
- .getLocation().getPath())).getParent(), "ext");
+ public static final String EXT_LIB_DIR_PARENT_PROPERTY = "gemfire.ClassPathLoader.EXT_LIB_DIR";
+ public static final String EXT_LIB_DIR_PARENT_DEFAULT = ClassPathLoader.class.getProtectionDomain().getCodeSource().getLocation().getPath();
+ static final File defineEXT_LIB_DIR() {
+ return new File((new File(System.getProperty(EXT_LIB_DIR_PARENT_PROPERTY, EXT_LIB_DIR_PARENT_DEFAULT))).getParent(), "ext");
+ }
// This token is placed into the list of class loaders to determine where
// to insert the TCCL when in forName(...), getResource(...), etc.
@@ -205,6 +208,7 @@ public final class ClassPathLoader {
// Add user JAR files from the EXT_LIB_DIR directory using a single ClassLoader
try {
+ File EXT_LIB_DIR = defineEXT_LIB_DIR();
if (EXT_LIB_DIR.exists()) {
if (!EXT_LIB_DIR.isDirectory() || !EXT_LIB_DIR.canRead()) {
logger.warn("Cannot read from directory when attempting to load JAR files: {}", EXT_LIB_DIR.getAbsolutePath());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/SystemFailureJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/SystemFailureJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/SystemFailureJUnitTest.java
index b138e7f..6d9dcbc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/SystemFailureJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/SystemFailureJUnitTest.java
@@ -33,6 +33,7 @@ public class SystemFailureJUnitTest {
private static final int LONG_WAIT = 30000;
private int oldWaitTime;
+
@Before
public void setWaitTime() {
oldWaitTime = SystemFailure.SHUTDOWN_WAIT;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/TXJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/TXJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/TXJUnitTest.java
index ff24d24..acdba69 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/TXJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/TXJUnitTest.java
@@ -3069,7 +3069,7 @@ public class TXJUnitTest {
assertNotNull(event.getRegion().getCache());
assertNotNull(event.getRegion().getCache().getCacheTransactionManager());
assertEquals(this.getTXId(), event.getTransactionId());
- // assertEquals(event.getTransactionId(), event.getRegion().getCache().getCacheTransactionManager().getTransactionId(), );
+ // assertIndexDetailsEquals(event.getTransactionId(), event.getRegion().getCache().getCacheTransactionManager().getTransactionId(), );
if (!isPR()) assertEquals("IsDistributed Assertion!", this.isDistributed(), event.isDistributed());
assertEquals(this.getKey(), event.getKey());
assertSame(this.getCallBackArg(), event.getCallbackArgument());
@@ -3753,28 +3753,28 @@ public class TXJUnitTest {
assertTrue(!txIt.hasNext());
}
reg1.invalidate("key1");
-// assertEquals(0, nonTxKeys.size());
+// assertIndexDetailsEquals(0, nonTxKeys.size());
assertEquals(1, txKeys.size());
-// assertEquals(0, nonTxValues.size());
+// assertIndexDetailsEquals(0, nonTxValues.size());
assertEquals(0, txValues.size());
assertTrue(txKeys.contains("key1"));
assertTrue(!txValues.contains("value1"));
reg1.create("key2", "value2");
reg1.create("key3", "value3");
-// assertEquals(0, nonTxKeys.size());
+// assertIndexDetailsEquals(0, nonTxKeys.size());
assertEquals(3, txKeys.size());
-// assertEquals(0, nonTxValues.size());
+// assertIndexDetailsEquals(0, nonTxValues.size());
assertEquals(2, txValues.size());
reg1.put("key1", "value1");
-// assertEquals(0, nonTxKeys.size());
+// assertIndexDetailsEquals(0, nonTxKeys.size());
assertEquals(3, txKeys.size());
-// assertEquals(0, nonTxValues.size());
+// assertIndexDetailsEquals(0, nonTxValues.size());
assertEquals(3, txValues.size());
reg1.localInvalidate("key2");
-// assertEquals(0, nonTxValues.size());
+// assertIndexDetailsEquals(0, nonTxValues.size());
assertEquals(2, txValues.size());
reg1.invalidate("key1");
-// assertEquals(0, nonTxValues.size());
+// assertIndexDetailsEquals(0, nonTxValues.size());
assertEquals(1, txValues.size());
reg1.destroy("key2");
reg1.destroy("key3");
@@ -3813,7 +3813,7 @@ public class TXJUnitTest {
this.txMgr.begin();
reg1.create("key1", "value1");
Collection txValues = reg1.values();
-// assertEquals(0, nonTxValues.size());
+// assertIndexDetailsEquals(0, nonTxValues.size());
assertEquals(1, txValues.size());
assertTrue(txValues.contains("value1"));
{
@@ -3880,7 +3880,7 @@ public class TXJUnitTest {
assertEquals(1, txValues.size());
assertTrue(txValues.iterator().hasNext());
assertEquals("txValue1", txValues.iterator().next());
-// assertEquals(0, nonTxValues.size());
+// assertIndexDetailsEquals(0, nonTxValues.size());
// non-TX collections can now be used in a transactional context
try {
nonTxValues.iterator().hasNext();
@@ -4132,7 +4132,7 @@ public class TXJUnitTest {
assertEquals("LV 2", reg1.getEntry("key1").getValue());
this.txMgr.rollback();
assertTrue(!reg1.containsKey("key1"));
- // assertEquals("LV 2", reg1.getEntry("key1").getValue());
+ // assertIndexDetailsEquals("LV 2", reg1.getEntry("key1").getValue());
// reg1.localDestroy("key1");
// TX load: commit check
this.txMgr.begin();
@@ -5623,7 +5623,7 @@ public class TXJUnitTest {
lruRegion.create("key" + i, null);
}
assertLRUEntries(lruRegion.entrySet(false), lruSize, "key", LRUENTRY_NULL);
- // assertEquals(lruSize, lruRegion.entrySet(false).size());
+ // assertIndexDetailsEquals(lruSize, lruRegion.entrySet(false).size());
this.txMgr.begin();
for(int i=0; i<numToPut; ++i) {
lruRegion.get("key"+i, new Integer(i));
@@ -5688,8 +5688,8 @@ public class TXJUnitTest {
// LocalRegion lrReg = (LocalRegion) lruRegion;
// LRUClockNode lruE = null;
// assertNotNull(lruE = (LRUClockNode) lrReg.basicGetEntry("key"+(numToPut-1)));
- // assertEquals(2, lruE.getRefCount());
- // assertEquals(lruSize, lruRegion.entrySet(false).size());
+ // assertIndexDetailsEquals(2, lruE.getRefCount());
+ // assertIndexDetailsEquals(lruSize, lruRegion.entrySet(false).size());
// Force the Non-Tx "put" to remove each attempt since region is full
// and all the committed entries are currently part of a TX
@@ -6384,7 +6384,7 @@ public class TXJUnitTest {
}
waitForUpdates(aIindex0, 4);
// waitForKeys(aIindex0, 3);
-// assertEquals(3, aIindex0.getStatistics().getNumberOfKeys()); // Shouldn't this be 1, again?
+// assertIndexDetailsEquals(3, aIindex0.getStatistics().getNumberOfKeys()); // Shouldn't this be 1, again?
assertEquals(2, aIindex0.getStatistics().getNumberOfValues());
assertEquals(4, aIindex0.getStatistics().getNumUpdates());
@@ -6413,7 +6413,7 @@ public class TXJUnitTest {
assertEquals(2, aIindex1.getStatistics().getNumberOfKeys());
assertEquals(2, aIindex1.getStatistics().getNumberOfValues());
assertEquals(2, aIindex1.getStatistics().getNumUpdates());
-// assertEquals(3, aIindex0.getStatistics().getNumberOfKeys());
+// assertIndexDetailsEquals(3, aIindex0.getStatistics().getNumberOfKeys());
assertEquals(2, aIindex0.getStatistics().getNumberOfValues());
assertEquals(4, aIindex0.getStatistics().getNumUpdates());
@@ -6456,7 +6456,7 @@ public class TXJUnitTest {
waitForUpdates(aIindex1, 2);
waitForKeys(aIindex0, 2);
// waitForKeys(aIindex1, 2);
-// assertEquals(2, aIindex1.getStatistics().getNumberOfKeys());
+// assertIndexDetailsEquals(2, aIindex1.getStatistics().getNumberOfKeys());
assertEquals(2, aIindex1.getStatistics().getNumberOfValues());
assertEquals(2, aIindex1.getStatistics().getNumUpdates());
assertEquals(2, aIindex0.getStatistics().getNumberOfKeys());
@@ -6501,7 +6501,7 @@ public class TXJUnitTest {
assertEquals(3, aIindex1.getStatistics().getNumberOfKeys());
assertEquals(3, aIindex1.getStatistics().getNumberOfValues()); // Shouldn't this be 4?
assertEquals(5, aIindex1.getStatistics().getNumUpdates());
- //assertEquals(4, aIindex0.getStatistics().getNumberOfKeys());
+ //assertIndexDetailsEquals(4, aIindex0.getStatistics().getNumberOfKeys());
assertEquals(3, aIindex0.getStatistics().getNumberOfValues()); // Shouldn't this be 4?
assertEquals(7, aIindex0.getStatistics().getNumUpdates());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/cache/AttributesFactoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/AttributesFactoryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/AttributesFactoryJUnitTest.java
index a1d374f..69f0092 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/AttributesFactoryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/AttributesFactoryJUnitTest.java
@@ -16,13 +16,14 @@
*/
package com.gemstone.gemfire.cache;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.util.Arrays;
+import org.junit.Test;
import org.junit.experimental.categories.Category;
-import junit.framework.TestCase;
-
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
import com.gemstone.gemfire.compression.SnappyCompressor;
@@ -31,18 +32,12 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
/**
* Tests the functionality of the {@link AttributesFactory} class.
*
- *
* @since 3.0
*/
@Category(UnitTest.class)
-public class AttributesFactoryJUnitTest extends TestCase {
-
- public AttributesFactoryJUnitTest(String name) {
- super(name);
- }
-
- /////////////////////// Test Methods ///////////////////////
+public class AttributesFactoryJUnitTest {
+ @Test
public void testCopyConstructor() {
AttributesFactory f1 = new AttributesFactory();
f1.setLockGrantor(true);
@@ -60,6 +55,7 @@ public class AttributesFactoryJUnitTest extends TestCase {
* Tests the {@link AttributesFactory#create} throws
* the appropriate exception with poorly-configured factory.
*/
+ @Test
public void testInvalidConfigurations() {
AttributesFactory factory;
@@ -233,6 +229,7 @@ public class AttributesFactoryJUnitTest extends TestCase {
* default} attributes factory has the advertised default
* configuration.
*/
+ @Test
public void testDefaultConfiguration() {
AttributesFactory factory = new AttributesFactory();
RegionAttributes attrs = factory.create();
@@ -275,6 +272,8 @@ public class AttributesFactoryJUnitTest extends TestCase {
assertEquals(1, diskSizes.length);
assertEquals(DiskStoreFactory.DEFAULT_DISK_DIR_SIZE, diskSizes[0]);
}
+
+ @Test
public void testDiskSynchronous() {
{
AttributesFactory factory = new AttributesFactory();
@@ -316,10 +315,12 @@ public class AttributesFactoryJUnitTest extends TestCase {
assertEquals(false, attrs.isDiskSynchronous());
}
}
+
/**
* Tests the cacheListener functionality
* @since 5.0
*/
+ @Test
public void testCacheListeners() {
RegionAttributes ra;
CacheListener cl1 = new MyCacheListener();
@@ -386,9 +387,11 @@ public class AttributesFactoryJUnitTest extends TestCase {
ra = factory.create();
assertEquals(Arrays.asList(new CacheListener[]{cl2}), Arrays.asList(ra.getCacheListeners()));
}
+
/**
* @since 5.7
*/
+ @Test
public void testConnectionPool() {
CacheLoader cl = new CacheLoader() {
public Object load(LoaderHelper helper) throws CacheLoaderException {
@@ -413,7 +416,7 @@ public class AttributesFactoryJUnitTest extends TestCase {
* Trivial cache listener impl
* @since 5.0
*/
- public static class MyCacheListener extends CacheListenerAdapter {
+ private static class MyCacheListener extends CacheListenerAdapter {
// empty impl
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug36619JUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug36619JUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug36619JUnitTest.java
deleted file mode 100644
index 9f0e458..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug36619JUnitTest.java
+++ /dev/null
@@ -1,77 +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.cache;
-
-import java.io.*;
-
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-
-import junit.framework.TestCase;
-
-/** Tests classes of Bug36619 to make sure they are Serializable */
-@Category(UnitTest.class)
-public class Bug36619JUnitTest extends TestCase {
-
- public Bug36619JUnitTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Assert that MembershipAttributes are serializable.
- */
- public void testMembershipAttributesAreSerializable() throws Exception {
- String[] roles = {"a", "b", "c"};
- MembershipAttributes outMA = new MembershipAttributes(roles);
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(outMA);
-
- byte[] data = baos.toByteArray();
-
- ByteArrayInputStream bais = new ByteArrayInputStream(data);
- ObjectInputStream ois = new ObjectInputStream(bais);
- MembershipAttributes inMA = (MembershipAttributes) ois.readObject();
- assertEquals(outMA, inMA);
- }
- /**
- * Assert that SubscriptionAttributes are serializable.
- */
- public void testSubscriptionAttributesAreSerializable() throws Exception {
- SubscriptionAttributes outSA = new SubscriptionAttributes();
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(outSA);
-
- byte[] data = baos.toByteArray();
-
- ByteArrayInputStream bais = new ByteArrayInputStream(data);
- ObjectInputStream ois = new ObjectInputStream(bais);
- SubscriptionAttributes inSA = (SubscriptionAttributes) ois.readObject();
- assertEquals(outSA, inSA);
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java
deleted file mode 100644
index 0ba5154..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java
+++ /dev/null
@@ -1,88 +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.cache;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-
-/**
- * Test case for Trac <a
- * href="https://svn.gemstone.com/trac/gemfire/ticket/52289">#52289</a>.
- *
- * Asserts fixes for bug JDK-8076152 in JDK 1.8.0u20 to 1.8.0.u45.
- * http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8076152
- *
- * The JVM crashes when hotspot compiling a method that uses an array consisting
- * of objects of a base class when different child classes is used as actual
- * instance objects AND when the array is constant (declared final). The crash
- * occurs during process of the aaload byte code.
- *
- * This test and its corrections can be removed after the release of JDK
- * 1.8.0u60 if we choose to not support 1.8.0u20 - 1.8.0u45 inclusive.
- *
- *
- * @since 8.2
- *
- */
-@Category(UnitTest.class)
-public class Bug52289JUnitTest {
-
- @Test
- public void test() throws IOException, ClassNotFoundException {
- // Iterate enough to cause JIT to compile
- // javax.print.attribute.EnumSyntax::readResolve
- for (int i = 0; i < 100_000; i++) {
- // Must execute two or more subclasses with final static arrays of
- // different types.
- doEvictionAlgorithm();
- doEvictionAction();
- }
- }
-
- protected void doEvictionAlgorithm() throws IOException, ClassNotFoundException {
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(EvictionAlgorithm.NONE);
- oos.close();
-
- final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- final ObjectInputStream ois = new ObjectInputStream(bais);
- ois.readObject();
- ois.close();
- }
-
- protected void doEvictionAction() throws IOException, ClassNotFoundException {
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(EvictionAction.NONE);
- oos.close();
-
- final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- final ObjectInputStream ois = new ObjectInputStream(bais);
- ois.readObject();
- ois.close();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/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 bbc2839..3761966 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
@@ -4461,7 +4461,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
};
Wait.waitForCriterion(ev, maxTime, 200, true);
// Set prox = ccn.getClientProxies();
-// assertEquals(1, prox.size());
+// assertIndexDetailsEquals(1, prox.size());
// for (Iterator cpi = prox.iterator(); cpi.hasNext(); ) {
// CacheClientProxy ccp = (CacheClientProxy) cpi.next();
// start = System.currentTimeMillis();
@@ -5447,7 +5447,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
assertNull(r.getEntry(key1));
r.registerInterest(key1);
assertNotNull(r.getEntry(key1));
- assertEquals(val1, r.getEntry(key1).getValue());
+ assertIndexDetailsEquals(val1, r.getEntry(key1).getValue());
r.registerInterest(key2);
assertNull(r.getEntry(key2));
}
@@ -5464,7 +5464,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
factory.setCacheListener(new CertifiableTestCacheListener(getLogWriter()));
Region r = createRootRegion(name, factory.create());
assertNull(r.getEntry(key1));
- assertEquals(val1, r.get(key1));
+ assertIndexDetailsEquals(val1, r.get(key1));
assertNull(r.getEntry(key2));
r.registerInterest(key2);
assertNull(r.getEntry(key2));
@@ -5490,11 +5490,11 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
ctl.waitForUpdated(key1);
assertNotNull(r.getEntry(key1));
- assertEquals(val2, r.getEntry(key1).getValue()); // new value should have been pushed
+ assertIndexDetailsEquals(val2, r.getEntry(key1).getValue()); // new value should have been pushed
ctl.waitForCreated(key2);
assertNotNull(r.getEntry(key2)); // new entry should have been pushed
- assertEquals(val2, r.getEntry(key2).getValue());
+ assertIndexDetailsEquals(val2, r.getEntry(key2).getValue());
}
});
@@ -5507,11 +5507,11 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
ctl.waitForInvalidated(key1);
assertNotNull(r.getEntry(key1));
assertNull(r.getEntry(key1).getValue()); // Invalidate should have been pushed
- assertEquals(val2, r.get(key1)); // New value should be fetched
+ assertIndexDetailsEquals(val2, r.get(key1)); // New value should be fetched
assertNull(r.getEntry(key2));
// assertNull(r.getEntry(key2).getValue());
- assertEquals(val2, r.get(key2)); // New entry should be fetched
+ assertIndexDetailsEquals(val2, r.get(key2)); // New entry should be fetched
}
});
tearDown();
@@ -5740,7 +5740,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
}
};
Wait.waitForCriterion(ev, 10 * 1000, 200, true);
-// assertEquals(3, region.size());
+// assertIndexDetailsEquals(3, region.size());
assertTrue(region.containsKey("k1"));
assertTrue(region.containsKey("k2"));
assertTrue(region.containsKey("k3"));
@@ -5857,7 +5857,7 @@ public class ConnectionPoolDUnitTest extends CacheTestCase {
}
};
Wait.waitForCriterion(ev, 10 * 1000, 200, true);
-// assertEquals(3, region.size());
+// assertIndexDetailsEquals(3, region.size());
assertTrue(region.containsKey("k1"));
assertTrue(region.containsKey("k2"));
assertTrue(region.containsKey("k3"));
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/cache/FinalStaticArrayShouldNotCauseSegFaultTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/FinalStaticArrayShouldNotCauseSegFaultTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/FinalStaticArrayShouldNotCauseSegFaultTest.java
new file mode 100644
index 0000000..4f0335a
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/FinalStaticArrayShouldNotCauseSegFaultTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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.cache;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+/**
+ * Test case for Trac <a
+ * href="https://svn.gemstone.com/trac/gemfire/ticket/52289">#52289</a>.
+ *
+ * Asserts fixes for bug JDK-8076152 in JDK 1.8.0u20 to 1.8.0.u45.
+ * http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8076152
+ *
+ * The JVM crashes when hotspot compiling a method that uses an array consisting
+ * of objects of a base class when different child classes is used as actual
+ * instance objects AND when the array is constant (declared final). The crash
+ * occurs during process of the aaload byte code.
+ *
+ * This test and its corrections can be removed after the release of JDK
+ * 1.8.0u60 if we choose to not support 1.8.0u20 - 1.8.0u45 inclusive.
+ *
+ * @since 8.2
+ */
+@Category(UnitTest.class)
+public class FinalStaticArrayShouldNotCauseSegFaultTest {
+
+ @Test
+ public void test() throws IOException, ClassNotFoundException {
+ // Iterate enough to cause JIT to compile
+ // javax.print.attribute.EnumSyntax::readResolve
+ for (int i = 0; i < 100_000; i++) {
+ // Must execute two or more subclasses with final static arrays of
+ // different types.
+ doEvictionAlgorithm();
+ doEvictionAction();
+ }
+ }
+
+ protected void doEvictionAlgorithm() throws IOException, ClassNotFoundException {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(EvictionAlgorithm.NONE);
+ oos.close();
+
+ final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ final ObjectInputStream ois = new ObjectInputStream(bais);
+ ois.readObject();
+ ois.close();
+ }
+
+ protected void doEvictionAction() throws IOException, ClassNotFoundException {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(EvictionAction.NONE);
+ oos.close();
+
+ final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ final ObjectInputStream ois = new ObjectInputStream(bais);
+ ois.readObject();
+ ois.close();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/cache/MembershipAttributesAreSerializableTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/MembershipAttributesAreSerializableTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/MembershipAttributesAreSerializableTest.java
new file mode 100644
index 0000000..f0e6479
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/MembershipAttributesAreSerializableTest.java
@@ -0,0 +1,74 @@
+/*
+ * 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.cache;
+
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+/**
+ * Tests MembershipAttributes and SubscriptionAttributes to make sure they are Serializable
+ */
+@Category(UnitTest.class)
+public class MembershipAttributesAreSerializableTest {
+
+ /**
+ * Assert that MembershipAttributes are serializable.
+ */
+ @Test
+ public void testMembershipAttributesAreSerializable() throws Exception {
+ String[] roles = {"a", "b", "c"};
+ MembershipAttributes outMA = new MembershipAttributes(roles);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(outMA);
+
+ byte[] data = baos.toByteArray();
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(data);
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ MembershipAttributes inMA = (MembershipAttributes) ois.readObject();
+ assertEquals(outMA, inMA);
+ }
+
+ /**
+ * Assert that SubscriptionAttributes are serializable.
+ */
+ @Test
+ public void testSubscriptionAttributesAreSerializable() throws Exception {
+ SubscriptionAttributes outSA = new SubscriptionAttributes();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(outSA);
+
+ byte[] data = baos.toByteArray();
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(data);
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ SubscriptionAttributes inSA = (SubscriptionAttributes) ois.readObject();
+ assertEquals(outSA, inSA);
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/cache/OperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/OperationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/OperationJUnitTest.java
index 4f23a89..f4bb936 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/OperationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/OperationJUnitTest.java
@@ -16,33 +16,20 @@
*/
package com.gemstone.gemfire.cache;
-import org.junit.experimental.categories.Category;
+import static org.junit.Assert.*;
-import junit.framework.TestCase;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
-import com.gemstone.gemfire.cache.Operation;
import com.gemstone.gemfire.test.junit.categories.UnitTest;
@Category(UnitTest.class)
-public class OperationJUnitTest extends TestCase {
- public OperationJUnitTest(String name) {
- super(name);
- }
-
- public OperationJUnitTest() {
- // TODO Auto-generated constructor stub
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- }
+public class OperationJUnitTest {
- protected void tearDown() throws Exception {
- super.tearDown();
- }
/**
* Check CREATE Operation.
*/
+ @Test
public void testCREATE() {
Operation op = Operation.CREATE;
assertTrue(op.isCreate());
@@ -64,9 +51,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check PUTALL_CREATE Operation.
*/
+ @Test
public void testPUTALL_CREATE() {
Operation op = Operation.PUTALL_CREATE;
assertTrue(op.isCreate());
@@ -88,9 +77,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check SEARCH_CREATE Operation.
*/
+ @Test
public void testSEARCH_CREATE() {
Operation op = Operation.SEARCH_CREATE;
assertTrue(op.isCreate());
@@ -112,9 +103,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check LOCAL_LOAD_CREATE Operation.
*/
+ @Test
public void testLOCAL_LOAD_CREATE() {
Operation op = Operation.LOCAL_LOAD_CREATE;
assertTrue(op.isCreate());
@@ -136,9 +129,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check NET_LOAD_CREATE Operation.
*/
+ @Test
public void testNET_LOAD_CREATE() {
Operation op = Operation.NET_LOAD_CREATE;
assertTrue(op.isCreate());
@@ -160,9 +155,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check UPDATE Operation.
*/
+ @Test
public void testUPDATE() {
Operation op = Operation.UPDATE;
assertFalse(op.isCreate());
@@ -184,9 +181,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check PUTALL_UPDATE Operation.
*/
+ @Test
public void testPUTALL_UPDATE() {
Operation op = Operation.PUTALL_UPDATE;
assertFalse(op.isCreate());
@@ -208,9 +207,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check SEARCH_UPDATE Operation.
*/
+ @Test
public void testSEARCH_UPDATE() {
Operation op = Operation.SEARCH_UPDATE;
assertFalse(op.isCreate());
@@ -232,9 +233,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check LOCAL_LOAD_UPDATE Operation.
*/
+ @Test
public void testLOCAL_LOAD_UPDATE() {
Operation op = Operation.LOCAL_LOAD_UPDATE;
assertFalse(op.isCreate());
@@ -256,9 +259,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check NET_LOAD_UPDATE Operation.
*/
+ @Test
public void testNET_LOAD_UPDATE() {
Operation op = Operation.NET_LOAD_UPDATE;
assertFalse(op.isCreate());
@@ -280,9 +285,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check INVALIDATE Operation.
*/
+ @Test
public void testINVALIDATE() {
Operation op = Operation.INVALIDATE;
assertFalse(op.isCreate());
@@ -304,9 +311,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check LOCAL_INVALIDATE Operation.
*/
+ @Test
public void testLOCAL_INVALIDATE() {
Operation op = Operation.LOCAL_INVALIDATE;
assertFalse(op.isCreate());
@@ -328,9 +337,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check DESTROY Operation.
*/
+ @Test
public void testDESTROY() {
Operation op = Operation.DESTROY;
assertFalse(op.isCreate());
@@ -352,9 +363,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REMOVEALL Operation.
*/
+ @Test
public void testREMOVEALL() {
Operation op = Operation.REMOVEALL_DESTROY;
assertFalse(op.isCreate());
@@ -377,9 +390,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check LOCAL_DESTROY Operation.
*/
+ @Test
public void testLOCAL_DESTROY() {
Operation op = Operation.LOCAL_DESTROY;
assertFalse(op.isCreate());
@@ -401,9 +416,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check EVICT_DESTROY Operation.
*/
+ @Test
public void testEVICT_DESTROY() {
Operation op = Operation.EVICT_DESTROY;
assertFalse(op.isCreate());
@@ -425,9 +442,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_LOAD_SNAPSHOT Operation.
*/
+ @Test
public void testREGION_LOAD_SNAPSHOT() {
Operation op = Operation.REGION_LOAD_SNAPSHOT;
assertFalse(op.isCreate());
@@ -449,9 +468,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_LOCAL_DESTROY Operation.
*/
+ @Test
public void testREGION_LOCAL_DESTROY() {
Operation op = Operation.REGION_LOCAL_DESTROY;
assertFalse(op.isCreate());
@@ -473,9 +494,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_CREATE Operation.
*/
+ @Test
public void testREGION_CREATE() {
Operation op = Operation.REGION_CREATE;
assertFalse(op.isCreate());
@@ -497,9 +520,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_CLOSE Operation.
*/
+ @Test
public void testREGION_CLOSE() {
Operation op = Operation.REGION_CLOSE;
assertFalse(op.isCreate());
@@ -521,9 +546,11 @@ public class OperationJUnitTest extends TestCase {
assertTrue(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_DESTROY Operation.
*/
+ @Test
public void testREGION_DESTROY() {
Operation op = Operation.REGION_DESTROY;
assertFalse(op.isCreate());
@@ -545,9 +572,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check EXPIRE_DESTROY Operation.
*/
+ @Test
public void testEXPIRE_DESTROY() {
Operation op = Operation.EXPIRE_DESTROY;
assertFalse(op.isCreate());
@@ -569,9 +598,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check EXPIRE_LOCAL_DESTROY Operation.
*/
+ @Test
public void testEXPIRE_LOCAL_DESTROY() {
Operation op = Operation.EXPIRE_LOCAL_DESTROY;
assertFalse(op.isCreate());
@@ -593,9 +624,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check EXPIRE_INVALIDATE Operation.
*/
+ @Test
public void testEXPIRE_INVALIDATE() {
Operation op = Operation.EXPIRE_INVALIDATE;
assertFalse(op.isCreate());
@@ -617,9 +650,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check EXPIRE_LOCAL_INVALIDATE Operation.
*/
+ @Test
public void testEXPIRE_LOCAL_INVALIDATE() {
Operation op = Operation.EXPIRE_LOCAL_INVALIDATE;
assertFalse(op.isCreate());
@@ -641,9 +676,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_EXPIRE_DESTROY Operation.
*/
+ @Test
public void testREGION_EXPIRE_DESTROY() {
Operation op = Operation.REGION_EXPIRE_DESTROY;
assertFalse(op.isCreate());
@@ -665,9 +702,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_EXPIRE_LOCAL_DESTROY Operation.
*/
+ @Test
public void testREGION_EXPIRE_LOCAL_DESTROY() {
Operation op = Operation.REGION_EXPIRE_LOCAL_DESTROY;
assertFalse(op.isCreate());
@@ -689,9 +728,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_EXPIRE_INVALIDATE Operation.
*/
+ @Test
public void testREGION_EXPIRE_INVALIDATE() {
Operation op = Operation.REGION_EXPIRE_INVALIDATE;
assertFalse(op.isCreate());
@@ -713,9 +754,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_EXPIRE_LOCAL_INVALIDATE Operation.
*/
+ @Test
public void testREGION_EXPIRE_LOCAL_INVALIDATE() {
Operation op = Operation.REGION_EXPIRE_LOCAL_INVALIDATE;
assertFalse(op.isCreate());
@@ -737,9 +780,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_LOCAL_INVALIDATE Operation.
*/
+ @Test
public void testREGION_LOCAL_INVALIDATE() {
Operation op = Operation.REGION_LOCAL_INVALIDATE;
assertFalse(op.isCreate());
@@ -761,9 +806,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_INVALIDATE Operation.
*/
+ @Test
public void testREGION_INVALIDATE() {
Operation op = Operation.REGION_INVALIDATE;
assertFalse(op.isCreate());
@@ -777,17 +824,19 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isLocal());
assertTrue(op.isDistributed());
assertFalse(op.isEntry());
+ assertFalse(op.isClose());
assertFalse(op.isExpiration());
assertFalse(op.isLocalLoad());
assertFalse(op.isNetLoad());
assertFalse(op.isLoad());
assertFalse(op.isNetSearch());
- assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_CLEAR Operation.
*/
+ @Test
public void testREGION_CLEAR() {
Operation op = Operation.REGION_CLEAR;
assertFalse(op.isCreate());
@@ -809,9 +858,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertTrue(op.isClear());
}
+
/**
* Check REGION_LOCAL_CLEAR Operation.
*/
+ @Test
public void testREGION_LOCAL_CLEAR() {
Operation op = Operation.REGION_LOCAL_CLEAR;
assertFalse(op.isCreate());
@@ -833,9 +884,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertTrue(op.isClear());
}
+
/**
* Check CACHE_CREATE Operation
*/
+ @Test
public void testCACHE_CREATE() {
Operation op = Operation.CACHE_CREATE;
assertFalse(op.isCreate());
@@ -857,9 +910,11 @@ public class OperationJUnitTest extends TestCase {
assertFalse(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check CACHE_CLOSE Operation.
*/
+ @Test
public void testCACHE_CLOSE() {
Operation op = Operation.CACHE_CLOSE;
assertFalse(op.isCreate());
@@ -881,9 +936,11 @@ public class OperationJUnitTest extends TestCase {
assertTrue(op.isClose());
assertFalse(op.isClear());
}
+
/**
* Check REGION_REINITIALIZE Operation.
*/
+ @Test
public void testREGION_REINITIALIZE() {
Operation op = Operation.REGION_REINITIALIZE;
assertFalse(op.isCreate());
@@ -909,6 +966,7 @@ public class OperationJUnitTest extends TestCase {
/**
* Check UPDATE_VERSION Operation.
*/
+ @Test
public void testUPDATE_VERSION() {
Operation op = Operation.UPDATE_VERSION_STAMP;
assertFalse(op.isCreate());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ef0a6243/geode-core/src/test/java/com/gemstone/gemfire/cache/RoleExceptionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/RoleExceptionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache/RoleExceptionJUnitTest.java
index 42c146f..61d550b 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/RoleExceptionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/RoleExceptionJUnitTest.java
@@ -16,35 +16,27 @@
*/
package com.gemstone.gemfire.cache;
+import static org.junit.Assert.*;
+
import java.io.*;
import java.util.*;
+import org.junit.Test;
import org.junit.experimental.categories.Category;
-import junit.framework.TestCase;
-
import com.gemstone.gemfire.distributed.internal.membership.InternalRole;
import com.gemstone.gemfire.test.junit.categories.UnitTest;
-/** Tests the subclasses of RoleException to make sure they are Serializable */
+/**
+ * Tests the subclasses of RoleException to make sure they are Serializable
+ */
@Category(UnitTest.class)
-public class RoleExceptionJUnitTest extends TestCase {
+public class RoleExceptionJUnitTest {
- public RoleExceptionJUnitTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
/**
* Assert that RegionAccessException is serializable.
*/
+ @Test
public void testRegionAccessExceptionIsSerializable() throws Exception {
RegionAccessException out = createRegionAccessException();
ByteArrayOutputStream baos = new ByteArrayOutputStream(100);
@@ -65,6 +57,7 @@ public class RoleExceptionJUnitTest extends TestCase {
/**
* Assert that RegionDistributionException is serializable.
*/
+ @Test
public void testRegionDistributionExceptionIsSerializable() throws Exception {
RegionDistributionException out = createRegionDistributionException();
ByteArrayOutputStream baos = new ByteArrayOutputStream(100);
@@ -85,6 +78,7 @@ public class RoleExceptionJUnitTest extends TestCase {
/**
* Assert that CommitDistributionException is serializable.
*/
+ @Test
public void testCommitDistributionExceptionIsSerializable() throws Exception {
String s = "MyString";
Set outExceptions = new HashSet();