commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1584072 - in /commons/proper/jcs/trunk/src/test/org/apache/commons/jcs: ./ auxiliary/disk/block/ utils/threadpool/
Date Wed, 02 Apr 2014 15:41:01 GMT
Author: sebb
Date: Wed Apr  2 15:41:00 2014
New Revision: 1584072

URL: http://svn.apache.org/r1584072
Log:
Flag or fix some more test noise

Modified:
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSRemovalSimpleConcurrentTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/RemovalTestUtil.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/ZeroSizeCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheConcurrentUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSRemovalSimpleConcurrentTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSRemovalSimpleConcurrentTest.java?rev=1584072&r1=1584071&r2=1584072&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSRemovalSimpleConcurrentTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSRemovalSimpleConcurrentTest.java
Wed Apr  2 15:41:00 2014
@@ -69,9 +69,6 @@ public class JCSRemovalSimpleConcurrentT
     public void testTwoDeepRemoval()
         throws Exception
     {
-        System.out.println( "------------------------------------------" );
-        System.out.println( "testTwoDeepRemoval" );
-
         int count = 500;
         CacheAccess<String, String> jcs = JCS.getInstance( "testCache1" );
 
@@ -85,16 +82,12 @@ public class JCSRemovalSimpleConcurrentT
             String res = jcs.get( "key:" + i + ":anotherpart" );
             assertNotNull( "[key:" + i + ":anotherpart] should not be null, " + jcs.getStats(),
res );
         }
-        System.out.println( "Confirmed that " + count + " items could be found" );
 
         for ( int i = 0; i <= count; i++ )
         {
             jcs.remove( "key:" + i + ":" );
             assertNull( jcs.getStats(), jcs.get( "key:" + i + ":anotherpart" ) );
         }
-        System.out.println( "Confirmed that " + count + " items were removed" );
-
-        System.out.println( jcs.getStats() );
 
     }
 
@@ -107,9 +100,6 @@ public class JCSRemovalSimpleConcurrentT
         throws Exception
     {
 
-        System.out.println( "------------------------------------------" );
-        System.out.println( "testSingleDepthRemoval" );
-
         int count = 500;
         CacheAccess<String, String> jcs = JCS.getInstance( "testCache1" );
 
@@ -123,17 +113,12 @@ public class JCSRemovalSimpleConcurrentT
             String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
-        System.out.println( "Confirmed that " + count + " items could be found" );
 
         for ( int i = 0; i <= count; i++ )
         {
             jcs.remove( i + ":" );
             assertNull( jcs.get( i + ":key" ) );
         }
-        System.out.println( "Confirmed that " + count + " items were removed" );
-
-        System.out.println( jcs.getStats() );
-
     }
 
     /**
@@ -145,9 +130,6 @@ public class JCSRemovalSimpleConcurrentT
         throws Exception
     {
 
-        System.out.println( "------------------------------------------" );
-        System.out.println( "testRemoveAll" );
-
         int count = 500;
         CacheAccess<String, String> jcs = JCS.getInstance( "testCache1" );
 
@@ -161,10 +143,6 @@ public class JCSRemovalSimpleConcurrentT
             String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
-        System.out.println( "Confirmed that " + count + " items could be found" );
-
-        System.out.println( jcs.getStats() );
-
         jcs.clear();
 
         for ( int i = count; i >= 0; i-- )
@@ -175,8 +153,6 @@ public class JCSRemovalSimpleConcurrentT
                 assertNull( "[" + i + ":key] should be null after remvoeall" + jcs.getStats(),
res );
             }
         }
-        System.out.println( "Confirmed that all items were removed" );
-
     }
 
     /**
@@ -187,10 +163,6 @@ public class JCSRemovalSimpleConcurrentT
     public void testClearRepeatedlyWithoutError()
         throws Exception
     {
-
-        System.out.println( "------------------------------------------" );
-        System.out.println( "testRemoveAll" );
-
         int count = 500;
         CacheAccess<String, String> jcs = JCS.getInstance( "testCache1" );
 
@@ -206,9 +178,6 @@ public class JCSRemovalSimpleConcurrentT
             String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
-        System.out.println( "Confirmed that " + count + " items could be found" );
-
-        System.out.println( jcs.getStats() );
 
         for ( int i = count; i >= 0; i-- )
         {
@@ -220,6 +189,5 @@ public class JCSRemovalSimpleConcurrentT
                 assertNull( "[" + i + ":key] should be null after remvoeall" + jcs.getStats(),
res );
             }
         }
-        System.out.println( "Confirmed that all items were removed" );
     }
 }

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/RemovalTestUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/RemovalTestUtil.java?rev=1584072&r1=1584071&r2=1584072&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/RemovalTestUtil.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/RemovalTestUtil.java Wed Apr
 2 15:41:00 2014
@@ -67,17 +67,12 @@ public class RemovalTestUtil
             String res = jcs.get( i + ":key" );
             assertNotNull( "[" + i + ":key] should not be null", res );
         }
-        System.out.println( "Confirmed that " + ( end - start ) + " items could be found"
);
 
         for ( int i = start; i <= end; i++ )
         {
             jcs.remove( i + ":" );
             assertNull( jcs.get( i + ":key" ) );
         }
-        System.out.println( "Confirmed that " + ( end - start ) + " items were removed" );
-
-        System.out.println( jcs.getStats() );
-
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/ZeroSizeCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/ZeroSizeCacheUnitTest.java?rev=1584072&r1=1584071&r2=1584072&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/ZeroSizeCacheUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/ZeroSizeCacheUnitTest.java Wed
Apr  2 15:41:00 2014
@@ -87,7 +87,5 @@ public class ZeroSizeCacheUnitTest
             String res = jcs.get( i + ":key" );
             assertNull( "[" + i + ":key] should be null", res );
         }
-
-        System.out.println( jcs.getStats() );
     }
 }

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheConcurrentUnitTest.java?rev=1584072&r1=1584071&r2=1584072&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheConcurrentUnitTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheConcurrentUnitTest.java
Wed Apr  2 15:41:00 2014
@@ -246,7 +246,7 @@ public class BlockDiskCacheConcurrentUni
             jcs.remove( i + ":key" );
         }
 
-        System.out.println( jcs.getStats() );
+        System.out.println( jcs.getStats() ); // TODO replace noise with an assertion
 
         // Verify removal
         // another thread may have inserted since

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java?rev=1584072&r1=1584071&r2=1584072&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
Wed Apr  2 15:41:00 2014
@@ -61,7 +61,7 @@ public class BlockDiskCacheKeyStoreUnitT
         {
             keyStore.put( String.valueOf( i ), new int[i] );
         }
-        System.out.println( "testPutKeys " + keyStore );
+//        System.out.println( "testPutKeys " + keyStore );
 
         // VERIFY
         assertEquals( "Wrong number of keys", numElements, keyStore.size() );
@@ -103,7 +103,7 @@ public class BlockDiskCacheKeyStoreUnitT
             keyStore.put( String.valueOf( i ), new int[blocks] );
             keyStore.put( String.valueOf( i ), new int[i] );
         }
-        System.out.println( "testSaveLoadKeys " + keyStore );
+//        System.out.println( "testSaveLoadKeys " + keyStore );
 
         // VERIFY
         assertEquals( "Wrong number of keys", numElements, keyStore.size() );

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java?rev=1584072&r1=1584071&r2=1584072&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java
Wed Apr  2 15:41:00 2014
@@ -57,8 +57,6 @@ public class BlockDiskCacheSteadyLoadTes
     {
         JCS.setConfigFilename( "/TestBlockDiskCacheSteadyLoad.ccf" );
 
-        System.out.println( "runSteadyLoadTest" );
-
         logMemoryUsage();
 
         int numPerRun = 250;
@@ -75,15 +73,15 @@ public class BlockDiskCacheSteadyLoadTes
         {
             jcs.get( String.valueOf( i ) );
         }
-        System.out.println( LOG_DIVIDER );
-        System.out.println( "After getting " + numToGet );
-        System.out.println( "Elapsed " + timer.getElapsedTimeString() );
+//        System.out.println( LOG_DIVIDER );
+//        System.out.println( "After getting " + numToGet );
+//        System.out.println( "Elapsed " + timer.getElapsedTimeString() );
         logMemoryUsage();
 
         jcs.clear();
         Thread.sleep( 3000 );
-        System.out.println( LOG_DIVIDER );
-        System.out.println( "Start putting" );
+//        System.out.println( LOG_DIVIDER );
+//        System.out.println( "Start putting" );
 
         long totalSize = 0;
         int totalPut = 0;
@@ -125,26 +123,26 @@ public class BlockDiskCacheSteadyLoadTes
             Thread.sleep( pauseBetweenRuns );
             if ( runCount % 100 == 0 )
             {
-                System.out.println( LOG_DIVIDER );
-                System.out.println( "Elapsed " + timer.getElapsedTimeString() );
-                System.out.println( "Run count: " + runCount + " Average size: " + ( totalSize
/ totalPut ) + "\n"
-                    + jcs.getStats() );
+//                System.out.println( LOG_DIVIDER );
+//                System.out.println( "Elapsed " + timer.getElapsedTimeString() );
+//                System.out.println( "Run count: " + runCount + " Average size: " + ( totalSize
/ totalPut ) + "\n"
+//                    + jcs.getStats() );
                 logMemoryUsage();
             }
         }
 
         Thread.sleep( 3000 );
-        System.out.println( jcs.getStats() );
+//        System.out.println( jcs.getStats() );
         logMemoryUsage();
 
         Thread.sleep( 10000 );
-        System.out.println( jcs.getStats() );
+//        System.out.println( jcs.getStats() );
         logMemoryUsage();
 
         System.gc();
         Thread.sleep( 3000 );
         System.gc();
-        System.out.println( jcs.getStats() );
+//        System.out.println( jcs.getStats() );
         logMemoryUsage();
     }
 

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java?rev=1584072&r1=1584071&r2=1584072&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
Wed Apr  2 15:41:00 2014
@@ -57,12 +57,10 @@ public class ThreadPoolManagerUnitTest
         // int qs = ((BoundedBuffer)pool.getQueue()).size();
 
         int max = pool.getMaximumPoolSize();
-        System.out.println( max );
 
         int expected = Integer.parseInt( PropertyLoader.loadProperties( "thread_pool.properties"
)
             .getProperty( "thread_pool.test1.maximumPoolSize" ) );
-        // "Max should be " + expected",
-        assertEquals( max, expected );
+        assertEquals(expected, max );
     }
 
     /**
@@ -78,12 +76,10 @@ public class ThreadPoolManagerUnitTest
         assertNotNull( pool );
 
         int max = pool.getMaximumPoolSize();
-        System.out.println( max );
 
         int expected = Integer.parseInt( PropertyLoader.loadProperties( "thread_pool.properties"
)
             .getProperty( "thread_pool.default.maximumPoolSize" ) );
-        // "Max should be " + expected",
-        assertEquals( max, expected );
+        assertEquals( expected, max );
     }
 
     /**
@@ -100,14 +96,12 @@ public class ThreadPoolManagerUnitTest
         assertNotNull( "Should have gotten back a pool configured like the default", pool
);
 
         int max = pool.getMaximumPoolSize();
-        System.out.println( max );
 
         // it will load from the default file
         int expected = Integer.parseInt( PropertyLoader.loadProperties( "cache.ccf" )
             .getProperty( "thread_pool.default.maximumPoolSize" ) );
 
-        // "Max should be " + expected",
-        assertEquals( max, expected );
+        assertEquals( expected, max );
     }
 
     /**
@@ -147,14 +141,12 @@ public class ThreadPoolManagerUnitTest
         assertNotNull( "Should have gotten back a pool.", pool );
 
         int max = pool.getMaximumPoolSize();
-        System.out.println( "testWaitPolicyConfig " + max );
 
         // it will load from the default file
         int expected = Integer.parseInt( PropertyLoader.loadProperties( "thread_pool.properties"
)
             .getProperty( "thread_pool.waittest.maximumPoolSize" ) );
 
-        // "Max should be " + expected",
-        assertEquals( "Max is wrong", max, expected );
+        assertEquals( "Max is wrong", expected, max );
 
         PoolConfiguration config = mgr.loadConfig( "thread_pool.waittest" );
 



Mime
View raw message