From 67acab0974bc40d0c5c4759705a04d1200fc0533 Mon Sep 17 00:00:00 2001
From: strangelookingnerd
<49242855+strangelookingnerd@users.noreply.github.com>
Date: Wed, 13 Nov 2024 10:22:55 +0100
Subject: [PATCH] Migrate tests to JUnit5
* use JUnit5 annotations
* use JUnit5 Assertions and Assumptions
* remove public visibility from tests
* remove junit-vintage-engine dependency
---
commons-jcs3-core/pom.xml | 13 +-
.../jcs3/ConcurrentRemovalLoadTest.java | 155 +++++-------
.../JCSCacheElementRetrievalUnitTest.java | 14 +-
.../JCSConcurrentCacheAccessUnitTest.java | 30 +--
.../commons/jcs3/JCSLightLoadUnitTest.java | 20 +-
.../jcs3/JCSRemovalSimpleConcurrentTest.java | 38 +--
.../apache/commons/jcs3/JCSThrashTest.java | 32 +--
.../org/apache/commons/jcs3/JCSUnitTest.java | 10 +-
.../jcs3/JCSvsHashtablePerformanceTest.java | 8 +-
.../apache/commons/jcs3/RemovalTestUtil.java | 10 +-
.../commons/jcs3/TestTCPLateralCache.java | 81 +++----
.../commons/jcs3/ZeroSizeCacheUnitTest.java | 18 +-
.../jcs3/access/CacheAccessUnitTest.java | 109 ++++-----
.../jcs3/access/GroupCacheAccessUnitTest.java | 62 ++---
.../jcs3/access/SystemPropertyUnitTest.java | 69 +++---
.../commons/jcs3/admin/AdminBeanUnitTest.java | 38 +--
.../jcs3/admin/CountingStreamUnitTest.java | 23 +-
.../AuxiliaryCacheConfiguratorUnitTest.java | 36 +--
.../disk/AbstractDiskCacheUnitTest.java | 36 +--
.../disk/PurgatoryElementUnitTest.java | 26 +-
.../block/AbstractBlockDiskCacheUnitTest.java | 43 ++--
.../BlockDiskCacheConcurrentUnitTest.java | 149 ++++--------
.../block/BlockDiskCacheKeyStoreUnitTest.java | 40 ++--
...lockDiskCacheRandomConcurrentTestUtil.java | 12 +-
...DiskCacheSameRegionConcurrentUnitTest.java | 103 ++++----
.../block/BlockDiskCacheSteadyLoadTest.java | 6 +-
.../disk/block/BlockDiskUnitTest.java | 104 ++++----
.../HugeQuantityBlockDiskCacheLoadTest.java | 16 +-
.../AbstractIndexDiskCacheUnitTest.java | 105 +++++----
.../HugeQuantityIndDiskCacheLoadTest.java | 14 +-
.../indexed/IndexDiskCacheCountUnitTest.java | 22 +-
.../indexed/IndexDiskCacheSizeUnitTest.java | 22 +-
...DiskCacheConcurrentNoDeadLockUnitTest.java | 113 ++++-----
.../IndexedDiskCacheConcurrentUnitTest.java | 167 ++++---------
...IndexedDiskCacheDefragPerformanceTest.java | 6 +-
.../IndexedDiskCacheKeyStoreUnitTest.java | 49 ++--
.../IndexedDiskCacheNoMemoryUnitTest.java | 104 +++-----
.../IndexedDiskCacheOptimizationUnitTest.java | 27 +--
...exedDiskCacheRandomConcurrentTestUtil.java | 2 +-
...DiskCacheSameRegionConcurrentUnitTest.java | 162 +++++--------
.../IndexedDiskCacheSteadyLoadTest.java | 6 +-
.../disk/indexed/LRUMapSizeVsCount.java | 6 +-
.../jdbc/JDBCDataSourceFactoryUnitTest.java | 35 +--
.../jdbc/JDBCDiskCacheRemovalUnitTest.java | 21 +-
.../jdbc/JDBCDiskCacheSharedPoolUnitTest.java | 25 +-
.../jdbc/JDBCDiskCacheShrinkUnitTest.java | 49 ++--
.../disk/jdbc/JDBCDiskCacheUnitTest.java | 32 +--
.../hsql/HSQLDiskCacheConcurrentUnitTest.java | 109 ++++-----
.../disk/jdbc/hsql/HSQLDiskCacheUnitTest.java | 34 +--
.../MySQLDiskCacheHsqlBackedUnitTest.java | 29 +--
.../jdbc/mysql/MySQLDiskCacheUnitTest.java | 11 +-
.../util/ScheduleParserUtilUnitTest.java | 26 +-
.../LateralCacheNoWaitFacadeUnitTest.java | 49 ++--
.../LateralTCPConcurrentRandomTestUtil.java | 8 +-
.../LateralTCPDiscoveryListenerUnitTest.java | 51 ++--
...ateralTCPFilterRemoveHashCodeUnitTest.java | 26 +-
.../LateralTCPIssueRemoveOnPutUnitTest.java | 28 +--
.../LateralTCPNoDeadLockConcurrentTest.java | 114 ++++-----
.../socket/tcp/TestTCPLateralUnitTest.java | 55 ++---
.../remote/RemoteCacheListenerUnitTest.java | 28 +--
.../RemoteCacheNoWaitFacadeUnitTest.java | 43 ++--
.../remote/RemoteCacheNoWaitUnitTest.java | 40 ++--
.../auxiliary/remote/RemoteCacheUnitTest.java | 87 +++----
.../auxiliary/remote/RemoteUtilsUnitTest.java | 20 +-
.../auxiliary/remote/TestRemoteCache.java | 16 +-
.../ZombieRemoteCacheServiceUnitTest.java | 24 +-
.../client/RemoteHttpCacheClientUnitTest.java | 66 +++---
.../RemoteHttpCacheFactoryUnitTest.java | 34 +--
.../client/RemoteHttpCacheManualTester.java | 14 +-
.../RemoteHttpCacheServiceUnitTest.java | 42 ++--
.../RemoteHttpCacheServletUnitTest.java | 70 +++---
.../BasicRemoteCacheClientServerUnitTest.java | 188 ++++++---------
.../RemoteCacheServerAttributesUnitTest.java | 24 +-
.../RemoteCacheServerFactoryUnitTest.java | 55 +++--
.../server/RemoteCacheServerUnitTest.java | 120 +++++-----
...tConfigurableRMISocketFactoryUnitTest.java | 7 +-
.../RemoteCacheRequestFactoryUnitTest.java | 56 ++---
.../CacheEventQueueFactoryUnitTest.java | 22 +-
.../engine/EventQueueConcurrentLoadTest.java | 223 ++++++------------
.../engine/SystemPropertyUsageUnitTest.java | 34 +--
.../ZombieCacheServiceNonLocalUnitTest.java | 24 +-
.../control/CacheManagerStatsUnitTest.java | 15 +-
.../CompositeCacheConfiguratorUnitTest.java | 18 +-
.../CompositeCacheDiskUsageUnitTest.java | 52 ++--
.../control/CompositeCacheManagerTest.java | 12 +-
.../control/CompositeCacheUnitTest.java | 28 +--
.../event/SimpleEventHandlingUnitTest.java | 70 +++---
.../CacheEventLoggerDebugLoggerUnitTest.java | 40 ++--
.../match/KeyMatcherPatternImpllUnitTest.java | 20 +-
.../memory/fifo/FIFOMemoryCacheUnitTest.java | 22 +-
.../LHMLRUMemoryCacheConcurrentUnitTest.java | 96 +++-----
.../memory/lru/LHMLRUMemoryCacheUnitTest.java | 59 ++---
.../lru/LRUMemoryCacheConcurrentUnitTest.java | 73 +++---
.../memory/mru/LRUvsMRUPerformanceTest.java | 4 +-
.../memory/mru/MRUMemoryCacheUnitTest.java | 59 ++---
.../shrinking/ShrinkerThreadUnitTest.java | 58 ++---
.../SoftReferenceMemoryCacheUnitTest.java | 57 ++---
.../log/LogManagerNoLogSystemUnitTest.java | 18 +-
.../commons/jcs3/log/LogManagerUnitTest.java | 8 +-
.../jcs3/utils/access/JCSWorkerUnitTest.java | 12 +-
.../utils/config/PropertySetterUnitTest.java | 23 +-
.../UDPDiscoverySenderEncryptedUnitTest.java | 51 ++--
.../discovery/UDPDiscoverySenderUnitTest.java | 51 ++--
.../UDPDiscoveryServiceUnitTest.java | 84 +++----
.../utils/discovery/UDPDiscoveryUnitTest.java | 22 +-
.../jcs3/utils/net/HostNameUtilUnitTest.java | 11 +-
.../CompressingSerializerUnitTest.java | 36 +--
.../EncryptingSerializerUnitTest.java | 35 +--
.../SerializationConversionUtilUnitTest.java | 54 ++---
.../serialization/SerializerUnitTest.java | 27 ++-
.../StandardSerializerUnitTest.java | 30 +--
.../struct/DoubleLinkedListDumpUnitTest.java | 12 +-
.../struct/DoubleLinkedListUnitTest.java | 46 ++--
.../JCSvsCommonsLRUMapPerformanceTest.java | 6 +-
.../struct/LRUMapConcurrentUnitTest.java | 167 ++++---------
.../utils/struct/LRUMapPerformanceTest.java | 6 +-
.../jcs3/utils/struct/LRUMapUnitTest.java | 32 +--
.../threadpool/ThreadPoolManagerUnitTest.java | 20 +-
.../utils/zip/CompressionUtilUnitTest.java | 10 +-
commons-jcs3-jcache-extras/pom.xml | 5 -
.../jcache/extras/InternalCacheExtension.java | 89 +++++++
.../jcs3/jcache/extras/InternalCacheRule.java | 83 -------
.../extras/cdi/ExtraJCacheExtensionTest.java | 29 +--
.../extras/loader/CacheLoaderAdapterTest.java | 16 +-
.../loader/CompositeCacheLoaderTest.java | 14 +-
.../jcache/extras/web/JCacheFilterTest.java | 19 +-
.../extras/writer/CacheWriterAdapterTest.java | 18 +-
.../writer/CompositeCacheWriterTest.java | 16 +-
commons-jcs3-jcache-openjpa/pom.xml | 5 -
.../openjpa/OpenJPAJCacheDataCacheTest.java | 14 +-
commons-jcs3-jcache-tck/pom.xml | 5 -
.../EnsureCDIIsTestedWhenTCKsRunTest.java | 8 +-
commons-jcs3-jcache/pom.xml | 7 +-
.../apache/commons/jcs3/jcache/CacheTest.java | 59 ++---
.../jcs3/jcache/CachingProviderTest.java | 18 +-
.../jcs3/jcache/ExpiryListenerTest.java | 13 +-
.../jcs3/jcache/ImmediateExpiryTest.java | 8 +-
.../jcs3/jcache/NotSerializableTest.java | 12 +-
.../jcs3/jcache/cdi/CDIJCacheHelperTest.java | 12 +-
.../commons-jcs3-filecache/pom.xml | 5 -
.../commons-jcs3-yajcache/pom.xml | 5 -
pom.xml | 10 +-
142 files changed, 2686 insertions(+), 3273 deletions(-)
create mode 100644 commons-jcs3-jcache-extras/src/test/java/org/apache/commons/jcs3/jcache/extras/InternalCacheExtension.java
delete mode 100644 commons-jcs3-jcache-extras/src/test/java/org/apache/commons/jcs3/jcache/extras/InternalCacheRule.java
diff --git a/commons-jcs3-core/pom.xml b/commons-jcs3-core/pom.xml
index 52e3a30e7..ea6ab9820 100644
--- a/commons-jcs3-core/pom.xml
+++ b/commons-jcs3-core/pom.xml
@@ -95,11 +95,6 @@
junit-jupiter
test
-
- org.junit.vintage
- junit-vintage-engine
- test
-