summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskygo <skygo@unknown>2012-08-06 22:17:09 +0000
committerskygo <skygo@unknown>2012-08-06 22:17:09 +0000
commitcec029944437f35795b652e364fa9a9334e4c9ef (patch)
treedc88869f5590594a8729f71fc369576ebd5225c6
parent1d466860155decab852ec06e57973dede5f3f055 (diff)
downloadarchiva-cec029944437f35795b652e364fa9a9334e4c9ef.tar.gz
archiva-cec029944437f35795b652e364fa9a9334e4c9ef.zip
testPolicyYes rerunnable +@Override in test classes
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1370044 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/CachedFailuresPolicyTest.java21
-rw-r--r--archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/ReleasePolicyTest.java1
2 files changed, 8 insertions, 14 deletions
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 4cae2df12..6f46b6845 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
@@ -81,7 +81,7 @@ public class CachedFailuresPolicyTest
policy.applyPolicy( CachedFailuresPolicy.NO, request, localFile );
}
- @Test
+ @Test( expected = PolicyViolationException.class )
public void testPolicyYes()
throws Exception
{
@@ -89,28 +89,21 @@ public class CachedFailuresPolicyTest
DownloadPolicy policy = lookupPolicy();
File localFile = getFile();
Properties request = createRequest();
-
- request.setProperty( "url", "http://a.bad.hostname.maven.org/path/to/resource.txt" );
+ // make unique name
+ String url = "http://a.bad.hostname.maven.org/path/to/resource"+ System.currentTimeMillis() +".txt";
+
+ request.setProperty( "url", url );
// 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 );
- try
- {
- policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile );
- fail( "Expected a PolicyViolationException." );
- }
- catch ( PolicyViolationException e )
- {
- // expected path.
- }
+ policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile );
}
}
diff --git a/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/ReleasePolicyTest.java b/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/ReleasePolicyTest.java
index f2babbb77..2a02605d0 100644
--- a/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/ReleasePolicyTest.java
+++ b/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/archiva/policies/ReleasePolicyTest.java
@@ -368,6 +368,7 @@ public class ReleasePolicyTest
@Before
+ @Override
public void setUp()
throws Exception
{