commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r780535 - /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Date Mon, 01 Jun 2009 00:10:15 GMT
Author: psteitz
Date: Mon Jun  1 00:10:15 2009
New Revision: 780535

URL: http://svn.apache.org/viewvc?rev=780535&view=rev
Log:
Added more info to failure error message.

Modified:
    commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java?rev=780535&r1=780534&r2=780535&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Mon Jun  1 00:10:15 2009
@@ -934,19 +934,25 @@
                 for (int k = 0; k < zeroLength; k++) {
                     tracker = (VisitTracker) pool.borrowObject(zero); 
                     visitCount = tracker.getValidateCount();                  
-                    assertTrue(formatSettings("lifo",lifo,"i",i,"j",j,"k",k,"visitCount",visitCount,"cycleCount",cycleCount,"totalInstances",totalInstances,"zeroLength",zeroLength),
+                    assertTrue(formatSettings("runs", runs, "lifo", lifo, "i", i, "j", j,
+                            "k", k, "visitCount", visitCount, "cycleCount", cycleCount,
+                            "totalInstances", totalInstances, "zeroLength", zeroLength),
                             visitCount >= cycleCount && visitCount <= cycleCount
+ 1);
                 }
                 for (int k = 0; k < oneLength; k++) {
                     tracker = (VisitTracker) pool.borrowObject(one); 
                     visitCount = tracker.getValidateCount();
-                    assertTrue(formatSettings("lifo",lifo,"i",i,"j",j,"k",k,"visitCount",visitCount,"cycleCount",cycleCount,"totalInstances",totalInstances,"oneLength",oneLength),
+                    assertTrue(formatSettings("runs", runs, "lifo", lifo, "i", i, "j", j,
+                            "k", k, "visitCount", visitCount, "cycleCount", cycleCount,
+                            "totalInstances", totalInstances, "oneLength", oneLength),
                             visitCount >= cycleCount && visitCount <= cycleCount
+ 1);
                 }
                 for (int k = 0; k < twoLength; k++) {
                     tracker = (VisitTracker) pool.borrowObject(two); 
                     visitCount = tracker.getValidateCount();
-                    assertTrue(formatSettings("lifo",lifo,"i",i,"j",j,"k",k,"visitCount",visitCount,"cycleCount",cycleCount,"totalInstances",totalInstances,"twoLength",twoLength),
+                    assertTrue(formatSettings("runs", runs, "lifo", lifo, "i", i, "j", j,
+                            "k", k, "visitCount", visitCount, "cycleCount", cycleCount,
+                            "totalInstances", totalInstances, "twoLength", twoLength),
                             visitCount >= cycleCount && visitCount <= cycleCount
+ 1);
                 }
             }
@@ -1478,9 +1484,10 @@
         return sw.toString();
     }
     
-    private String formatSettings(String s0, boolean b0, String s1, int i1, String s2, int
i2, String s3, int i3,
+    private String formatSettings(String s, int i, String s0, boolean b0, String s1, int
i1, String s2, int i2, String s3, int i3,
             String s4, int i4, String s5, int i5, String s6, int i6, String s7, int i7){
         StringBuffer sb = new StringBuffer();
+        sb.append(s).append('=').append(i).append(' ');
         sb.append(s0).append('=').append(b0).append(' ');
         sb.append(s1).append('=').append(i1).append(' ');
         sb.append(s2).append('=').append(i2).append(' ');



Mime
View raw message