Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java?rev=1157592&r1=1157591&r2=1157592&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java Sun Aug 14 18:13:15 2011 @@ -51,7 +51,7 @@ public class JCSWorkerUnitTest public Object doWork() { - Object results = new Long( ++timesCalled ); + Object results = Long.valueOf( ++timesCalled ); return results; } }; @@ -59,11 +59,11 @@ public class JCSWorkerUnitTest String key = "abc"; Long result = (Long) cachingWorker.getResult( key, helper ); - assertEquals( "Called the wrong number of times", new Long( 1 ), result ); + assertEquals( "Called the wrong number of times", Long.valueOf( 1 ), result ); // should get it fromthe cache. Long result2 = (Long) cachingWorker.getResult( key, helper ); - assertEquals( "Called the wrong number of times", new Long( 1 ), result2 ); + assertEquals( "Called the wrong number of times", Long.valueOf( 1 ), result2 ); }
Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java?rev=1157592&r1=1157591&r2=1157592&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java Sun Aug 14 18:13:15 2011 @@ -66,6 +66,7 @@ public class LRUMapConcurrentTest final LRUMap map = new LRUMap( 2000 ); suite.addTest( new LRUMapConcurrentTest( "conc1" ) { + @Override public void runTest() throws Exception { @@ -74,6 +75,7 @@ public class LRUMapConcurrentTest } ); suite.addTest( new LRUMapConcurrentTest( "conc2" ) { + @Override public void runTest() throws Exception { @@ -82,6 +84,7 @@ public class LRUMapConcurrentTest } ); suite.addTest( new LRUMapConcurrentTest( "conc3" ) { + @Override public void runTest() throws Exception { @@ -94,6 +97,7 @@ public class LRUMapConcurrentTest final LRUMap map2 = new LRUMap( max2 ); suite.addTest( new LRUMapConcurrentTest( "concB1" ) { + @Override public void runTest() throws Exception { @@ -102,6 +106,7 @@ public class LRUMapConcurrentTest } ); suite.addTest( new LRUMapConcurrentTest( "concB1" ) { + @Override public void runTest() throws Exception { @@ -129,10 +134,7 @@ public class LRUMapConcurrentTest for ( int i = items - 1; i >= 0; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } // test removal @@ -169,10 +171,7 @@ public class LRUMapConcurrentTest for ( int i = total - 1; i >= 0; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } System.out.println( map.getStatistics() ); @@ -211,10 +210,7 @@ public class LRUMapConcurrentTest for ( int i = ( total * 2 ) - 1; i >= total; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } System.out.println( map.getStatistics() ); @@ -238,12 +234,8 @@ public class LRUMapConcurrentTest for ( int i = items - 1; i >= 0; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } - } /** @@ -265,15 +257,11 @@ public class LRUMapConcurrentTest for ( int i = end - 1; i >= start; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } // test removal map.remove( start + ":key" ); assertNull( map.get( start + ":key" ) ); - } } Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java?rev=1157592&r1=1157591&r2=1157592&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java Sun Aug 14 18:13:15 2011 @@ -25,8 +25,6 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -import org.apache.jcs.utils.struct.LRUMap; - /** * Tests the LRUMap * @@ -62,6 +60,7 @@ public class LRUMapConcurrentUnitTest final LRUMap map = new LRUMap( 2000 ); suite.addTest( new LRUMapConcurrentUnitTest( "conc1" ) { + @Override public void runTest() throws Exception { @@ -70,6 +69,7 @@ public class LRUMapConcurrentUnitTest } ); suite.addTest( new LRUMapConcurrentUnitTest( "conc2" ) { + @Override public void runTest() throws Exception { @@ -78,6 +78,7 @@ public class LRUMapConcurrentUnitTest } ); suite.addTest( new LRUMapConcurrentUnitTest( "conc3" ) { + @Override public void runTest() throws Exception { @@ -90,6 +91,7 @@ public class LRUMapConcurrentUnitTest final LRUMap map2 = new LRUMap( max2 ); suite.addTest( new LRUMapConcurrentUnitTest( "concB1" ) { + @Override public void runTest() throws Exception { @@ -98,6 +100,7 @@ public class LRUMapConcurrentUnitTest } ); suite.addTest( new LRUMapConcurrentUnitTest( "concB1" ) { + @Override public void runTest() throws Exception { @@ -127,10 +130,7 @@ public class LRUMapConcurrentUnitTest for ( int i = items - 1; i >= 0; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } // test removal @@ -169,10 +169,7 @@ public class LRUMapConcurrentUnitTest for ( int i = total - 1; i >= 0; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } System.out.println( map.getStatistics() ); @@ -211,10 +208,7 @@ public class LRUMapConcurrentUnitTest for ( int i = ( total * 2 ) - 1; i >= total; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } System.out.println( map.getStatistics() ); @@ -239,12 +233,8 @@ public class LRUMapConcurrentUnitTest for ( int i = items - 1; i >= 0; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } - } /** @@ -267,10 +257,7 @@ public class LRUMapConcurrentUnitTest for ( int i = end - 1; i >= start; i-- ) { String res = (String) map.get( i + ":key" ); - if ( res == null ) - { - assertNotNull( "[" + i + ":key] should not be null", res ); - } + assertNotNull( "[" + i + ":key] should not be null", res ); } // test removal Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/SingleLinkedListUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/SingleLinkedListUnitTest.java?rev=1157592&r1=1157591&r2=1157592&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/SingleLinkedListUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/SingleLinkedListUnitTest.java Sun Aug 14 18:13:15 2011 @@ -56,7 +56,7 @@ public class SingleLinkedListUnitTest int numToPut = 100; for ( int i = 0; i < numToPut; i++ ) { - list.addLast( new Integer( i ) ); + list.addLast( Integer.valueOf( i ) ); } // VERIFY @@ -65,7 +65,7 @@ public class SingleLinkedListUnitTest for ( int i = 0; i < numToPut; i++ ) { Object result = list.takeFirst(); - assertEquals( "Wrong value returned.", new Integer( i ), result ); + assertEquals( "Wrong value returned.", Integer.valueOf( i ), result ); } // DO WORK @@ -87,7 +87,7 @@ public class SingleLinkedListUnitTest int numToPut = 100; for ( int i = 0; i < numToPut; i++ ) { - list.addLast( new Integer( i ) ); + list.addLast( Integer.valueOf( i ) ); } // VERIFY