You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/11/13 23:27:27 UTC

svn commit: r594673 - in /cocoon/trunk/core/cocoon-core/src: main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java

Author: vgritsenko
Date: Tue Nov 13 14:27:27 2007
New Revision: 594673

URL: http://svn.apache.org/viewvc?rev=594673&view=rev
Log:
apparently 2 seconds (sometimes) is not enough for this test to pass

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java?rev=594673&r1=594672&r2=594673&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java Tue Nov 13 14:27:27 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,13 +25,13 @@
 /**
  * We need to store both the cache expiration and the original source validity
  * the former is to determine whether to recheck the latter (see checkValidity)
- * 
+ *
  * @version $Id$
  */
 public class ExpiresCachingSourceValidityStrategy implements CachingSourceValidityStrategy {
 
-    private Log logger = LogFactory.getLog(getClass());        
-    
+    private Log logger = LogFactory.getLog(getClass());
+
     public SourceValidity[] getCacheValidities(CachingSource cachingSource, Source source) {
         return new SourceValidity[] { 
               new ExpiresValidity(cachingSource.getExpiration()), source.getValidity() };

Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java?rev=594673&r1=594672&r2=594673&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java (original)
+++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java Tue Nov 13 14:27:27 2007
@@ -30,7 +30,9 @@
 import org.apache.excalibur.source.SourceResolver;
 
 /**
- * TODO describe class
+ * CachingSource (cached: protocol) tests
+ *
+ * @version $Id$
  */
 public class CachingSourceTestCase extends SitemapComponentTestCase {
 
@@ -70,7 +72,7 @@
     }
 
     public void testCachingURI() throws Exception {
-        String uri = "cached:http://slashdot.org/?cocoon:cache-expires=2";
+        String uri = "cached:http://slashdot.org/?cocoon:cache-expires=5";
 
         CachingSource source;
 
@@ -93,7 +95,7 @@
         // Source is still cached -- still same meta data
         assertSame(meta1, meta3);
 
-        Thread.sleep(2100);
+        Thread.sleep(5100);
 
         source = (CachingSource) resolver.resolveURI(uri);
         source.refresh();