summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-06-08 13:32:25 +0000
committerOlivier Lamy <olamy@apache.org>2011-06-08 13:32:25 +0000
commit217ae162828cce5f473c4e3b87c985f21c1a3b5b (patch)
tree6e062a88f4d8ac6200ec31d9abbad81889fe4ddd /archiva-modules/archiva-base
parent95dde313897f3258d5b676f8a075872497e5e188 (diff)
downloadarchiva-217ae162828cce5f473c4e3b87c985f21c1a3b5b.tar.gz
archiva-217ae162828cce5f473c4e3b87c985f21c1a3b5b.zip
fix unit test in archiva-proxy cache url failure clear between tests
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1133396 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r--archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java2
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/pom.xml13
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java3
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java2
4 files changed, 19 insertions, 1 deletions
diff --git a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java
index b4cf9c4bf..a26b2348c 100644
--- a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java
+++ b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java
@@ -267,7 +267,7 @@ public class ChecksummedFile
String rawChecksum = FileUtils.readFileToString( checksumFile );
String expectedChecksum = parseChecksum( rawChecksum, checksumAlgorithm, referenceFile.getName() );
- if ( StringUtils.equalsIgnoreCase( expectedChecksum, actualChecksum ) == false )
+ if ( ! StringUtils.equalsIgnoreCase( expectedChecksum, actualChecksum ) )
{
// create checksum (again)
FileUtils.writeStringToFile( checksumFile, actualChecksum + " " + referenceFile.getName() );
diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml
index f1715cdd5..8275c40aa 100644
--- a/archiva-modules/archiva-base/archiva-proxy/pom.xml
+++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml
@@ -111,4 +111,17 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <java.io.tmpdir>${project.build.outputDirectory}</java.io.tmpdir>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
index 476a9b4fc..574358476 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
@@ -20,6 +20,7 @@ package org.apache.maven.archiva.proxy;
*/
import junit.framework.TestCase;
+import net.sf.ehcache.CacheManager;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
@@ -201,6 +202,8 @@ public abstract class AbstractProxyTestCase
delegate.setDelegate( wagonMock );
+ CacheManager.getInstance().clearAll();
+
log.info( "\n.\\ " + getName() + "() \\._________________________________________\n" );
}
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java
index 92068ad4b..2f2bca3db 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java
@@ -20,6 +20,7 @@ package org.apache.maven.archiva.proxy;
*/
import junit.framework.TestCase;
+import net.sf.ehcache.CacheManager;
import org.apache.commons.io.FileUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
@@ -158,6 +159,7 @@ public class HttpProxyTransferTest
config.getConfiguration().addRemoteRepository( repoConfig );
+ CacheManager.getInstance().clearAll();
}