]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1638] Improve unit test for archiva build
authorOlivier Lamy <olamy@apache.org>
Thu, 5 Jul 2012 11:44:32 +0000 (11:44 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 5 Jul 2012 11:44:32 +0000 (11:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1357562 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java
archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java

index 40f95a56b8d079de2cabe521d77a6f3d92c87c08..f763cd9525f072477e14101cf47fa46718d301f6 100644 (file)
@@ -23,15 +23,19 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import junit.framework.TestCase;
+import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 /**
  * ChecksumTest
  *
  * @version $Id$
  */
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
 public class ChecksumTest
-    extends AbstractChecksumTestCase
+    extends TestCase
 {
     private static final String UNSET_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
 
index e4122d93ae13d29c8a2d72c555ee8c8c6b6c1832..d452e12395f8282bc21d940c9cb602d76327b9d3 100644 (file)
@@ -21,9 +21,12 @@ package org.apache.archiva.checksum;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
+import org.junit.Before;
 import org.junit.Test;
 
 /**
@@ -42,6 +45,18 @@ public class ChecksummedFileTest
     
     private static final String REMOTE_METADATA_MD5 = "d41d8cd98f00b204e9800998ecf8427e";
 
+    
+    @Before
+    public void cleanTestDir() 
+    {
+        try 
+        {
+            FileUtils.deleteDirectory(getTestOutputDir());
+        } catch (IOException ex) {
+            Logger.getLogger(ChecksummedFileTest.class.getName()).log(Level.SEVERE, null, ex);
+        }
+    }
+    
     private File createTestableJar( String filename )
         throws IOException 
     {