From: Olivier Lamy Date: Wed, 29 Feb 2012 16:03:16 +0000 (+0000) Subject: fix an other test failure on windauze X-Git-Tag: archiva-1.4-M3~1178 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c15da51c915b5fa2e1aa61073494ab4c8686011e;p=archiva.git fix an other test failure on windauze Submitted by Eric Barboni . git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295169 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/CachedFailuresPolicyTest.java b/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/CachedFailuresPolicyTest.java index 1c9bfc82a..315264963 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/CachedFailuresPolicyTest.java +++ b/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/CachedFailuresPolicyTest.java @@ -30,6 +30,7 @@ import javax.inject.Inject; import javax.inject.Named; import java.io.File; import java.util.Properties; +import org.springframework.cache.CacheManager; /** * CachedFailuresPolicyTest @@ -81,32 +82,23 @@ public class CachedFailuresPolicyTest } @Test - public void testPolicyYesNotInCache() + public void testPolicyYes() throws Exception { - //CacheManager.getInstance().clearAll(); - DownloadPolicy policy = lookupPolicy(); File localFile = getFile(); Properties request = createRequest(); request.setProperty( "url", "http://a.bad.hostname.maven.org/path/to/resource.txt" ); - policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile ); - } - - @Test - public void testPolicyYesInCache() - throws Exception - { - DownloadPolicy policy = lookupPolicy(); - File localFile = getFile(); - Properties request = createRequest(); - + // should not fail + policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile ); + // status Yes Not In cache + + // Yes in Cache String url = "http://a.bad.hostname.maven.org/path/to/resource.txt"; - - + urlFailureCache.cacheFailure( url ); request.setProperty( "url", url ); @@ -120,5 +112,5 @@ public class CachedFailuresPolicyTest { // expected path. } - } + } }