commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1584478 - /commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
Date Fri, 04 Apr 2014 00:10:05 GMT
Author: sebb
Date: Fri Apr  4 00:10:05 2014
New Revision: 1584478

URL: http://svn.apache.org/r1584478
Log:
Add debug output if assertion fails

Modified:
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java

Modified: commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java?rev=1584478&r1=1584477&r2=1584478&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
(original)
+++ commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
Fri Apr  4 00:10:05 2014
@@ -90,8 +90,12 @@ public class BasicRemoteCacheClientServe
         SleepUtil.sleepAtLeast( 200 );
 
         // VERIFY
-//        System.out.println( server.getStats() );
-        assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );
+        try {
+            assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior
);
+        } catch (junit.framework.AssertionFailedError e) {
+            System.out.println( server.getStats() );
+            throw e;
+        }
 
         // DO WORK
         ICacheElement<String, String> result = cache.get( "key" );
@@ -129,8 +133,12 @@ public class BasicRemoteCacheClientServe
         SleepUtil.sleepAtLeast( 50 );
 
         // VERIFY
-//        System.out.println( server.getStats() );
-        assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );
+        try {
+            assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior
);
+        } catch (junit.framework.AssertionFailedError e) {
+            System.out.println( server.getStats() );
+            throw e;
+        }
 
         // DO WORK
         ICacheElement<String, String> result = cache.get( "key" );
@@ -178,9 +186,11 @@ public class BasicRemoteCacheClientServe
         // VERIFY
         try
         {
-//            System.out.println( server.getStats() );
             assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior
);
             assertEquals( "Wrong number of puts to listener.", 1, listener.putCount );
+        } catch (junit.framework.AssertionFailedError e) {
+            System.out.println( server.getStats() );
+            throw e;
         }
         finally
         {
@@ -222,8 +232,12 @@ public class BasicRemoteCacheClientServe
         SleepUtil.sleepAtLeast( 500 );
 
         // VERIFY
-//        System.out.println( server.getStats() );
-        assertEquals( "Wrong number of puts", numToPut, server.getPutCount() - numPutsPrior
);
-        assertEquals( "Wrong number of puts to listener.", numToPut, listener.putCount );
+        try {
+            assertEquals( "Wrong number of puts", numToPut, server.getPutCount() - numPutsPrior
);
+            assertEquals( "Wrong number of puts to listener.", numToPut, listener.putCount
);
+        } catch (junit.framework.AssertionFailedError e) {
+            System.out.println( server.getStats() );
+            throw e;
+        }
     }
 }



Mime
View raw message