From 2decc24d0e61c89406db32c922f6afac22c07a1e Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 5 Jul 2012 11:44:32 +0000 Subject: [PATCH] [MRM-1638] Improve unit test for archiva build git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1357562 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/archiva/checksum/ChecksumTest.java | 6 +++++- .../archiva/checksum/ChecksummedFileTest.java | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java index 40f95a56b..f763cd952 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java @@ -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"; diff --git a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java index e4122d93a..d452e1239 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java @@ -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 { -- 2.39.5