Author: tv Date: Sat Dec 31 13:52:44 2016 New Revision: 1776748 URL: http://svn.apache.org/viewvc?rev=1776748&view=rev Log: Adjust
Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapConcurrentUnitTest.java commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapConcurrentUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapConcurrentUnitTest.java?rev=1776748&r1=1776747&r2=1776748&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapConcurrentUnitTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapConcurrentUnitTest.java Sat Dec 31 13:52:44 2016 @@ -1,5 +1,7 @@ package org.apache.commons.jcs.utils.struct; +import java.util.Iterator; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -23,8 +25,6 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -import java.util.Iterator; - /** * Tests the LRUMap * @@ -150,7 +150,6 @@ public class LRUMapConcurrentUnitTest { int total = 10; LRUMap<String, String> map = new LRUMap<String, String>( total ); - map.setChunkSize( 1 ); // put the max in for ( int i = 0; i < total; i++ ) @@ -189,7 +188,6 @@ public class LRUMapConcurrentUnitTest { int total = 10000; LRUMap<String, String> map = new LRUMap<String, String>( total ); - map.setChunkSize( 1 ); // put the max in for ( int i = 0; i < total * 2; i++ ) @@ -201,7 +199,6 @@ public class LRUMapConcurrentUnitTest for ( int i = total - 1; i >= 0; i-- ) { assertNull( map.get( i + ":key" ) ); - } // get the total to total *2 items out, these should be found. @@ -212,7 +209,6 @@ public class LRUMapConcurrentUnitTest } // System.out.println( map.getStatistics() ); - } /** Modified: commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java?rev=1776748&r1=1776747&r2=1776748&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-core/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java Sat Dec 31 13:52:44 2016 @@ -1,5 +1,9 @@ package org.apache.commons.jcs.utils.struct; +import java.util.Map; + +import org.apache.commons.jcs.JCSvsHashtablePerformanceTest; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -22,9 +26,6 @@ package org.apache.commons.jcs.utils.str import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -import org.apache.commons.jcs.JCSvsHashtablePerformanceTest; - -import java.util.Map; /** * This ensures that the jcs version of the LRU map is as fast as the commons @@ -106,7 +107,7 @@ public class LRUMapPerformanceTest try { - Map<String, String> cache = new LRUMap<String, String>( tries ); + LRUMap<String, String> cache = new LRUMap<String, String>( tries ); for ( int j = 0; j < loops; j++ ) { @@ -134,9 +135,12 @@ public class LRUMapPerformanceTest System.out.println( name + " get time for " + tries + " = " + time + "; millis per = " + tPer ); /////////////////////////////////////////////////////////////// - cache2Name = "LRUMapJCS (commons)"; + cache2Name = "LRUMap (commons)"; //or LRUMapJCS Map<String, String> cache2 = new org.apache.commons.collections4.map.LRUMap<String, String>( tries ); +// Map<String, String> cache2 = new ConcurrentLinkedHashMap.Builder<String, String>() +// .maximumWeightedCapacity( tries ) +// .build(); //cache2Name = "Hashtable"; //Hashtable cache2 = new Hashtable(); start = System.currentTimeMillis();