Author: coheigea
Date: Wed Mar 21 15:09:31 2012
New Revision: 1303427

URL: http://svn.apache.org/viewvc?rev=1303427&view=rev
Log:
Switching to forkmode "once" for the STS core tests
 - This can give a dramatic speedup if you are running the tests without 
generating entropy by moving the mouse etc., as forking per test involves 
re-seeding SecureRandom for each test

Modified:
    cxf/branches/2.5.x-fixes/services/sts/sts-core/pom.xml
    
cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java

Modified: cxf/branches/2.5.x-fixes/services/sts/sts-core/pom.xml
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/services/sts/sts-core/pom.xml?rev=1303427&r1=1303426&r2=1303427&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/services/sts/sts-core/pom.xml (original)
+++ cxf/branches/2.5.x-fixes/services/sts/sts-core/pom.xml Wed Mar 21 15:09:31 
2012
@@ -31,7 +31,7 @@
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
     <properties>
-        <cxf.surefire.fork.mode>pertest</cxf.surefire.fork.mode>
+        <cxf.surefire.fork.mode>once</cxf.surefire.fork.mode>
     </properties>
 
     <dependencies>

Modified: 
cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java?rev=1303427&r1=1303426&r2=1303427&view=diff
==============================================================================
--- 
cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java
 (original)
+++ 
cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java
 Wed Mar 21 15:09:31 2012
@@ -37,8 +37,13 @@ public class DefaultInMemoryTokenStore i
     private boolean autoRemove = true;
     
     public DefaultInMemoryTokenStore() {
-        cache = new Cache("STS", 5000, false, false, 3600, 3600);
-        cacheManager.addCache(cache);
+        String key = "STS";
+        if (!cacheManager.cacheExists(key)) {
+            cache = new Cache(key, 5000, false, false, 3600, 3600);
+            cacheManager.addCache(cache);
+        } else {
+            cache = cacheManager.getCache(key);
+        }
     }
     
     public void add(SecurityToken token) {


Reply via email to