sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1530259 - in /sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection: CacheTest.java WeakValueHashMapTest.java
Date Tue, 08 Oct 2013 13:03:35 GMT
Author: desruisseaux
Date: Tue Oct  8 13:03:34 2013
New Revision: 1530259

URL: http://svn.apache.org/r1530259
Log:
Slight reduction of test execution time.

Modified:
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java?rev=1530259&r1=1530258&r2=1530259&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
[UTF-8] Tue Oct  8 13:03:34 2013
@@ -58,7 +58,8 @@ public final strictfp class CacheTest ex
      */
     @Test
     public void testStrongReferences() {
-        WeakValueHashMapTest.testStrongReferences(new Cache<Integer,Integer>(500, 0,
false));
+        WeakValueHashMapTest.testStrongReferences(
+                new Cache<Integer,Integer>(WeakValueHashMapTest.SAMPLE_SIZE, 0, false));
     }
 
     /**
@@ -72,7 +73,8 @@ public final strictfp class CacheTest ex
     @Test
     @DependsOnMethod("testStrongReferences")
     public void testWeakReferences() throws InterruptedException {
-        WeakValueHashMapTest.testWeakReferences(new Cache<Integer,Integer>(500, 0,
false));
+        WeakValueHashMapTest.testWeakReferences(
+                new Cache<Integer,Integer>(WeakValueHashMapTest.SAMPLE_SIZE, 0, false));
     }
 
     /**
@@ -207,7 +209,7 @@ public final strictfp class CacheTest ex
     @Performance
     @DependsOnMethod("testThreadBlocking")
     public void stress() throws InterruptedException {
-        final int count = 10000;
+        final int count = 5000;
         final Cache<Integer,Integer> cache = new Cache<>();
         final AtomicReference<Throwable> failures = new AtomicReference<>();
         final class WriterThread extends Thread {
@@ -309,7 +311,8 @@ public final strictfp class CacheTest ex
          */
         final Statistics afterGC = validateStressEntries("After GC", cache);
         out.println("Statistics on the keys before and after garbage collection.");
-        out.println("The minimum value should be greater after GC.");
+        out.println("The minimum value shall always be equals or greater after GC.");
+        out.println("The mean value is usually greater too, except by coincidence.");
         final StatisticsFormat format = StatisticsFormat.getInstance();
         format.setBorderWidth(1);
         try {

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java?rev=1530259&r1=1530258&r2=1530259&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java
[UTF-8] Tue Oct  8 13:03:34 2013
@@ -44,7 +44,7 @@ public final strictfp class WeakValueHas
     /**
      * The size of the test sets to be created.
      */
-    private static final int SAMPLE_SIZE = 500;
+    static final int SAMPLE_SIZE = 400;
 
     /**
      * Number of time to retry the tests.



Mime
View raw message