]> source.dussan.org Git - archiva.git/commitdiff
fix unit test in archiva-proxy cache url failure clear between tests
authorOlivier Lamy <olamy@apache.org>
Wed, 8 Jun 2011 13:32:25 +0000 (13:32 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 8 Jun 2011 13:32:25 +0000 (13:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1133396 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java
archiva-modules/archiva-base/archiva-proxy/pom.xml
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java

index b4cf9c4bfeb8d2288c9ec4766fd2f7b2b1787f4e..a26b2348c815ef49bd727aa917e65164f8a614b0 100644 (file)
@@ -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() );
index f1715cdd50bd1021fd56696b4dbaea9a032121fd..8275c40aa5d1f6a4c441eb919507d20e0248f063 100644 (file)
       <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>
index 476a9b4fc55d04d0ab8222fd176d806167ad9191..574358476fd79fa1d392aa6a19cc579476ce621e 100644 (file)
@@ -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" );
     }
 
index 92068ad4b822d45cbe902f9df64a037aabf1a963..2f2bca3dbc7d0e98abc41bf421face8c745cecad 100644 (file)
@@ -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();
 
     }