jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1183344 - /jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
Date Fri, 14 Oct 2011 13:08:26 GMT
Author: mduerig
Date: Fri Oct 14 13:08:25 2011
New Revision: 1183344

URL: http://svn.apache.org/viewvc?rev=1183344&view=rev
Log:
- avoid division by zero if timer resolution is insufficient

Modified:
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java?rev=1183344&r1=1183343&r2=1183344&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
Fri Oct 14 13:08:25 2011
@@ -59,16 +59,24 @@ public class CreateNodesTraverseTest ext
         count = 0;
         createNodes("test", depth);
         time = System.currentTimeMillis() - time;
-        log("created " + count + " nodes in " + (time / 1000) +
-                " seconds (" + (count * 1000 / time) + " nodes/sec)");
+        if (time == 0) {
+            log("Cannot time execution of test due to insufficient timer resolution");
+        } else {
+            log("created " + count + " nodes in " + (time / 1000) +
+                    " seconds (" + (count * 1000 / time) + " nodes/sec)");
+        }
 
         for (int i = 0; i < 2; i++) {
             start = time = System.currentTimeMillis();
             count = 0;
             traverse("test", depth);
             time = System.currentTimeMillis() - time;
-            log("read " + count + " nodes in " + (time / 1000) +
-                    " seconds (" + (count * 1000 / time) + " nodes/sec)");
+            if (time == 0) {
+                log("Cannot time execution of test due to insufficient timer resolution");
+            } else {
+                log("read " + count + " nodes in " + (time / 1000) +
+                        " seconds (" + (count * 1000 / time) + " nodes/sec)");
+            }
         }
 
     }



Mime
View raw message