Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheService.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheService.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheService.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheService.java Fri May 24 09:26:50 2019 @@ -49,10 +49,10 @@ public class MockRemoteCacheService<K, V public ICacheElement<K, V> lastUpdate; /** List of updates. */ - public List<ICacheElement<K, V>> updateRequestList = new ArrayList<ICacheElement<K,V>>(); + public List<ICacheElement<K, V>> updateRequestList = new ArrayList<>(); /** List of request ids. */ - public List<Long> updateRequestIdList = new ArrayList<Long>(); + public List<Long> updateRequestIdList = new ArrayList<>(); /** The key that was last passed to remove. */ public K lastRemoveKey; @@ -80,7 +80,7 @@ public class MockRemoteCacheService<K, V @Override public Set<K> getKeySet( String cacheName ) { - return new HashSet<K>(); + return new HashSet<>(); } /** @@ -195,7 +195,7 @@ public class MockRemoteCacheService<K, V public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId ) { lastGetMultipleKeys = keys; - return new HashMap<K, ICacheElement<K, V>>(); + return new HashMap<>(); } /** @@ -236,6 +236,6 @@ public class MockRemoteCacheService<K, V throws IOException { lastGetMatchingPattern = pattern; - return new HashMap<K, ICacheElement<K, V>>(); + return new HashMap<>(); } }
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheClientTester.java Fri May 24 09:26:50 2019 @@ -158,11 +158,11 @@ public class RemoteCacheClientTester p( "subscribing to the server" ); watch.addCacheListener( "testCache", this ); - ICacheElement<String, String> cb = new CacheElement<String, String>( "testCache", "testKey", "testVal" ); + ICacheElement<String, String> cb = new CacheElement<>( "testCache", "testKey", "testVal" ); for ( int i = 0; i < count; i++ ) { - cb = new CacheElement<String, String>( "testCache", "" + i, "" + i ); + cb = new CacheElement<>( "testCache", "" + i, "" + i ); if ( delete ) { Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java Fri May 24 09:26:50 2019 @@ -55,7 +55,7 @@ public class RemoteCacheListenerUnitTest IRemoteCacheAttributes irca = new RemoteCacheAttributes(); irca.setRemoveUponRemotePut( false ); ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); - RemoteCacheListener<String, String> listener = new RemoteCacheListener<String, String>( irca, cacheMgr, new StandardSerializer() ); + RemoteCacheListener<String, String> listener = new RemoteCacheListener<>( irca, cacheMgr, new StandardSerializer() ); String cacheName = "testName"; String key = "key"; @@ -66,7 +66,7 @@ public class RemoteCacheListenerUnitTest IElementSerializer elementSerializer = new StandardSerializer(); ICacheElementSerialized<String, String> element = - new CacheElementSerialized<String, String>( cacheName, key, elementSerializer + new CacheElementSerialized<>( cacheName, key, elementSerializer .serialize( value ), attr ); // DO WORK @@ -98,7 +98,7 @@ public class RemoteCacheListenerUnitTest IRemoteCacheAttributes irca = new RemoteCacheAttributes(); irca.setRemoveUponRemotePut( true ); ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); - RemoteCacheListener<String, String> listener = new RemoteCacheListener<String, String>( irca, cacheMgr, new StandardSerializer() ); + RemoteCacheListener<String, String> listener = new RemoteCacheListener<>( irca, cacheMgr, new StandardSerializer() ); String cacheName = "testName"; String key = "key"; @@ -109,7 +109,7 @@ public class RemoteCacheListenerUnitTest IElementSerializer elementSerializer = new StandardSerializer(); ICacheElementSerialized<String, String> element = - new CacheElementSerialized<String, String>( cacheName, key, elementSerializer + new CacheElementSerialized<>( cacheName, key, elementSerializer .serialize( value ), attr ); // DO WORK Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java Fri May 24 09:26:50 2019 @@ -38,15 +38,15 @@ public class RemoteCacheNoWaitFacadeUnit public void testAddNoWait_InList() { // SETUP - List<RemoteCacheNoWait<String, String>> noWaits = new ArrayList<RemoteCacheNoWait<String,String>>(); + List<RemoteCacheNoWait<String, String>> noWaits = new ArrayList<>(); IRemoteCacheAttributes cattr = new RemoteCacheAttributes(); cattr.setCacheName( "testCache1" ); - RemoteCache<String, String> client = new RemoteCache<String, String>(cattr, null, null, null); - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + RemoteCache<String, String> client = new RemoteCache<>(cattr, null, null, null); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); noWaits.add( noWait ); - RemoteCacheNoWaitFacade<String, String> facade = new RemoteCacheNoWaitFacade<String, String>(noWaits, cattr, null, null, null ); + RemoteCacheNoWaitFacade<String, String> facade = new RemoteCacheNoWaitFacade<>(noWaits, cattr, null, null, null ); // VERIFY assertEquals( "Should have one entry.", 1, facade.noWaits.size() ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java Fri May 24 09:26:50 2019 @@ -48,10 +48,10 @@ public class RemoteCacheNoWaitUnitTest throws Exception { // SETUP - MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>(); - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<>(); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); - ICacheElement<String, String> element = new CacheElement<String, String>( "testUpdate", "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( "testUpdate", "key", "value" ); // DO WORK noWait.update( element ); @@ -72,10 +72,10 @@ public class RemoteCacheNoWaitUnitTest throws Exception { // SETUP - MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>(); - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<>(); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); - ICacheElement<String, String> input = new CacheElement<String, String>( "testUpdate", "key", "value" ); + ICacheElement<String, String> input = new CacheElement<>( "testUpdate", "key", "value" ); client.getSetupMap.put( "key", input ); // DO WORK @@ -94,14 +94,14 @@ public class RemoteCacheNoWaitUnitTest throws Exception { // SETUP - MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>(); - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<>(); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); - ICacheElement<String, String> inputElement = new CacheElement<String, String>( "testUpdate", "key", "value" ); - Map<String, ICacheElement<String, String>> inputMap = new HashMap<String, ICacheElement<String,String>>(); + ICacheElement<String, String> inputElement = new CacheElement<>( "testUpdate", "key", "value" ); + Map<String, ICacheElement<String, String>> inputMap = new HashMap<>(); inputMap.put( "key", inputElement ); - Set<String> keys = new HashSet<String>(); + Set<String> keys = new HashSet<>(); keys.add( "key" ); client.getMultipleSetupMap.put( keys, inputMap ); @@ -122,8 +122,8 @@ public class RemoteCacheNoWaitUnitTest throws Exception { // SETUP - MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>(); - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<>(); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); String input = "MyKey"; @@ -146,9 +146,9 @@ public class RemoteCacheNoWaitUnitTest throws Exception { // SETUP - MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>(); + MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<>(); client.status = CacheStatus.ALIVE; - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); // DO WORK String result = noWait.getStats(); @@ -166,9 +166,9 @@ public class RemoteCacheNoWaitUnitTest throws Exception { // SETUP - MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>(); + MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<>(); client.status = CacheStatus.ERROR; - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); // DO WORK CacheStatus result = noWait.getStatus(); @@ -187,13 +187,13 @@ public class RemoteCacheNoWaitUnitTest throws Exception { // SETUP - MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>(); + MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<>(); client.status = CacheStatus.ALIVE; - RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client ); + RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<>( client ); - MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>(); + MockRemoteCacheService<String, String> service = new MockRemoteCacheService<>(); - ICacheElement<String, String> element = new CacheElement<String, String>( "testUpdate", "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( "testUpdate", "key", "value" ); // DO WORK noWait.update( element ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheUnitTest.java Fri May 24 09:26:50 2019 @@ -51,8 +51,8 @@ public class RemoteCacheUnitTest { super.setUp(); cattr = new RemoteCacheAttributes(); - service = new MockRemoteCacheService<String, String>(); - listener = new MockRemoteCacheListener<String, String>(); + service = new MockRemoteCacheService<>(); + listener = new MockRemoteCacheListener<>(); monitor = new RemoteCacheMonitor(); } @@ -69,12 +69,12 @@ public class RemoteCacheUnitTest long listenerId = 123; listener.setListenerId( listenerId ); - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); String cacheName = "testUpdate"; // DO WORK - ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( cacheName, "key", "value" ); remoteCache.update( element ); // VERIFY @@ -96,15 +96,15 @@ public class RemoteCacheUnitTest throws Exception { // SETUP - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 10 ); // set the zombie - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, zombie, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, zombie, listener, monitor ); String cacheName = "testUpdate"; // DO WORK - ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( cacheName, "key", "value" ); remoteCache.update( element ); // set the new service, this should call propagate remoteCache.fixCache( service ); @@ -126,12 +126,12 @@ public class RemoteCacheUnitTest public void testUpdate_simple() throws Exception { - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); - ICacheElement<String, String> item = new CacheElement<String, String>( "region", "key", "value" ); + ICacheElement<String, String> item = new CacheElement<>( "region", "key", "value" ); // DO WORK remoteCache.update( item ); @@ -149,7 +149,7 @@ public class RemoteCacheUnitTest public void testGet_simple() throws Exception { - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); @@ -170,13 +170,13 @@ public class RemoteCacheUnitTest public void testGetMultiple_simple() throws Exception { - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); // DO WORK - remoteCache.getMultiple( new HashSet<String>() ); + remoteCache.getMultiple( new HashSet<>() ); // VERIFY assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls ); @@ -191,7 +191,7 @@ public class RemoteCacheUnitTest public void testRemove_simple() throws Exception { - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); @@ -212,7 +212,7 @@ public class RemoteCacheUnitTest public void testRemoveAll_simple() throws Exception { - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); @@ -236,7 +236,7 @@ public class RemoteCacheUnitTest // SETUP String pattern = "adsfasdfasd.?"; - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); @@ -258,7 +258,7 @@ public class RemoteCacheUnitTest public void testDispose_simple() throws Exception { - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, listener, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); @@ -280,7 +280,7 @@ public class RemoteCacheUnitTest throws Exception { // SETUP - RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, null, monitor ); + RemoteCache<String, String> remoteCache = new RemoteCache<>( cattr, service, null, monitor ); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); remoteCache.setCacheEventLogger( cacheEventLogger ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/TestRemoteCache.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/TestRemoteCache.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/TestRemoteCache.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/TestRemoteCache.java Fri May 24 09:26:50 2019 @@ -120,7 +120,7 @@ public class TestRemoteCache for ( int i = 0; i < numMes; i++ ) { String message = "adsfasasfasfasdasf"; - CacheElement<String, String> ce = new CacheElement<String, String>( "key" + 1, "data" + i, message ); + CacheElement<String, String> ce = new CacheElement<>( "key" + 1, "data" + i, message ); cache.update( ce ); // System.out.println( "put " + ce ); } Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java Fri May 24 09:26:50 2019 @@ -39,14 +39,14 @@ public class ZombieRemoteCacheServiceUni throws Exception { // SETUP - MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>(); + MockRemoteCacheService<String, String> service = new MockRemoteCacheService<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 10 ); String cacheName = "testUpdate"; // DO WORK - ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( cacheName, "key", "value" ); zombie.update( element, 123l ); zombie.propagateEvents( service ); @@ -63,14 +63,14 @@ public class ZombieRemoteCacheServiceUni throws Exception { // SETUP - MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>(); + MockRemoteCacheService<String, String> service = new MockRemoteCacheService<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 0 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 0 ); String cacheName = "testUpdate"; // DO WORK - ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( cacheName, "key", "value" ); zombie.update( element, 123l ); zombie.propagateEvents( service ); @@ -87,9 +87,9 @@ public class ZombieRemoteCacheServiceUni throws Exception { // SETUP - MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>(); + MockRemoteCacheService<String, String> service = new MockRemoteCacheService<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 10 ); String cacheName = "testRemoveThenWalk"; String key = "myKey"; @@ -111,9 +111,9 @@ public class ZombieRemoteCacheServiceUni throws Exception { // SETUP - MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>(); + MockRemoteCacheService<String, String> service = new MockRemoteCacheService<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 10 ); String cacheName = "testRemoveThenWalk"; Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java Fri May 24 09:26:50 2019 @@ -45,7 +45,7 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); @@ -74,7 +74,7 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); @@ -82,9 +82,9 @@ public class RemoteHttpCacheClientUnitTe String cacheName = "test"; String key = "key"; - ICacheElement<String, String> expected = new CacheElement<String, String>( cacheName, key, "value" ); + ICacheElement<String, String> expected = new CacheElement<>( cacheName, key, "value" ); RemoteCacheResponse<ICacheElement<String, String>> remoteHttpCacheResponse = - new RemoteCacheResponse<ICacheElement<String,String>>(); + new RemoteCacheResponse<>(); remoteHttpCacheResponse.setPayload( expected ); mockDispatcher.setupRemoteCacheResponse = remoteHttpCacheResponse; @@ -108,7 +108,7 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); @@ -116,11 +116,11 @@ public class RemoteHttpCacheClientUnitTe String cacheName = "test"; String pattern = "key"; - ICacheElement<String, String> expected = new CacheElement<String, String>( cacheName, "key", "value" ); - Map<String, ICacheElement<String, String>> expectedMap = new HashMap<String, ICacheElement<String,String>>(); + ICacheElement<String, String> expected = new CacheElement<>( cacheName, "key", "value" ); + Map<String, ICacheElement<String, String>> expectedMap = new HashMap<>(); expectedMap.put( "key", expected ); RemoteCacheResponse<Map<String, ICacheElement<String, String>>> remoteHttpCacheResponse = - new RemoteCacheResponse<Map<String,ICacheElement<String,String>>>(); + new RemoteCacheResponse<>(); remoteHttpCacheResponse.setPayload( expectedMap ); mockDispatcher.setupRemoteCacheResponse = remoteHttpCacheResponse; @@ -144,7 +144,7 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); @@ -152,11 +152,11 @@ public class RemoteHttpCacheClientUnitTe String cacheName = "test"; Set<String> keys = Collections.emptySet(); - ICacheElement<String, String> expected = new CacheElement<String, String>( cacheName, "key", "value" ); - Map<String, ICacheElement<String, String>> expectedMap = new HashMap<String, ICacheElement<String,String>>(); + ICacheElement<String, String> expected = new CacheElement<>( cacheName, "key", "value" ); + Map<String, ICacheElement<String, String>> expectedMap = new HashMap<>(); expectedMap.put( "key", expected ); RemoteCacheResponse<Map<String, ICacheElement<String, String>>> remoteHttpCacheResponse = - new RemoteCacheResponse<Map<String,ICacheElement<String,String>>>(); + new RemoteCacheResponse<>(); remoteHttpCacheResponse.setPayload( expectedMap ); mockDispatcher.setupRemoteCacheResponse = remoteHttpCacheResponse; @@ -180,7 +180,7 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); @@ -206,7 +206,7 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); @@ -231,14 +231,14 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); String cacheName = "test"; - ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( cacheName, "key", "value" ); // DO WORK client.update( element ); @@ -258,7 +258,7 @@ public class RemoteHttpCacheClientUnitTe { // SETUP RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes(); - RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes ); + RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<>( attributes ); MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher(); client.setRemoteDispatcher( mockDispatcher ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java Fri May 24 09:26:50 2019 @@ -44,12 +44,12 @@ public class RemoteHttpCacheServiceUnitT RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); RemoteHttpCacheService<String, String> server = - new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger ); + new RemoteHttpCacheService<>( manager, rcsa, cacheEventLogger ); String cacheName = "test"; String key = "key"; long requesterId = 2; - CacheElement<String, String> element = new CacheElement<String, String>( cacheName, key, null ); + CacheElement<String, String> element = new CacheElement<>( cacheName, key, null ); // DO WORK server.update( element, requesterId ); @@ -73,7 +73,7 @@ public class RemoteHttpCacheServiceUnitT RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); RemoteHttpCacheService<String, String> server = - new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger ); + new RemoteHttpCacheService<>( manager, rcsa, cacheEventLogger ); // DO WORK server.get( "region", "key" ); @@ -97,7 +97,7 @@ public class RemoteHttpCacheServiceUnitT RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); RemoteHttpCacheService<String, String> server = - new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger ); + new RemoteHttpCacheService<>( manager, rcsa, cacheEventLogger ); // DO WORK server.getMatching( "region", "pattern", 0 ); @@ -121,10 +121,10 @@ public class RemoteHttpCacheServiceUnitT RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); RemoteHttpCacheService<String, String> server = - new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger ); + new RemoteHttpCacheService<>( manager, rcsa, cacheEventLogger ); // DO WORK - server.getMultiple( "region", new HashSet<String>() ); + server.getMultiple( "region", new HashSet<>() ); // VERIFY assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls ); @@ -145,7 +145,7 @@ public class RemoteHttpCacheServiceUnitT RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); RemoteHttpCacheService<String, String> server = - new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger ); + new RemoteHttpCacheService<>( manager, rcsa, cacheEventLogger ); // DO WORK server.remove( "region", "key" ); @@ -169,7 +169,7 @@ public class RemoteHttpCacheServiceUnitT RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); RemoteHttpCacheService<String, String> server = - new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger ); + new RemoteHttpCacheService<>( manager, rcsa, cacheEventLogger ); // DO WORK server.removeAll( "region" ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServletUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServletUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServletUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServletUnitTest.java Fri May 24 09:26:50 2019 @@ -48,7 +48,7 @@ public class RemoteHttpCacheServletUnitT servlet = new RemoteHttpCacheServlet(); servlet.init(null); - remoteHttpCacheService = new MockRemoteCacheService<Serializable, Serializable>(); + remoteHttpCacheService = new MockRemoteCacheService<>(); servlet.setRemoteCacheService( remoteHttpCacheService ); } @@ -133,7 +133,7 @@ public class RemoteHttpCacheServletUnitT String cacheName = "test"; String key = "key"; long requesterId = 2; - CacheElement<Serializable, Serializable> element = new CacheElement<Serializable, Serializable>( cacheName, key, null ); + CacheElement<Serializable, Serializable> element = new CacheElement<>( cacheName, key, null ); RemoteCacheRequest<Serializable, Serializable> request = RemoteCacheRequestFactory.createUpdateRequest( element, requesterId ); // DO WORK Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java Fri May 24 09:26:50 2019 @@ -152,7 +152,7 @@ public class BasicRemoteCacheClientServe // DO WORK int numPutsPrior = server.getPutCount(); - ICacheElement<String, String> element = new CacheElement<String, String>(cache.getCacheName(), "key", "value"); + ICacheElement<String, String> element = new CacheElement<>(cache.getCacheName(), "key", "value"); cache.update(element); SleepUtil.sleepAtLeast(200); @@ -201,7 +201,7 @@ public class BasicRemoteCacheClientServe // DO WORK int numPutsPrior = server.getPutCount(); - ICacheElement<String, String> element = new CacheElement<String, String>(cache.getCacheName(), "key", "value"); + ICacheElement<String, String> element = new CacheElement<>(cache.getCacheName(), "key", "value"); cache.update(element); SleepUtil.sleepAtLeast(50); @@ -253,12 +253,12 @@ public class BasicRemoteCacheClientServe RemoteCacheManager remoteCacheManager = factory.getManager(attributes, compositeCacheManager, new MockCacheEventLogger(), new MockElementSerializer()); AuxiliaryCache<String, String> cache = remoteCacheManager.getCache(attributes); - MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<>(); server.addCacheListener(cache.getCacheName(), listener); // DO WORK int numPutsPrior = server.getPutCount(); - ICacheElement<String, String> element = new CacheElement<String, String>(cache.getCacheName(), "key", "value"); + ICacheElement<String, String> element = new CacheElement<>(cache.getCacheName(), "key", "value"); cache.update(element); SleepUtil.sleepAtLeast(50); @@ -302,7 +302,7 @@ public class BasicRemoteCacheClientServe RemoteCacheManager remoteCacheManager = factory.getManager(attributes, compositeCacheManager, new MockCacheEventLogger(), new MockElementSerializer()); AuxiliaryCache<String, String> cache = remoteCacheManager.getCache(attributes); - MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<>(); server.addCacheListener(cache.getCacheName(), listener); // DO WORK @@ -310,7 +310,7 @@ public class BasicRemoteCacheClientServe int numToPut = 100; for (int i = 0; i < numToPut; i++) { - ICacheElement<String, String> element = new CacheElement<String, String>(cache.getCacheName(), "key" + 1, "value" + i); + ICacheElement<String, String> element = new CacheElement<>(cache.getCacheName(), "key" + 1, "value" + i); cache.update(element); } SleepUtil.sleepAtLeast(500); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java Fri May 24 09:26:50 2019 @@ -57,7 +57,7 @@ public class RemoteCacheServerUnitTest IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" ); Properties config = RemoteUtils.loadProps(rcsa.getConfigFileName()); - this.server = new RemoteCacheServer<String, String>( rcsa, config ); + this.server = new RemoteCacheServer<>( rcsa, config ); } @Override @@ -77,10 +77,10 @@ public class RemoteCacheServerUnitTest public void testAddListenerToCache_LOCALtype() throws Exception { - MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<>(); mockListener1.remoteType = RemoteType.LOCAL; mockListener1.localAddress = expectedIp1; - MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<>(); mockListener1.remoteType = RemoteType.LOCAL; mockListener2.localAddress = expectedIp2; @@ -106,10 +106,10 @@ public class RemoteCacheServerUnitTest public void testAddListenerToCache_CLUSTERtype() throws Exception { - MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<>(); mockListener1.remoteType = RemoteType.CLUSTER; mockListener1.localAddress = expectedIp1; - MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<>(); mockListener1.remoteType = RemoteType.CLUSTER; mockListener2.localAddress = expectedIp2; @@ -136,9 +136,9 @@ public class RemoteCacheServerUnitTest // public void testAddListener_ToAll() // throws Exception // { -// MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>(); +// MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<>(); // mockListener1.localAddress = expectedIp1; -// MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>(); +// MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<>(); // mockListener2.localAddress = expectedIp2; // // // DO WORK @@ -163,8 +163,8 @@ public class RemoteCacheServerUnitTest public void testAddListener_ToAllThenRemove() throws Exception { - MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>(); - MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<>(); + MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<>(); String cacheName = "testAddListenerToAllThenRemove"; @@ -192,9 +192,9 @@ public class RemoteCacheServerUnitTest public void testAddListener_ToAllThenRemove_clusterType() throws Exception { - MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<>(); mockListener1.remoteType = RemoteType.CLUSTER; - MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<>(); mockListener2.remoteType = RemoteType.CLUSTER; String cacheName = "testAddListenerToAllThenRemove"; @@ -227,19 +227,19 @@ public class RemoteCacheServerUnitTest rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" ); Properties config = RemoteUtils.loadProps(rcsa.getConfigFileName()); - MockRemoteCacheListener<String, Long> mockListener = new MockRemoteCacheListener<String, Long>(); - RemoteCacheServer<String, Long> server = new RemoteCacheServer<String, Long>( rcsa, config ); + MockRemoteCacheListener<String, Long> mockListener = new MockRemoteCacheListener<>(); + RemoteCacheServer<String, Long> server = new RemoteCacheServer<>( rcsa, config ); String cacheName = "testSimpleRegisterListenerAndPut"; server.addCacheListener( cacheName, mockListener ); // DO WORK - List<ICacheElement<String, Long>> inputItems = new LinkedList<ICacheElement<String, Long>>(); + List<ICacheElement<String, Long>> inputItems = new LinkedList<>(); int numToPut = 10; for ( int i = 0; i < numToPut; i++ ) { - ICacheElement<String, Long> element = new CacheElement<String, Long>( cacheName, String.valueOf( i ), Long.valueOf( i ) ); + ICacheElement<String, Long> element = new CacheElement<>( cacheName, String.valueOf( i ), Long.valueOf( i ) ); inputItems.add( element ); server.update( element, 9999 ); } @@ -273,14 +273,14 @@ public class RemoteCacheServerUnitTest rcsa.setLocalClusterConsistency( true ); rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" ); Properties config = RemoteUtils.loadProps(rcsa.getConfigFileName()); - RemoteCacheServer<String, Long> server = new RemoteCacheServer<String, Long>( rcsa, config ); + RemoteCacheServer<String, Long> server = new RemoteCacheServer<>( rcsa, config ); // this is to get the listener id for inserts. - MockRemoteCacheListener<String, Long> clusterListener = new MockRemoteCacheListener<String, Long>(); + MockRemoteCacheListener<String, Long> clusterListener = new MockRemoteCacheListener<>(); clusterListener.remoteType = RemoteType.CLUSTER; // this should get the updates - MockRemoteCacheListener<String, Long> localListener = new MockRemoteCacheListener<String, Long>(); + MockRemoteCacheListener<String, Long> localListener = new MockRemoteCacheListener<>(); localListener.remoteType = RemoteType.LOCAL; String cacheName = "testSimpleRegisterListenerAndPut_FromClusterWithLCC"; @@ -288,12 +288,12 @@ public class RemoteCacheServerUnitTest server.addCacheListener( cacheName, localListener ); // DO WORK - List<ICacheElement<String, Long>> inputItems = new LinkedList<ICacheElement<String,Long>>(); + List<ICacheElement<String, Long>> inputItems = new LinkedList<>(); int numToPut = 10; for ( int i = 0; i < numToPut; i++ ) { - ICacheElement<String, Long> element = new CacheElement<String, Long>( cacheName, String.valueOf( i ), Long.valueOf( i ) ); + ICacheElement<String, Long> element = new CacheElement<>( cacheName, String.valueOf( i ), Long.valueOf( i ) ); inputItems.add( element ); // update using the cluster listener id server.update( element, clusterListener.getListenerId() ); @@ -321,7 +321,7 @@ public class RemoteCacheServerUnitTest public void testSimpleRegisterListenerAndRemove() throws Exception { - MockRemoteCacheListener<String, String> mockListener = new MockRemoteCacheListener<String, String>(); + MockRemoteCacheListener<String, String> mockListener = new MockRemoteCacheListener<>(); String cacheName = "testSimpleRegisterListenerAndPut"; server.addCacheListener( cacheName, mockListener ); @@ -358,7 +358,7 @@ public class RemoteCacheServerUnitTest MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); server.setCacheEventLogger( cacheEventLogger ); - ICacheElement<String, String> item = new CacheElement<String, String>( "region", "key", "value" ); + ICacheElement<String, String> item = new CacheElement<>( "region", "key", "value" ); // DO WORK server.update( item ); @@ -418,7 +418,7 @@ public class RemoteCacheServerUnitTest server.setCacheEventLogger( cacheEventLogger ); // DO WORK - server.getMultiple( "region", new HashSet<String>() ); + server.getMultiple( "region", new HashSet<>() ); // VERIFY assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java Fri May 24 09:26:50 2019 @@ -130,7 +130,7 @@ public class RemoteCacheRequestFactoryUn long requesterId = 2; CacheElement<Serializable, Serializable> element = - new CacheElement<Serializable, Serializable>( cacheName, key, null ); + new CacheElement<>( cacheName, key, null ); // DO WORK RemoteCacheRequest<Serializable, Serializable> result = Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/CacheEventQueueFactoryUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/CacheEventQueueFactoryUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/CacheEventQueueFactoryUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/CacheEventQueueFactoryUnitTest.java Fri May 24 09:26:50 2019 @@ -35,10 +35,10 @@ public class CacheEventQueueFactoryUnitT { // SETUP QueueType eventQueueType = QueueType.SINGLE; - ICacheListener<String, String> listener = new MockRemoteCacheListener<String, String>(); + ICacheListener<String, String> listener = new MockRemoteCacheListener<>(); long listenerId = 1; - CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<String, String>(); + CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<>(); // DO WORK ICacheEventQueue<String, String> result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType ); @@ -53,10 +53,10 @@ public class CacheEventQueueFactoryUnitT { // SETUP QueueType eventQueueType = QueueType.POOLED; - ICacheListener<String, String> listener = new MockRemoteCacheListener<String, String>(); + ICacheListener<String, String> listener = new MockRemoteCacheListener<>(); long listenerId = 1; - CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<String, String>(); + CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<>(); // DO WORK ICacheEventQueue<String, String> result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/EventQueueConcurrentLoadTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/EventQueueConcurrentLoadTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/EventQueueConcurrentLoadTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/EventQueueConcurrentLoadTest.java Fri May 24 09:26:50 2019 @@ -148,8 +148,8 @@ public class EventQueueConcurrentLoadTes @Override public void setUp() { - listen = new CacheListenerImpl<String, String>(); - queue = new CacheEventQueue<String, String>( listen, 1L, "testCache1", maxFailure, waitBeforeRetry ); + listen = new CacheListenerImpl<>(); + queue = new CacheEventQueue<>( listen, 1L, "testCache1", maxFailure, waitBeforeRetry ); queue.setWaitToDieMillis( idleTime ); } @@ -165,7 +165,7 @@ public class EventQueueConcurrentLoadTes { for ( int i = 0; i <= end; i++ ) { - CacheElement<String, String> elem = new CacheElement<String, String>( "testCache1", i + ":key", i + "data" ); + CacheElement<String, String> elem = new CacheElement<>( "testCache1", i + ":key", i + "data" ); queue.addPutEvent( elem ); } @@ -221,7 +221,7 @@ public class EventQueueConcurrentLoadTes System.out.println( "queue is empty, begin" ); // get it going - CacheElement<String, String> elem = new CacheElement<String, String>( "testCache1", "a:key", "adata" ); + CacheElement<String, String> elem = new CacheElement<>( "testCache1", "a:key", "adata" ); queue.addPutEvent( elem ); for ( int i = 0; i <= end; i++ ) @@ -237,7 +237,7 @@ public class EventQueueConcurrentLoadTes this.wait( idleTime / 2 ); } } - CacheElement<String, String> elem2 = new CacheElement<String, String>( "testCache1", i + ":key", i + "data" ); + CacheElement<String, String> elem2 = new CacheElement<>( "testCache1", i + ":key", i + "data" ); queue.addPutEvent( elem2 ); } Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/MockCacheServiceNonLocal.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/MockCacheServiceNonLocal.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/MockCacheServiceNonLocal.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/MockCacheServiceNonLocal.java Fri May 24 09:26:50 2019 @@ -49,10 +49,10 @@ public class MockCacheServiceNonLocal<K, public ICacheElement<K, V> lastUpdate; /** List of updates. */ - public List<ICacheElement<K, V>> updateRequestList = new ArrayList<ICacheElement<K,V>>(); + public List<ICacheElement<K, V>> updateRequestList = new ArrayList<>(); /** List of request ids. */ - public List<Long> updateRequestIdList = new ArrayList<Long>(); + public List<Long> updateRequestIdList = new ArrayList<>(); /** The key that was last passed to remove. */ public K lastRemoveKey; @@ -80,7 +80,7 @@ public class MockCacheServiceNonLocal<K, @Override public Set<K> getKeySet( String cacheName ) { - return new HashSet<K>(); + return new HashSet<>(); } /** @@ -199,7 +199,7 @@ public class MockCacheServiceNonLocal<K, public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId ) { lastGetMultipleKeys = keys; - return new HashMap<K, ICacheElement<K, V>>(); + return new HashMap<>(); } /** @@ -240,6 +240,6 @@ public class MockCacheServiceNonLocal<K, throws IOException { lastGetMatchingPattern = pattern; - return new HashMap<K, ICacheElement<K, V>>(); + return new HashMap<>(); } } Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java Fri May 24 09:26:50 2019 @@ -37,14 +37,14 @@ public class ZombieCacheServiceNonLocalU throws Exception { // SETUP - MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>(); + MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 10 ); String cacheName = "testUpdate"; // DO WORK - ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( cacheName, "key", "value" ); zombie.update( element, 123l ); zombie.propagateEvents( service ); @@ -61,14 +61,14 @@ public class ZombieCacheServiceNonLocalU throws Exception { // SETUP - MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>(); + MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 0 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 0 ); String cacheName = "testUpdate"; // DO WORK - ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" ); + ICacheElement<String, String> element = new CacheElement<>( cacheName, "key", "value" ); zombie.update( element, 123l ); zombie.propagateEvents( service ); @@ -85,9 +85,9 @@ public class ZombieCacheServiceNonLocalU throws Exception { // SETUP - MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>(); + MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 10 ); String cacheName = "testRemoveThenWalk"; String key = "myKey"; @@ -109,9 +109,9 @@ public class ZombieCacheServiceNonLocalU throws Exception { // SETUP - MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>(); + MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<>(); - ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 ); + ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<>( 10 ); String cacheName = "testRemoveThenWalk"; Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java Fri May 24 09:26:50 2019 @@ -103,16 +103,16 @@ public class CompositeCacheDiskUsageUnit IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, String> cache = new CompositeCache<String, String>( cattr, attr ); + CompositeCache<String, String> cache = new CompositeCache<>( cattr, attr ); - MockAuxCache<String, String> mock = new MockAuxCache<String, String>(); + MockAuxCache<String, String> mock = new MockAuxCache<>(); mock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, String>[] auxArray = new AuxiliaryCache[] { mock }; cache.setAuxCaches( auxArray ); - ICacheElement<String, String> inputElement = new CacheElement<String, String>( CACHE_NAME, "key", "value" ); + ICacheElement<String, String> inputElement = new CacheElement<>( CACHE_NAME, "key", "value" ); // DO WORK cache.spoolToDisk( inputElement ); @@ -135,16 +135,16 @@ public class CompositeCacheDiskUsageUnit IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, String> cache = new CompositeCache<String, String>( cattr, attr ); + CompositeCache<String, String> cache = new CompositeCache<>( cattr, attr ); - MockAuxCache<String, String> mock = new MockAuxCache<String, String>(); + MockAuxCache<String, String> mock = new MockAuxCache<>(); mock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, String>[] auxArray = new AuxiliaryCache[] { mock }; cache.setAuxCaches( auxArray ); - ICacheElement<String, String> inputElement = new CacheElement<String, String>( CACHE_NAME, "key", "value" ); + ICacheElement<String, String> inputElement = new CacheElement<>( CACHE_NAME, "key", "value" ); // DO WORK cache.spoolToDisk( inputElement ); @@ -171,16 +171,16 @@ public class CompositeCacheDiskUsageUnit IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, String> cache = new CompositeCache<String, String>( cattr, attr ); + CompositeCache<String, String> cache = new CompositeCache<>( cattr, attr ); - MockAuxCache<String, String> mock = new MockAuxCache<String, String>(); + MockAuxCache<String, String> mock = new MockAuxCache<>(); mock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, String>[] auxArray = new AuxiliaryCache[] { mock }; cache.setAuxCaches( auxArray ); - ICacheElement<String, String> inputElement = new CacheElement<String, String>( CACHE_NAME, "key", "value" ); + ICacheElement<String, String> inputElement = new CacheElement<>( CACHE_NAME, "key", "value" ); // DO WORK cache.updateAuxiliaries( inputElement, true ); @@ -209,16 +209,16 @@ public class CompositeCacheDiskUsageUnit IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, String> cache = new CompositeCache<String, String>( cattr, attr ); + CompositeCache<String, String> cache = new CompositeCache<>( cattr, attr ); - MockAuxCache<String, String> mock = new MockAuxCache<String, String>(); + MockAuxCache<String, String> mock = new MockAuxCache<>(); mock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, String>[] auxArray = new AuxiliaryCache[] { mock }; cache.setAuxCaches( auxArray ); - ICacheElement<String, String> inputElement = new CacheElement<String, String>( CACHE_NAME, "key", "value" ); + ICacheElement<String, String> inputElement = new CacheElement<>( CACHE_NAME, "key", "value" ); // DO WORK cache.updateAuxiliaries( inputElement, false ); @@ -247,16 +247,16 @@ public class CompositeCacheDiskUsageUnit IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, String> cache = new CompositeCache<String, String>( cattr, attr ); + CompositeCache<String, String> cache = new CompositeCache<>( cattr, attr ); - MockAuxCache<String, String> mock = new MockAuxCache<String, String>(); + MockAuxCache<String, String> mock = new MockAuxCache<>(); mock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, String>[] auxArray = new AuxiliaryCache[] { mock }; cache.setAuxCaches( auxArray ); - ICacheElement<String, String> inputElement = new CacheElement<String, String>( CACHE_NAME, "key", "value" ); + ICacheElement<String, String> inputElement = new CacheElement<>( CACHE_NAME, "key", "value" ); // DO WORK cache.updateAuxiliaries( inputElement, true ); @@ -283,19 +283,19 @@ public class CompositeCacheDiskUsageUnit IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, String> cache = new CompositeCache<String, String>( cattr, attr ); + CompositeCache<String, String> cache = new CompositeCache<>( cattr, attr ); - MockAuxCache<String, String> mock = new MockAuxCache<String, String>(); + MockAuxCache<String, String> mock = new MockAuxCache<>(); mock.cacheType = CacheType.DISK_CACHE; - MockAuxCache<String, String> mockLateral = new MockAuxCache<String, String>(); + MockAuxCache<String, String> mockLateral = new MockAuxCache<>(); mockLateral.cacheType = CacheType.LATERAL_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, String>[] auxArray = new AuxiliaryCache[] { mock, mockLateral }; cache.setAuxCaches( auxArray ); - ICacheElement<String, String> inputElement = new CacheElement<String, String>( CACHE_NAME, "key", "value" ); + ICacheElement<String, String> inputElement = new CacheElement<>( CACHE_NAME, "key", "value" ); // DO WORK cache.updateAuxiliaries( inputElement, false ); @@ -366,7 +366,7 @@ public class CompositeCacheDiskUsageUnit @Override public Map<K, ICacheElement<K, V>> getMultiple(Set<K> keys) { - return new HashMap<K, ICacheElement<K, V>>(); + return new HashMap<>(); } /** Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/CompositeCacheUnitTest.java Fri May 24 09:26:50 2019 @@ -59,9 +59,9 @@ public class CompositeCacheUnitTest IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, Integer> cache = new CompositeCache<String, Integer>( cattr, attr ); + CompositeCache<String, Integer> cache = new CompositeCache<>( cattr, attr ); - MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<String, Integer>(); + MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<>(); diskMock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, Integer>[] aux = new AuxiliaryCache[] { diskMock }; @@ -71,7 +71,7 @@ public class CompositeCacheUnitTest int numToInsert = 10; for ( int i = 0; i < numToInsert; i++ ) { - ICacheElement<String, Integer> element = new CacheElement<String, Integer>( cacheName, String.valueOf( i ), Integer.valueOf( i ) ); + ICacheElement<String, Integer> element = new CacheElement<>( cacheName, String.valueOf( i ), Integer.valueOf( i ) ); cache.update( element, false ); } @@ -99,9 +99,9 @@ public class CompositeCacheUnitTest IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, Integer> cache = new CompositeCache<String, Integer>( cattr, attr ); + CompositeCache<String, Integer> cache = new CompositeCache<>( cattr, attr ); - MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<String, Integer>(); + MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<>(); diskMock.cacheType = CacheType.REMOTE_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, Integer>[] aux = new AuxiliaryCache[] { diskMock }; @@ -111,7 +111,7 @@ public class CompositeCacheUnitTest int numToInsert = 10; for ( int i = 0; i < numToInsert; i++ ) { - ICacheElement<String, Integer> element = new CacheElement<String, Integer>( cacheName, String.valueOf( i ), Integer.valueOf( i ) ); + ICacheElement<String, Integer> element = new CacheElement<>( cacheName, String.valueOf( i ), Integer.valueOf( i ) ); cache.update( element, false ); } @@ -142,9 +142,9 @@ public class CompositeCacheUnitTest IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, Integer> cache = new CompositeCache<String, Integer>( cattr, attr ); + CompositeCache<String, Integer> cache = new CompositeCache<>( cattr, attr ); - MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<String, Integer>(); + MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<>(); diskMock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, Integer>[] aux = new AuxiliaryCache[] { diskMock }; @@ -155,7 +155,7 @@ public class CompositeCacheUnitTest // insert with prefix1 for ( int i = 0; i < numToInsertPrefix1; i++ ) { - ICacheElement<String, Integer> element = new CacheElement<String, Integer>( cacheName, keyprefix1 + String.valueOf( i ), Integer.valueOf( i ) ); + ICacheElement<String, Integer> element = new CacheElement<>( cacheName, keyprefix1 + String.valueOf( i ), Integer.valueOf( i ) ); cache.update( element, false ); } @@ -163,7 +163,7 @@ public class CompositeCacheUnitTest // insert with prefix1 for ( int i = 0; i < numToInsertPrefix2; i++ ) { - ICacheElement<String, Integer> element = new CacheElement<String, Integer>( cacheName, keyprefix2 + String.valueOf( i ), Integer.valueOf( i ) ); + ICacheElement<String, Integer> element = new CacheElement<>( cacheName, keyprefix2 + String.valueOf( i ), Integer.valueOf( i ) ); cache.update( element, false ); } @@ -194,9 +194,9 @@ public class CompositeCacheUnitTest IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, Integer> cache = new CompositeCache<String, Integer>( cattr, attr ); + CompositeCache<String, Integer> cache = new CompositeCache<>( cattr, attr ); - MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<String, Integer>(); + MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<>(); diskMock.cacheType = CacheType.DISK_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, Integer>[] aux = new AuxiliaryCache[] { diskMock }; @@ -228,9 +228,9 @@ public class CompositeCacheUnitTest IElementAttributes attr = new ElementAttributes(); - CompositeCache<String, Integer> cache = new CompositeCache<String, Integer>( cattr, attr ); + CompositeCache<String, Integer> cache = new CompositeCache<>( cattr, attr ); - MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<String, Integer>(); + MockAuxiliaryCache<String, Integer> diskMock = new MockAuxiliaryCache<>(); diskMock.cacheType = CacheType.REMOTE_CACHE; @SuppressWarnings("unchecked") AuxiliaryCache<String, Integer>[] aux = new AuxiliaryCache[] { diskMock }; Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/MockCompositeCacheManager.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/MockCompositeCacheManager.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/MockCompositeCacheManager.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/control/MockCompositeCacheManager.java Fri May 24 09:26:50 2019 @@ -49,7 +49,7 @@ public class MockCompositeCacheManager { // System.out.println( "Creating mock cache" ); CompositeCache<K, V> newCache = - new CompositeCache<K, V>( new CompositeCacheAttributes(), new ElementAttributes() ); + new CompositeCache<>( new CompositeCacheAttributes(), new ElementAttributes() ); this.setCache( newCache ); } Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/logging/MockCacheEventLogger.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/logging/MockCacheEventLogger.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/logging/MockCacheEventLogger.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/logging/MockCacheEventLogger.java Fri May 24 09:26:50 2019 @@ -65,7 +65,7 @@ public class MockCacheEventLogger public <T> ICacheEvent<T> createICacheEvent( String source, String region, String eventName, String optionalDetails, T key ) { - return new CacheEvent<T>(); + return new CacheEvent<>(); } /** Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java Fri May 24 09:26:50 2019 @@ -35,7 +35,7 @@ public class KeyMatcherPatternImpllUnitT { // SETUP int numToInsertPrefix1 = 10; - Set<String> keyArray = new HashSet<String>(); + Set<String> keyArray = new HashSet<>(); String keyprefix1 = "MyPrefixC"; @@ -45,7 +45,7 @@ public class KeyMatcherPatternImpllUnitT keyArray.add(keyprefix1 + String.valueOf( i )); } - KeyMatcherPatternImpl<String> keyMatcher = new KeyMatcherPatternImpl<String>(); + KeyMatcherPatternImpl<String> keyMatcher = new KeyMatcherPatternImpl<>(); // DO WORK Set<String> result1 = keyMatcher.getMatchingKeysFromArray( keyprefix1 + ".", keyArray ); @@ -61,7 +61,7 @@ public class KeyMatcherPatternImpllUnitT { // SETUP int numToInsertPrefix1 = 10; - Set<String> keyArray = new HashSet<String>(); + Set<String> keyArray = new HashSet<>(); String keyprefix1 = "MyPrefixC"; @@ -71,7 +71,7 @@ public class KeyMatcherPatternImpllUnitT keyArray.add(keyprefix1 + String.valueOf( i )); } - KeyMatcherPatternImpl<String> keyMatcher = new KeyMatcherPatternImpl<String>(); + KeyMatcherPatternImpl<String> keyMatcher = new KeyMatcherPatternImpl<>(); // DO WORK Set<String> result1 = keyMatcher.getMatchingKeysFromArray( keyprefix1 + "\\S+", keyArray ); @@ -88,7 +88,7 @@ public class KeyMatcherPatternImpllUnitT // SETUP int numToInsertPrefix1 = 10; int numToInsertPrefix2 = 50; - Set<String> keyArray = new HashSet<String>(); + Set<String> keyArray = new HashSet<>(); String keyprefix1 = "MyPrefixA"; String keyprefix2 = "MyPrefixB"; @@ -105,7 +105,7 @@ public class KeyMatcherPatternImpllUnitT keyArray.add(keyprefix2 + String.valueOf( i )); } - KeyMatcherPatternImpl<String> keyMatcher = new KeyMatcherPatternImpl<String>(); + KeyMatcherPatternImpl<String> keyMatcher = new KeyMatcherPatternImpl<>(); // DO WORK Set<String> result1 = keyMatcher.getMatchingKeysFromArray( keyprefix1 + ".+", keyArray ); Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/MockMemoryCache.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/MockMemoryCache.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/MockMemoryCache.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/MockMemoryCache.java Fri May 24 09:26:50 2019 @@ -44,7 +44,7 @@ public class MockMemoryCache<K, V> private ICompositeCacheAttributes cacheAttr; /** Internal map */ - private final HashMap<K, ICacheElement<K, V>> map = new HashMap<K, ICacheElement<K, V>>(); + private final HashMap<K, ICacheElement<K, V>> map = new HashMap<>(); /** The number of times waterfall was called. */ public int waterfallCallCount = 0; @@ -93,7 +93,7 @@ public class MockMemoryCache<K, V> @Override public Set<K> getKeySet() { - return new LinkedHashSet<K>(map.keySet()); + return new LinkedHashSet<>(map.keySet()); } /** @@ -139,7 +139,7 @@ public class MockMemoryCache<K, V> public Map<K, ICacheElement<K, V>> getMultiple(Set<K> keys) throws IOException { - Map<K, ICacheElement<K, V>> elements = new HashMap<K, ICacheElement<K, V>>(); + Map<K, ICacheElement<K, V>> elements = new HashMap<>(); if ( keys != null && !keys.isEmpty() ) { Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java Fri May 24 09:26:50 2019 @@ -50,16 +50,16 @@ public class FIFOMemoryCacheUnitTest attributes.setMaxObjects( maxObjects ); attributes.setSpoolChunkSize( 1 ); - FIFOMemoryCache<String, String> cache = new FIFOMemoryCache<String, String>(); - cache.initialize( new CompositeCache<String, String>( attributes, new ElementAttributes() ) ); + FIFOMemoryCache<String, String> cache = new FIFOMemoryCache<>(); + cache.initialize( new CompositeCache<>( attributes, new ElementAttributes() ) ); for ( int i = 0; i <= maxObjects; i++ ) { - CacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key" + i, "value" + i ); + CacheElement<String, String> element = new CacheElement<>( cacheName, "key" + i, "value" + i ); cache.update( element ); } - CacheElement<String, String> oneMoreElement = new CacheElement<String, String>( cacheName, "onemore", "onemore" ); + CacheElement<String, String> oneMoreElement = new CacheElement<>( cacheName, "onemore", "onemore" ); // DO WORK cache.update( oneMoreElement ); @@ -91,13 +91,13 @@ public class FIFOMemoryCacheUnitTest attributes.setMaxObjects( maxObjects ); attributes.setSpoolChunkSize( 1 ); - FIFOMemoryCache<String, String> cache = new FIFOMemoryCache<String, String>(); - cache.initialize( new CompositeCache<String, String>( attributes, new ElementAttributes() ) ); + FIFOMemoryCache<String, String> cache = new FIFOMemoryCache<>(); + cache.initialize( new CompositeCache<>( attributes, new ElementAttributes() ) ); // DO WORK for ( int i = 0; i <= (maxObjects * 2); i++ ) { - CacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key" + i, "value" + i ); + CacheElement<String, String> element = new CacheElement<>( cacheName, "key" + i, "value" + i ); cache.update( element ); } Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCacheConcurrentUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCacheConcurrentUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCacheConcurrentUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCacheConcurrentUnitTest.java Fri May 24 09:26:50 2019 @@ -113,14 +113,14 @@ public class LHMLRUMemoryCacheConcurrent cacheMgr.configure( "/TestLHMLRUCache.ccf" ); CompositeCache<String, String> cache = cacheMgr.getCache( region ); - LRUMemoryCache<String, String> lru = new LRUMemoryCache<String, String>(); + LRUMemoryCache<String, String> lru = new LRUMemoryCache<>(); lru.initialize( cache ); // Add items to cache for ( int i = 0; i < items; i++ ) { - ICacheElement<String, String> ice = new CacheElement<String, String>( cache.getCacheName(), i + ":key", region + " data " + i ); + ICacheElement<String, String> ice = new CacheElement<>( cache.getCacheName(), i + ":key", region + " data " + i ); ice.setElementAttributes( cache.getElementAttributes() ); lru.update( ice ); } @@ -139,7 +139,7 @@ public class LHMLRUMemoryCacheConcurrent } // Test that getMultiple returns all the items remaining in cache and none of the missing ones - Set<String> keys = new HashSet<String>(); + Set<String> keys = new HashSet<>(); for ( int i = 0; i < items; i++ ) { keys.add( i + ":key" );