You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tv...@apache.org on 2019/05/24 09:26:51 UTC
svn commit: r1859859 [3/5] - in
/commons/proper/jcs/trunk/commons-jcs-core/src:
main/java/org/apache/commons/jcs/ main/java/org/apache/commons/jcs/access/
main/java/org/apache/commons/jcs/admin/
main/java/org/apache/commons/jcs/auxiliary/ main/java/org...
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java Fri May 24 09:26:50 2019
@@ -70,8 +70,8 @@ public class BlockDiskCacheKeyStoreUnitT
private void innerTestPutKeys(BlockDiskCacheAttributes attributes)
{
- BlockDiskCache<String, String> blockDiskCache = new BlockDiskCache<String, String>(attributes);
- BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<String>(attributes, blockDiskCache);
+ BlockDiskCache<String, String> blockDiskCache = new BlockDiskCache<>(attributes);
+ BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<>(attributes, blockDiskCache);
// DO WORK
int numElements = 100;
@@ -125,7 +125,7 @@ public class BlockDiskCacheKeyStoreUnitT
private void testSaveLoadKeysInner(BlockDiskCacheAttributes attributes)
{
- BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<String>(attributes, null);
+ BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<>(attributes, null);
// DO WORK
int numElements = 1000;
@@ -180,7 +180,7 @@ public class BlockDiskCacheKeyStoreUnitT
attributes.setDiskLimitType(DiskLimitType.SIZE);
@SuppressWarnings({ "unchecked", "rawtypes" })
- BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<String>(attributes, new BlockDiskCache(attributes));
+ BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<>(attributes, new BlockDiskCache(attributes));
keyStore.put("1", new int[1000]);
keyStore.put("2", new int[1000]);
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSameRegionConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSameRegionConcurrentUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSameRegionConcurrentUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSameRegionConcurrentUnitTest.java Fri May 24 09:26:50 2019
@@ -155,7 +155,7 @@ public class BlockDiskCacheSameRegionCon
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = start; i <= end; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheUnitTestAbstract.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheUnitTestAbstract.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheUnitTestAbstract.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheUnitTestAbstract.java Fri May 24 09:26:50 2019
@@ -49,12 +49,12 @@ public abstract class BlockDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, String> diskCache = new BlockDiskCache<String, String>(cattr);
+ BlockDiskCache<String, String> diskCache = new BlockDiskCache<>(cattr);
// DO WORK
for (int i = 0; i <= items; i++)
{
- diskCache.update(new CacheElement<String, String>(cacheName, i + ":key", cacheName + " data " + i));
+ diskCache.update(new CacheElement<>(cacheName, i + ":key", cacheName + " data " + i));
}
Thread.sleep(500);
@@ -82,12 +82,12 @@ public abstract class BlockDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, String> diskCache = new BlockDiskCache<String, String>(cattr);
+ BlockDiskCache<String, String> diskCache = new BlockDiskCache<>(cattr);
// DO WORK
for (int i = 0; i <= items; i++)
{
- diskCache.update(new CacheElement<String, String>(cacheName, i + ":key", cacheName + " data " + i));
+ diskCache.update(new CacheElement<>(cacheName, i + ":key", cacheName + " data " + i));
}
Map<String, ICacheElement<String, String>> matchingResults = diskCache.getMatching("1.8.+");
@@ -171,10 +171,10 @@ public abstract class BlockDiskCacheUnit
cattr.setMaxKeySize(100);
cattr.setBlockSizeBytes(200);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, String> diskCache = new BlockDiskCache<String, String>(cattr);
+ BlockDiskCache<String, String> diskCache = new BlockDiskCache<>(cattr);
// DO WORK
- diskCache.update(new CacheElement<String, String>(cacheName, "x", string));
+ diskCache.update(new CacheElement<>(cacheName, "x", string));
// VERIFY
assertNotNull(diskCache.get("x"));
@@ -214,10 +214,10 @@ public abstract class BlockDiskCacheUnit
cattr.setMaxKeySize(100);
cattr.setBlockSizeBytes(200);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, String> diskCache = new BlockDiskCache<String, String>(cattr);
+ BlockDiskCache<String, String> diskCache = new BlockDiskCache<>(cattr);
// DO WORK
- diskCache.update(new CacheElement<String, String>(cacheName, "x", string));
+ diskCache.update(new CacheElement<>(cacheName, "x", string));
// VERIFY
assertNotNull(diskCache.get("x"));
@@ -258,10 +258,10 @@ public abstract class BlockDiskCacheUnit
cattr.setMaxKeySize(100);
cattr.setBlockSizeBytes(200);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, byte[]> diskCache = new BlockDiskCache<String, byte[]>(cattr);
+ BlockDiskCache<String, byte[]> diskCache = new BlockDiskCache<>(cattr);
// DO WORK
- diskCache.update(new CacheElement<String, byte[]>(cacheName, "x", bytes));
+ diskCache.update(new CacheElement<>(cacheName, "x", bytes));
// VERIFY
assertNotNull(diskCache.get("x"));
@@ -307,10 +307,10 @@ public abstract class BlockDiskCacheUnit
cattr.setMaxKeySize(100);
cattr.setBlockSizeBytes(500);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, X> diskCache = new BlockDiskCache<String, X>(cattr);
+ BlockDiskCache<String, X> diskCache = new BlockDiskCache<>(cattr);
// DO WORK
- diskCache.update(new CacheElement<String, X>(cacheName, "x", before));
+ diskCache.update(new CacheElement<>(cacheName, "x", before));
// VERIFY
assertNotNull(diskCache.get("x"));
@@ -341,18 +341,18 @@ public abstract class BlockDiskCacheUnit
cattr.setMaxKeySize(100);
cattr.setBlockSizeBytes(500);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, X> diskCache = new BlockDiskCache<String, X>(cattr);
+ BlockDiskCache<String, X> diskCache = new BlockDiskCache<>(cattr);
diskCache.removeAll();
X value1 = new X();
value1.string = "1234567890";
X value2 = new X();
value2.string = "0987654321";
- diskCache.update(new CacheElement<String, X>(cacheName, "1", value1));
+ diskCache.update(new CacheElement<>(cacheName, "1", value1));
diskCache.dispose();
- diskCache = new BlockDiskCache<String, X>(cattr);
- diskCache.update(new CacheElement<String, X>(cacheName, "2", value2));
+ diskCache = new BlockDiskCache<>(cattr);
+ diskCache.update(new CacheElement<>(cacheName, "2", value2));
diskCache.dispose();
- diskCache = new BlockDiskCache<String, X>(cattr);
+ diskCache = new BlockDiskCache<>(cattr);
assertTrue(diskCache.verifyDisk());
assertEquals(2, diskCache.getKeySet().size());
assertEquals(value1.string, diskCache.get("1").getVal().string);
@@ -382,17 +382,17 @@ public abstract class BlockDiskCacheUnit
cattr.setMaxKeySize(100);
cattr.setBlockSizeBytes(500);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, X> diskCache = new BlockDiskCache<String, X>(cattr);
+ BlockDiskCache<String, X> diskCache = new BlockDiskCache<>(cattr);
// DO WORK
for (int i = 0; i < 50; i++)
{
- diskCache.update(new CacheElement<String, X>(cacheName, "x" + i, before));
+ diskCache.update(new CacheElement<>(cacheName, "x" + i, before));
}
diskCache.dispose();
// VERIFY
- diskCache = new BlockDiskCache<String, X>(cattr);
+ diskCache = new BlockDiskCache<>(cattr);
for (int i = 0; i < 50; i++)
{
@@ -419,7 +419,7 @@ public abstract class BlockDiskCacheUnit
cattr.setCacheName("testRemoveItems");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, String> disk = new BlockDiskCache<String, String>(cattr);
+ BlockDiskCache<String, String> disk = new BlockDiskCache<>(cattr);
disk.processRemoveAll();
@@ -428,7 +428,7 @@ public abstract class BlockDiskCacheUnit
{
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool(true);
- ICacheElement<String, String> element = new CacheElement<String, String>("testRemoveItems", "key:" + i, "data:" + i);
+ ICacheElement<String, String> element = new CacheElement<>("testRemoveItems", "key:" + i, "data:" + i);
element.setElementAttributes(eAttr);
disk.processUpdate(element);
}
@@ -454,7 +454,7 @@ public abstract class BlockDiskCacheUnit
cattr.setCacheName("testRemove_PartialKey");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<String, String> disk = new BlockDiskCache<String, String>(cattr);
+ BlockDiskCache<String, String> disk = new BlockDiskCache<>(cattr);
disk.processRemoveAll();
@@ -463,7 +463,7 @@ public abstract class BlockDiskCacheUnit
{
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool(true);
- ICacheElement<String, String> element = new CacheElement<String, String>("testRemove_PartialKey", i + ":key", "data:"
+ ICacheElement<String, String> element = new CacheElement<>("testRemove_PartialKey", i + ":key", "data:"
+ i);
element.setElementAttributes(eAttr);
disk.processUpdate(element);
@@ -498,7 +498,7 @@ public abstract class BlockDiskCacheUnit
cattr.setCacheName("testRemove_Group");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- BlockDiskCache<GroupAttrName<String>, String> disk = new BlockDiskCache<GroupAttrName<String>, String>(cattr);
+ BlockDiskCache<GroupAttrName<String>, String> disk = new BlockDiskCache<>(cattr);
disk.processRemoveAll();
@@ -509,7 +509,7 @@ public abstract class BlockDiskCacheUnit
for (int i = 0; i < cnt; i++)
{
GroupAttrName<String> groupAttrName = getGroupAttrName(cacheName, groupName, i + ":key");
- CacheElement<GroupAttrName<String>, String> element = new CacheElement<GroupAttrName<String>, String>(cacheName,
+ CacheElement<GroupAttrName<String>, String> element = new CacheElement<>(cacheName,
groupAttrName, "data:" + i);
IElementAttributes eAttr = new ElementAttributes();
@@ -554,7 +554,7 @@ public abstract class BlockDiskCacheUnit
private GroupAttrName<String> getGroupAttrName(String cacheName, String group, String name)
{
GroupId gid = new GroupId(cacheName, group);
- return new GroupAttrName<String>(gid, name);
+ return new GroupAttrName<>(gid, name);
}
/** Holder for a string and byte array. */
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java Fri May 24 09:26:50 2019
@@ -53,7 +53,7 @@ public class BlockDiskElementDescriptorU
// DO WORK
for ( int i = 0; i < numElements; i++ )
{
- BlockDiskElementDescriptor<Integer> descriptor = new BlockDiskElementDescriptor<Integer>();
+ BlockDiskElementDescriptor<Integer> descriptor = new BlockDiskElementDescriptor<>();
descriptor.setKey( Integer.valueOf( i ) );
descriptor.setBlocks( new int[] { 1, 2 } );
elements[i] = descriptor;
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java Fri May 24 09:26:50 2019
@@ -109,7 +109,7 @@ public class DiskTestObjectUtil
int size = bytes * 1024;
DiskTestObject tile = new DiskTestObject( Integer.valueOf( i ), new byte[size] );
- ICacheElement<Integer, DiskTestObject> element = new CacheElement<Integer, DiskTestObject>( cacheName, tile.id, tile );
+ ICacheElement<Integer, DiskTestObject> element = new CacheElement<>( cacheName, tile.id, tile );
elements[i] = element;
}
return elements;
@@ -134,7 +134,7 @@ public class DiskTestObjectUtil
int size = ( bytes + 4 ) * 1024;
DiskTestObject tile = new DiskTestObject( Integer.valueOf( i ), new byte[size] );
- ICacheElement<Integer, DiskTestObject> element = new CacheElement<Integer, DiskTestObject>( cacheName, tile.id, tile );
+ ICacheElement<Integer, DiskTestObject> element = new CacheElement<>( cacheName, tile.id, tile );
elements[i] = element;
}
return elements;
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheCountUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheCountUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheCountUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheCountUnitTest.java Fri May 24 09:26:50 2019
@@ -42,7 +42,7 @@ public class IndexDiskCacheCountUnitTest
cattr.setMaxKeySize( 5 );
cattr.setMaxPurgatorySize( 0 );
cattr.setDiskPath( "target/test-sandbox/BreakIndexTest" );
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>( cattr );
String[] test = { "a", "bb", "ccc", "dddd", "eeeee", "ffffff", "ggggggg", "hhhhhhhhh", "iiiiiiiiii" };
String[] expect = { null, "bb", "ccc", null, null, "ffffff", null, "hhhhhhhhh", "iiiiiiiiii" };
@@ -51,7 +51,7 @@ public class IndexDiskCacheCountUnitTest
for ( int i = 0; i < 6; i++ )
{
- ICacheElement<String, String> element = new CacheElement<String, String>( "testRecycleBin", "key:" + test[i], test[i] );
+ ICacheElement<String, String> element = new CacheElement<>( "testRecycleBin", "key:" + test[i], test[i] );
//System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
disk.processUpdate( element );
}
@@ -66,7 +66,7 @@ public class IndexDiskCacheCountUnitTest
// will not fit.
for ( int i = 7; i < 9; i++ )
{
- ICacheElement<String, String> element = new CacheElement<String, String>( "testRecycleBin", "key:" + test[i], test[i] );
+ ICacheElement<String, String> element = new CacheElement<>( "testRecycleBin", "key:" + test[i], test[i] );
//System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
disk.processUpdate( element );
}
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheSizeUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheSizeUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheSizeUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheSizeUnitTest.java Fri May 24 09:26:50 2019
@@ -43,7 +43,7 @@ public class IndexDiskCacheSizeUnitTest
cattr.setMaxKeySize( 8); // 1kb DiskTestObject takes 1420 bytes, so 5*1420 = 7100, so to keep 5 ojbects, we need max key size of 8
cattr.setMaxPurgatorySize( 0 );
cattr.setDiskPath( "target/test-sandbox/BreakIndexTest" );
- IndexedDiskCache<String, DiskTestObject> disk = new IndexedDiskCache<String, DiskTestObject>( cattr );
+ IndexedDiskCache<String, DiskTestObject> disk = new IndexedDiskCache<>( cattr );
String[] test = { "a", "bb", "ccc", "dddd", "eeeee", "ffffff", "ggggggg", "hhhhhhhhh", "iiiiiiiiii" };
String[] expect = { null, "bb", "ccc", null, null, "ffffff", null, "hhhhhhhhh", "iiiiiiiiii" };
@@ -52,7 +52,7 @@ public class IndexDiskCacheSizeUnitTest
for ( int i = 0; i < 6; i++ )
{
- ICacheElement<String, DiskTestObject> element = new CacheElement<String, DiskTestObject>( "testRecycleBin", "key:" + test[i], value);
+ ICacheElement<String, DiskTestObject> element = new CacheElement<>( "testRecycleBin", "key:" + test[i], value);
//System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
disk.processUpdate( element );
}
@@ -67,7 +67,7 @@ public class IndexDiskCacheSizeUnitTest
// will not fit.
for ( int i = 7; i < 9; i++ )
{
- ICacheElement<String, DiskTestObject> element = new CacheElement<String, DiskTestObject>( "testRecycleBin", "key:" + test[i], value);
+ ICacheElement<String, DiskTestObject> element = new CacheElement<>( "testRecycleBin", "key:" + test[i], value);
//System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
disk.processUpdate( element );
}
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTestAbstract.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTestAbstract.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTestAbstract.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTestAbstract.java Fri May 24 09:26:50 2019
@@ -57,7 +57,7 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testSimplePutAndGet");
cattr.setMaxKeySize(1000);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>(cattr);
disk.processRemoveAll();
@@ -66,7 +66,7 @@ public abstract class IndexDiskCacheUnit
{
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool(true);
- ICacheElement<String, String> element = new CacheElement<String, String>("testSimplePutAndGet", "key:" + i, "data:" + i);
+ ICacheElement<String, String> element = new CacheElement<>("testSimplePutAndGet", "key:" + i, "data:" + i);
element.setElementAttributes(eAttr);
disk.processUpdate(element);
}
@@ -79,7 +79,7 @@ public abstract class IndexDiskCacheUnit
}
// Test that getMultiple returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for (int i = 0; i < cnt; i++)
{
keys.add("key:" + i);
@@ -106,7 +106,7 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testRemoveItems");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>(cattr);
disk.processRemoveAll();
@@ -115,7 +115,7 @@ public abstract class IndexDiskCacheUnit
{
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool(true);
- ICacheElement<String, String> element = new CacheElement<String, String>("testRemoveItems", "key:" + i, "data:" + i);
+ ICacheElement<String, String> element = new CacheElement<>("testRemoveItems", "key:" + i, "data:" + i);
element.setElementAttributes(eAttr);
disk.processUpdate(element);
}
@@ -145,7 +145,7 @@ public abstract class IndexDiskCacheUnit
IndexedDiskCacheAttributes cattr = getCacheAttributes();
cattr.setCacheName("testCheckForDedOverlaps_noOverlap");
cattr.setDiskPath("target/test-sandbox/UnitTest");
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>(cattr);
int numDescriptors = 5;
int pos = 0;
@@ -173,7 +173,7 @@ public abstract class IndexDiskCacheUnit
IndexedDiskCacheAttributes cattr = getCacheAttributes();
cattr.setCacheName("testCheckForDedOverlaps_overlaps");
cattr.setDiskPath("target/test-sandbox/UnitTest");
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>(cattr);
int numDescriptors = 5;
int pos = 0;
@@ -206,7 +206,7 @@ public abstract class IndexDiskCacheUnit
IndexedDiskCacheAttributes cattr = getCacheAttributes();
cattr.setCacheName("testFileSize");
cattr.setDiskPath("target/test-sandbox/UnitTest");
- IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>(cattr);
+ IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<>(cattr);
int numberToInsert = 20;
int bytes = 24;
@@ -248,7 +248,7 @@ public abstract class IndexDiskCacheUnit
cattr.setOptimizeAtRemoveCount(numberToInsert);
cattr.setMaxKeySize(numberToInsert * 2);
cattr.setMaxPurgatorySize(numberToInsert);
- IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>(cattr);
+ IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<>(cattr);
int bytes = 1;
ICacheElement<Integer, DiskTestObject>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects(numberToInsert,
@@ -293,7 +293,7 @@ public abstract class IndexDiskCacheUnit
cattr.setOptimizeAtRemoveCount(numberToInsert);
cattr.setMaxKeySize(numberToInsert * 2);
cattr.setMaxPurgatorySize(numberToInsert);
- IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>(cattr);
+ IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<>(cattr);
// we will reuse these
int bytes = 1;
@@ -345,7 +345,7 @@ public abstract class IndexDiskCacheUnit
IndexedDiskCacheAttributes cattr = getCacheAttributes();
cattr.setCacheName("testBytesFreeSize");
cattr.setDiskPath("target/test-sandbox/UnitTest");
- IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>(cattr);
+ IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<>(cattr);
int numberToInsert = 20;
int bytes = 24;
@@ -399,7 +399,7 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testRemove_PartialKey");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>(cattr);
disk.processRemoveAll();
@@ -408,7 +408,7 @@ public abstract class IndexDiskCacheUnit
{
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool(true);
- ICacheElement<String, String> element = new CacheElement<String, String>("testRemove_PartialKey", i + ":key", "data:"
+ ICacheElement<String, String> element = new CacheElement<>("testRemove_PartialKey", i + ":key", "data:"
+ i);
element.setElementAttributes(eAttr);
disk.processUpdate(element);
@@ -444,7 +444,7 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testRemove_Group");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<GroupAttrName<String>, String> disk = new IndexedDiskCache<GroupAttrName<String>, String>(cattr);
+ IndexedDiskCache<GroupAttrName<String>, String> disk = new IndexedDiskCache<>(cattr);
disk.processRemoveAll();
@@ -455,7 +455,7 @@ public abstract class IndexDiskCacheUnit
for (int i = 0; i < cnt; i++)
{
GroupAttrName<String> groupAttrName = getGroupAttrName(cacheName, groupName, i + ":key");
- CacheElement<GroupAttrName<String>, String> element = new CacheElement<GroupAttrName<String>, String>(cacheName,
+ CacheElement<GroupAttrName<String>, String> element = new CacheElement<>(cacheName,
groupAttrName, "data:" + i);
IElementAttributes eAttr = new ElementAttributes();
@@ -500,7 +500,7 @@ public abstract class IndexDiskCacheUnit
private GroupAttrName<String> getGroupAttrName(String cacheName, String group, String name)
{
GroupId gid = new GroupId(cacheName, group);
- return new GroupAttrName<String>(gid, name);
+ return new GroupAttrName<>(gid, name);
}
/**
@@ -516,13 +516,13 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testUpdate_EventLogging_simple");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTestCEL");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
diskCache.setCacheEventLogger(cacheEventLogger);
- ICacheElement<String, String> item = new CacheElement<String, String>("region", "key", "value");
+ ICacheElement<String, String> item = new CacheElement<>("region", "key", "value");
// DO WORK
diskCache.update(item);
@@ -547,7 +547,7 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testGet_EventLogging_simple");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTestCEL");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
@@ -574,13 +574,13 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testGetMultiple_EventLogging_simple");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTestCEL");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
diskCache.setCacheEventLogger(cacheEventLogger);
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
keys.add("junk");
// DO WORK
@@ -605,7 +605,7 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testRemoveAll_EventLogging_simple");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTestCEL");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
@@ -632,7 +632,7 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName("testRemoveAll_EventLogging_simple");
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTestCEL");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
@@ -662,12 +662,12 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
// DO WORK
for (int i = 0; i <= items; i++)
{
- diskCache.update(new CacheElement<String, String>(cacheName, i + ":key", cacheName + " data " + i));
+ diskCache.update(new CacheElement<>(cacheName, i + ":key", cacheName + " data " + i));
}
Thread.sleep(500);
@@ -695,12 +695,12 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
// DO WORK
for (int i = 0; i <= items; i++)
{
- diskCache.update(new CacheElement<String, String>(cacheName, i + ":key", cacheName + " data " + i));
+ diskCache.update(new CacheElement<>(cacheName, i + ":key", cacheName + " data " + i));
}
Map<String, ICacheElement<String, String>> matchingResults = diskCache.getMatching("1.8.+");
@@ -736,10 +736,10 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
// DO WORK
- diskCache.update(new CacheElement<String, String>(cacheName, "x", string));
+ diskCache.update(new CacheElement<>(cacheName, "x", string));
// VERIFY
assertNotNull(diskCache.get("x"));
@@ -779,10 +779,10 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, byte[]> diskCache = new IndexedDiskCache<String, byte[]>(cattr);
+ IndexedDiskCache<String, byte[]> diskCache = new IndexedDiskCache<>(cattr);
// DO WORK
- diskCache.update(new CacheElement<String, byte[]>(cacheName, "x", bytes));
+ diskCache.update(new CacheElement<>(cacheName, "x", bytes));
// VERIFY
assertNotNull(diskCache.get("x"));
@@ -810,11 +810,11 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
String key = "myKey";
String value = "myValue";
- ICacheElement<String, String> ce = new CacheElement<String, String>(cacheName, key, value);
+ ICacheElement<String, String> ce = new CacheElement<>(cacheName, key, value);
// DO WORK
diskCache.processUpdate(ce);
@@ -840,18 +840,18 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
String key = "myKey";
String value = "myValue";
- ICacheElement<String, String> ce1 = new CacheElement<String, String>(cacheName, key, value);
+ ICacheElement<String, String> ce1 = new CacheElement<>(cacheName, key, value);
// DO WORK
diskCache.processUpdate(ce1);
long fileSize1 = diskCache.getDataFileSize();
// DO WORK
- ICacheElement<String, String> ce2 = new CacheElement<String, String>(cacheName, key, value);
+ ICacheElement<String, String> ce2 = new CacheElement<>(cacheName, key, value);
diskCache.processUpdate(ce2);
ICacheElement<String, String> result = diskCache.processGet(key);
@@ -877,19 +877,19 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
String key = "myKey";
String value = "myValue";
String value2 = "myValu";
- ICacheElement<String, String> ce1 = new CacheElement<String, String>(cacheName, key, value);
+ ICacheElement<String, String> ce1 = new CacheElement<>(cacheName, key, value);
// DO WORK
diskCache.processUpdate(ce1);
long fileSize1 = diskCache.getDataFileSize();
// DO WORK
- ICacheElement<String, String> ce2 = new CacheElement<String, String>(cacheName, key, value2);
+ ICacheElement<String, String> ce2 = new CacheElement<>(cacheName, key, value2);
diskCache.processUpdate(ce2);
ICacheElement<String, String> result = diskCache.processGet(key);
@@ -915,19 +915,19 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/IndexDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
String key = "myKey";
String value = "myValue";
String value2 = "myValue2";
- ICacheElement<String, String> ce1 = new CacheElement<String, String>(cacheName, key, value);
+ ICacheElement<String, String> ce1 = new CacheElement<>(cacheName, key, value);
// DO WORK
diskCache.processUpdate(ce1);
long fileSize1 = diskCache.getDataFileSize();
// DO WORK
- ICacheElement<String, String> ce2 = new CacheElement<String, String>(cacheName, key, value2);
+ ICacheElement<String, String> ce2 = new CacheElement<>(cacheName, key, value2);
diskCache.processUpdate(ce2);
ICacheElement<String, String> result = diskCache.processGet(key);
@@ -965,19 +965,19 @@ public abstract class IndexDiskCacheUnit
cattr.setCacheName(cacheName);
cattr.setMaxKeySize(100);
cattr.setDiskPath("target/test-sandbox/BlockDiskCacheUnitTest");
- IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> diskCache = new IndexedDiskCache<>(cattr);
// DO WORK
for (int i = 0; i < 50; i++)
{
- diskCache.update(new CacheElement<String, String>(cacheName, "x" + i, string));
+ diskCache.update(new CacheElement<>(cacheName, "x" + i, string));
}
// Thread.sleep(1000);
// VERIFY
diskCache.dispose();
// Thread.sleep(1000);
- diskCache = new IndexedDiskCache<String, String>(cattr);
+ diskCache = new IndexedDiskCache<>(cattr);
for (int i = 0; i < 50; i++)
{
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java Fri May 24 09:26:50 2019
@@ -157,7 +157,7 @@ public class IndexedDiskCacheConcurrentU
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = 0; i <= items; i++ )
{
keys.add( i + ":key" );
@@ -218,7 +218,7 @@ public class IndexedDiskCacheConcurrentU
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = start; i <= end; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java Fri May 24 09:26:50 2019
@@ -49,7 +49,7 @@ public class IndexedDiskCacheKeyStoreUni
cattr.setCacheName( "testStoreKeys" );
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/KeyStoreUnitTest" );
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>( cattr );
disk.processRemoveAll();
@@ -58,7 +58,7 @@ public class IndexedDiskCacheKeyStoreUni
{
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool( true );
- ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i );
+ ICacheElement<String, String> element = new CacheElement<>( cattr.getCacheName(), "key:" + i, "data:" + i );
element.setElementAttributes( eAttr );
disk.processUpdate( element );
}
@@ -103,7 +103,7 @@ public class IndexedDiskCacheKeyStoreUni
cattr.setCacheName( "testOptimize" );
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/KeyStoreUnitTest" );
- IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
+ IndexedDiskCache<String, String> disk = new IndexedDiskCache<>( cattr );
disk.processRemoveAll();
@@ -112,7 +112,7 @@ public class IndexedDiskCacheKeyStoreUni
{
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool( true );
- ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i );
+ ICacheElement<String, String> element = new CacheElement<>( cattr.getCacheName(), "key:" + i, "data:" + i );
element.setElementAttributes( eAttr );
disk.processUpdate( element );
}
@@ -121,7 +121,7 @@ public class IndexedDiskCacheKeyStoreUni
IElementAttributes eAttr = new ElementAttributes();
eAttr.setIsSpool( true );
- ICacheElement<String, String> elementSetup = new CacheElement<String, String>( cattr.getCacheName(), "key:" + "A", "data:" + "A" );
+ ICacheElement<String, String> elementSetup = new CacheElement<>( cattr.getCacheName(), "key:" + "A", "data:" + "A" );
elementSetup.setElementAttributes( eAttr );
disk.processUpdate( elementSetup );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java Fri May 24 09:26:50 2019
@@ -146,7 +146,7 @@ public class IndexedDiskCacheNoMemoryUni
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = 0; i <= items; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java Fri May 24 09:26:50 2019
@@ -49,7 +49,7 @@ public class IndexedDiskCacheOptimizatio
cattr.setMaxKeySize( removeCount * 2 );
cattr.setOptimizeAtRemoveCount( removeCount );
cattr.setDiskPath( "target/test-sandbox/testOptimization" );
- IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>( cattr );
+ IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<>( cattr );
disk.removeAll();
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java Fri May 24 09:26:50 2019
@@ -182,7 +182,7 @@ public class IndexedDiskCacheSameRegionC
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = start; i <= end; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/LRUMapSizeVsCount.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/LRUMapSizeVsCount.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/LRUMapSizeVsCount.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/indexed/LRUMapSizeVsCount.java Fri May 24 09:26:50 2019
@@ -114,7 +114,7 @@ public class LRUMapSizeVsCount
cattr.setName("junit");
cattr.setCacheName("junit");
cattr.setDiskPath(".");
- IndexedDiskCache<String, String> idc = new IndexedDiskCache<String, String>(cattr);
+ IndexedDiskCache<String, String> idc = new IndexedDiskCache<>(cattr);
Map<String, IndexedDiskElementDescriptor> cacheCount = idc.new LRUMapCountLimited( tries );
Map<String, IndexedDiskElementDescriptor> cacheSize = idc.new LRUMapSizeLimited( tries/1024/2 );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDataSourceFactoryUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDataSourceFactoryUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDataSourceFactoryUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDataSourceFactoryUnitTest.java Fri May 24 09:26:50 2019
@@ -154,7 +154,7 @@ public class JDBCDataSourceFactoryUnitTe
{
context = new InitialContext(true)
{
- Map<String, Object> bindings = new HashMap<String, Object>();
+ Map<String, Object> bindings = new HashMap<>();
@Override
public void bind(String name, Object obj) throws NamingException
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java Fri May 24 09:26:50 2019
@@ -112,7 +112,7 @@ public class JDBCDiskCacheSharedPoolUnit
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = 0; i <= items; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java Fri May 24 09:26:50 2019
@@ -116,7 +116,7 @@ public class JDBCDiskCacheUnitTest
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = 0; i <= items; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java Fri May 24 09:26:50 2019
@@ -144,7 +144,7 @@ public class HSQLDiskCacheConcurrentUnit
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = 0; i <= items; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java Fri May 24 09:26:50 2019
@@ -81,7 +81,7 @@ public class HSQLDiskCacheUnitTest
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = 0; i <= items; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java Fri May 24 09:26:50 2019
@@ -118,7 +118,7 @@ public class MySQLDiskCacheHsqlBackedUni
}
// Test that getElements returns all the expected values
- Set<String> keys = new HashSet<String>();
+ Set<String> keys = new HashSet<>();
for ( int i = 0; i < items; i++ )
{
keys.add( i + ":key" );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java Fri May 24 09:26:50 2019
@@ -60,7 +60,7 @@ public class MySQLDiskCacheUnitTest
TableState tableState = new TableState( tableName );
tableState.setState( TableState.OPTIMIZATION_RUNNING );
- MySQLDiskCache<String, String> cache = new MySQLDiskCache<String, String>( attributes, dsFactory, tableState,
+ MySQLDiskCache<String, String> cache = new MySQLDiskCache<>( attributes, dsFactory, tableState,
CompositeCacheManager.getUnconfiguredInstance() );
// DO WORK
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java Fri May 24 09:26:50 2019
@@ -39,10 +39,10 @@ public class LateralCacheNoWaitFacadeUni
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( "testCache1" );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
// DO WORK
facade.addNoWait( noWait );
@@ -69,11 +69,11 @@ public class LateralCacheNoWaitFacadeUni
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( "testCache1" );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
- LateralCacheNoWait<String, String> noWait2 = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
+ LateralCacheNoWait<String, String> noWait2 = new LateralCacheNoWait<>( cache );
// DO WORK
facade.addNoWait( noWait );
@@ -104,10 +104,10 @@ public class LateralCacheNoWaitFacadeUni
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( "testCache1" );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
// DO WORK
facade.addNoWait( noWait );
@@ -129,10 +129,10 @@ public class LateralCacheNoWaitFacadeUni
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( "testCache1" );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
// DO WORK
facade.removeNoWait( noWait );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java Fri May 24 09:26:50 2019
@@ -85,7 +85,7 @@ public class LateralTCPConcurrentRandomT
// this service will put and remove using the lateral to
// the cache instance above
// the cache thinks it is different since the listenerid is different
- LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
+ LateralTCPService<String, String> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
try
@@ -98,7 +98,7 @@ public class LateralTCPConcurrentRandomT
String key = "key" + kn;
if ( n == 1 )
{
- ICacheElement<String, String> element = new CacheElement<String, String>( region, key, region + ":data" + i
+ ICacheElement<String, String> element = new CacheElement<>( region, key, region + ":data" + i
+ " junk asdfffffffadfasdfasf " + kn + ":" + n );
service.update( element );
if ( show )
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java Fri May 24 09:26:50 2019
@@ -80,7 +80,7 @@ public class LateralTCPDiscoveryListener
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
// DO WORK
listener.addNoWaitFacade( cacheName, facade );
@@ -102,11 +102,11 @@ public class LateralTCPDiscoveryListener
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
listener.addNoWaitFacade( cacheName, facade );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
// DO WORK
boolean result = listener.addNoWait( noWait );
@@ -125,8 +125,8 @@ public class LateralTCPDiscoveryListener
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
// DO WORK
boolean result = listener.addNoWait( noWait );
@@ -145,8 +145,8 @@ public class LateralTCPDiscoveryListener
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
// DO WORK
boolean result = listener.removeNoWait( noWait );
@@ -168,11 +168,11 @@ public class LateralTCPDiscoveryListener
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
listener.addNoWaitFacade( cacheName, facade );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
// DO WORK
boolean result = listener.removeNoWait( noWait );
@@ -194,11 +194,11 @@ public class LateralTCPDiscoveryListener
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
listener.addNoWaitFacade( cacheName, facade );
- LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
- LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+ LateralCache<String, String> cache = new LateralCache<>( cattr );
+ LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<>( cache );
listener.addNoWait( noWait );
// DO WORK
@@ -216,7 +216,7 @@ public class LateralTCPDiscoveryListener
// SETUP
String cacheName = "testAddDiscoveredService_FacadeInList_NoWaitNot";
- ArrayList<String> cacheNames = new ArrayList<String>();
+ ArrayList<String> cacheNames = new ArrayList<>();
cacheNames.add( cacheName );
DiscoveredService service = new DiscoveredService();
@@ -238,7 +238,7 @@ public class LateralTCPDiscoveryListener
LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
listener.addNoWaitFacade( cacheName, facade );
// DO WORK
@@ -256,7 +256,7 @@ public class LateralTCPDiscoveryListener
// SETUP
String cacheName = "testRemoveDiscoveredService_FacadeInList_NoWaitIs";
- ArrayList<String> cacheNames = new ArrayList<String>();
+ ArrayList<String> cacheNames = new ArrayList<>();
cacheNames.add( cacheName );
DiscoveredService service = new DiscoveredService();
@@ -278,7 +278,7 @@ public class LateralTCPDiscoveryListener
LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( cacheName );
- LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
+ LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<>( null, noWaits, cattr );
listener.addNoWaitFacade( cacheName, facade );
listener.addDiscoveredService( service );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java Fri May 24 09:26:50 2019
@@ -99,7 +99,7 @@ public class LateralTCPFilterRemoveHashC
// this service will put and remove using the lateral to
// the cache instance above
// the cache thinks it is different since the listenerid is different
- LateralTCPService<String, Serializable> service = new LateralTCPService<String, Serializable>( lattr2 );
+ LateralTCPService<String, Serializable> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
String keyToBeRemovedOnPut = "test1";
@@ -122,12 +122,12 @@ public class LateralTCPFilterRemoveHashC
// dataToPassHashCodeCompare.hashCode() );
cache.put( keyToBeRemovedOnPut, "this should get removed." );
- ICacheElement<String, Serializable> element1 = new CacheElement<String, Serializable>( region, keyToBeRemovedOnPut, region
+ ICacheElement<String, Serializable> element1 = new CacheElement<>( region, keyToBeRemovedOnPut, region
+ ":data-this shouldn't get there" );
service.update( element1 );
cache.put( keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
- ICacheElement<String, Serializable> element2 = new CacheElement<String, Serializable>( region, keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
+ ICacheElement<String, Serializable> element2 = new CacheElement<>( region, keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
service.update( element2 );
/*
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java Fri May 24 09:26:50 2019
@@ -96,12 +96,12 @@ public class LateralTCPIssueRemoveOnPutU
// Using the lateral, this service will put to and remove from
// the cache instance above.
// The cache thinks it is different since the listenerid is different
- LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
+ LateralTCPService<String, String> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
String keyToBeRemovedOnPut = "test1_notremoved";
- ICacheElement<String, String> element1 = new CacheElement<String, String>( region, keyToBeRemovedOnPut, region
+ ICacheElement<String, String> element1 = new CacheElement<>( region, keyToBeRemovedOnPut, region
+ ":data-this shouldn't get removed, it should get to the cache." );
service.update( element1 );
@@ -143,13 +143,13 @@ public class LateralTCPIssueRemoveOnPutU
// Using the lateral, this service will put to and remove from
// the cache instance above.
// The cache thinks it is different since the listenerid is different
- LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
+ LateralTCPService<String, String> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
String keyToBeRemovedOnPut = "test1";
cache.put( keyToBeRemovedOnPut, "this should get removed." );
- ICacheElement<String, String> element1 = new CacheElement<String, String>( region, keyToBeRemovedOnPut, region
+ ICacheElement<String, String> element1 = new CacheElement<>( region, keyToBeRemovedOnPut, region
+ ":data-this shouldn't get there" );
service.update( element1 );
@@ -162,7 +162,7 @@ public class LateralTCPIssueRemoveOnPutU
int kn = ran.nextInt( range );
String key = "key" + kn;
- ICacheElement<String, String> element = new CacheElement<String, String>( region, key, region + ":data" + i
+ ICacheElement<String, String> element = new CacheElement<>( region, key, region + ":data" + i
+ " junk asdfffffffadfasdfasf " + kn + ":" + n );
service.update( element );
if ( show )
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java?rev=1859859&r1=1859858&r2=1859859&view=diff
==============================================================================
--- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java Fri May 24 09:26:50 2019
@@ -86,8 +86,8 @@ public class TestTCPLateralUnitTest
for ( int i = 0; i < numMes; i++ )
{
String message = "adsfasasfasfasdasf";
- CacheElement<String, String> ce = new CacheElement<String, String>( "test", "test", message );
- LateralElementDescriptor<String, String> led = new LateralElementDescriptor<String, String>( ce );
+ CacheElement<String, String> ce = new CacheElement<>( "test", "test", message );
+ LateralElementDescriptor<String, String> led = new LateralElementDescriptor<>( ce );
led.command = LateralCommand.UPDATE;
led.requesterId = 1;
lur.send( led );
@@ -119,14 +119,14 @@ public class TestTCPLateralUnitTest
lattr2.setTransmissionTypeName( "TCP" );
lattr2.setTcpServer( "localhost:1101" );
- LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
+ LateralTCPService<String, String> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
// DO WORK
int cnt = 100;
for ( int i = 0; i < cnt; i++ )
{
- ICacheElement<String, String> element = new CacheElement<String, String>( "test", "key" + i, "value1" );
+ ICacheElement<String, String> element = new CacheElement<>( "test", "key" + i, "value1" );
service.update( element );
}
@@ -162,16 +162,16 @@ public class TestTCPLateralUnitTest
lattr2.setTcpListenerPort( 1104 );
lattr2.setTcpServer( "localhost:1103" );
- LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
+ LateralTCPService<String, String> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
// DO WORK
- ICacheElement<String, String> element = new CacheElement<String, String>( "test", "key", "value1" );
+ ICacheElement<String, String> element = new CacheElement<>( "test", "key", "value1" );
service.update( element );
SleepUtil.sleepAtLeast( 300 );
- ICacheElement<String, String> element2 = new CacheElement<String, String>( "test", "key", "value2" );
+ ICacheElement<String, String> element2 = new CacheElement<>( "test", "key", "value2" );
service.update( element2 );
SleepUtil.sleepAtLeast( 1000 );
@@ -206,17 +206,17 @@ public class TestTCPLateralUnitTest
lattr2.setTransmissionTypeName( "TCP" );
lattr2.setTcpServer( "localhost:1105" );
- LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
+ LateralTCPService<String, String> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
// DO WORK
String key = "key";
- ICacheElement<String, String> element = new CacheElement<String, String>( "test", key, "value1" );
+ ICacheElement<String, String> element = new CacheElement<>( "test", key, "value1" );
service.update( element );
SleepUtil.sleepAtLeast( 300 );
- ICacheElement<String, String> element2 = new CacheElement<String, String>( "test", key, "value2" );
+ ICacheElement<String, String> element2 = new CacheElement<>( "test", key, "value2" );
service.update( element2 );
SleepUtil.sleepAtLeast( 1000 );
@@ -248,7 +248,7 @@ public class TestTCPLateralUnitTest
LateralTCPListener.getInstance( lattr, cacheMgr );
// add the item to the listeners cache
- ICacheElement<String, String> element = new CacheElement<String, String>( "test", "key", "value1" );
+ ICacheElement<String, String> element = new CacheElement<>( "test", "key", "value1" );
cache.update( element );
// setup a service to talk to the listener started above.
@@ -256,7 +256,7 @@ public class TestTCPLateralUnitTest
lattr2.setTcpListenerPort( 1108 );
lattr2.setTcpServer( "localhost:1107" );
- LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
+ LateralTCPService<String, String> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
SleepUtil.sleepAtLeast( 300 );
@@ -290,9 +290,9 @@ public class TestTCPLateralUnitTest
LateralTCPListener.getInstance( lattr, cacheMgr );
// add the item to the listeners cache
- GroupAttrName<String> groupKey = new GroupAttrName<String>(new GroupId("test", "group"), "key");
+ GroupAttrName<String> groupKey = new GroupAttrName<>(new GroupId("test", "group"), "key");
ICacheElement<GroupAttrName<String>, String> element =
- new CacheElement<GroupAttrName<String>, String>( "test", groupKey, "value1" );
+ new CacheElement<>( "test", groupKey, "value1" );
cache.update( element );
// setup a service to talk to the listener started above.
@@ -301,7 +301,7 @@ public class TestTCPLateralUnitTest
lattr2.setTcpServer( "localhost:1150" );
LateralTCPService<GroupAttrName<String>, String> service =
- new LateralTCPService<GroupAttrName<String>, String>( lattr2 );
+ new LateralTCPService<>( lattr2 );
service.setListenerId( 123459 );
SleepUtil.sleepAtLeast( 500 );
@@ -343,7 +343,7 @@ public class TestTCPLateralUnitTest
for ( int i = 0; i < numToInsertPrefix1; i++ )
{
// add the item to the listeners cache
- ICacheElement<String, Integer> element = new CacheElement<String, Integer>( "test", keyprefix1 + String.valueOf( i ), Integer.valueOf( i ) );
+ ICacheElement<String, Integer> element = new CacheElement<>( "test", keyprefix1 + String.valueOf( i ), Integer.valueOf( i ) );
cache.update( element );
}
@@ -352,7 +352,7 @@ public class TestTCPLateralUnitTest
lattr2.setTcpListenerPort( 1108 );
lattr2.setTcpServer( "localhost:1108" );
- LateralTCPService<String, Integer> service = new LateralTCPService<String, Integer>( lattr2 );
+ LateralTCPService<String, Integer> service = new LateralTCPService<>( lattr2 );
service.setListenerId( 123456 );
SleepUtil.sleepAtLeast( 300 );
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheClient.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheClient.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/MockRemoteCacheClient.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheClient.java Fri May 24 09:26:50 2019
@@ -50,20 +50,20 @@ public class MockRemoteCacheClient<K, V>
private static final Log log = LogFactory.getLog( MockRemoteCacheClient.class );
/** List of ICacheElement<K, V> objects passed into update. */
- public List<ICacheElement<K, V>> updateList = new LinkedList<ICacheElement<K,V>>();
+ public List<ICacheElement<K, V>> updateList = new LinkedList<>();
/** List of key objects passed into remove. */
- public List<K> removeList = new LinkedList<K>();
+ public List<K> removeList = new LinkedList<>();
/** status to return. */
public CacheStatus status = CacheStatus.ALIVE;
/** Can setup values to return from get. values must be ICacheElement<K, V> */
- public Map<K, ICacheElement<K, V>> getSetupMap = new HashMap<K, ICacheElement<K,V>>();
+ public Map<K, ICacheElement<K, V>> getSetupMap = new HashMap<>();
/** Can setup values to return from get. values must be Map<K, ICacheElement<K, V>> */
public Map<Set<K>, Map<K, ICacheElement<K, V>>> getMultipleSetupMap =
- new HashMap<Set<K>, Map<K,ICacheElement<K,V>>>();
+ new HashMap<>();
/** The last service passed to fixCache */
public ICacheServiceNonLocal<K, V> fixed;
@@ -245,7 +245,7 @@ public class MockRemoteCacheClient<K, V>
public Map<K, ICacheElement<K, V>> getMatching(String pattern)
throws IOException
{
- 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/MockRemoteCacheListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheListener.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/MockRemoteCacheListener.java (original)
+++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheListener.java Fri May 24 09:26:50 2019
@@ -45,10 +45,10 @@ public class MockRemoteCacheListener<K,
public int putCount;
/** List of ICacheElements passed to handlePut. */
- public List<ICacheElement<K, V>> putItems = new LinkedList<ICacheElement<K,V>>();
+ public List<ICacheElement<K, V>> putItems = new LinkedList<>();
/** List of Serializable objects passed to handleRemove. */
- public List<K> removedKeys = new LinkedList<K>();
+ public List<K> removedKeys = new LinkedList<>();
/** Number of times handleRemote was called. */
public int removeCount;