From 66077dc368b9053a2b23dc98261bdc7074f04c8b Mon Sep 17 00:00:00 2001 From: Eric Barboni Date: Tue, 11 Feb 2020 20:38:48 +0100 Subject: [PATCH] Test fix to make test specific path, minor fix, import fix --- .../org/apache/archiva/checksum/Checksum.java | 9 +--- .../archiva/checksum/ChecksumAlgorithm.java | 3 -- .../apache/archiva/checksum/ChecksumUtil.java | 1 - .../archiva/checksum/ChecksummedFile.java | 4 +- .../checksum/AbstractChecksumTestCase.java | 13 +++-- .../checksum/ChecksumAlgorithmTest.java | 14 +++-- .../apache/archiva/checksum/ChecksumTest.java | 20 +++---- .../archiva/checksum/ChecksummedFileTest.java | 53 ++++++++++--------- 8 files changed, 55 insertions(+), 62 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java index 2a198877e..d32e5fb5e 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java @@ -19,12 +19,7 @@ package org.apache.archiva.checksum; * under the License. */ -import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.MappedByteBuffer; -import java.nio.channels.FileChannel; -import java.nio.file.Path; -import java.nio.file.StandardOpenOption; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -108,13 +103,13 @@ public class Checksum if (this.result == null || this.result.length==0) { finish(); } - return md.isEqual( this.result, cmp ); + return MessageDigest.isEqual( this.result, cmp ); } public boolean compare(String hexString) { if (this.result == null || this.result.length==0) { finish(); } - return md.isEqual(this.result, Hex.decode( hexString )); + return MessageDigest.isEqual(this.result, Hex.decode( hexString )); } } diff --git a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumAlgorithm.java b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumAlgorithm.java index bf6252dec..99c710004 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumAlgorithm.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumAlgorithm.java @@ -23,11 +23,8 @@ package org.apache.archiva.checksum; import org.apache.commons.io.FilenameUtils; import java.nio.file.Path; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; diff --git a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumUtil.java b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumUtil.java index bb6a710ae..0770ad8dd 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumUtil.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumUtil.java @@ -19,7 +19,6 @@ package org.apache.archiva.checksum; * under the License. */ -import java.io.FileNotFoundException; import java.io.IOException; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; 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 1279bdcd5..0bf0a467d 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 @@ -133,7 +133,7 @@ public class ChecksummedFile { for ( String ext : checksumAlgorithm.getExt( ) ) { - Path file = referenceFile.resolveSibling( referenceFile.getFileName( ) + "." + checksumAlgorithm.getExt( ) ); + Path file = referenceFile.resolveSibling( referenceFile.getFileName( ) + "." + ext ); if ( Files.exists( file ) ) { return file; @@ -340,7 +340,7 @@ public class ChecksummedFile private void writeChecksumFile( Path checksumFile, Charset encoding, String checksumHex ) { - FileUtils.writeStringToFile( checksumFile, FILE_ENCODING, checksumHex + " " + referenceFile.getFileName( ).toString( ) ); + FileUtils.writeStringToFile( checksumFile, encoding, checksumHex + " " + referenceFile.getFileName( ).toString( ) ); } private boolean isValidChecksumPattern( String filename, String path ) diff --git a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/AbstractChecksumTestCase.java b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/AbstractChecksumTestCase.java index f1caab9b1..ada972f14 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/AbstractChecksumTestCase.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/AbstractChecksumTestCase.java @@ -19,7 +19,6 @@ package org.apache.archiva.checksum; * under the License. */ -import junit.framework.TestCase; import org.apache.archiva.common.utils.FileUtils; import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner; import org.junit.runner.RunWith; @@ -28,6 +27,9 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.rules.TestName; /** * AbstractChecksumTestCase @@ -36,11 +38,12 @@ import java.nio.file.Paths; */ @RunWith( ArchivaBlockJUnit4ClassRunner.class ) public abstract class AbstractChecksumTestCase - extends TestCase { + @Rule public TestName name = new TestName(); + public Path getTestOutputDir() { - Path dir = Paths.get( FileUtils.getBasedir(), "target/test-output/" + getName() ); + Path dir = Paths.get( FileUtils.getBasedir(), "target/test-output/" + name.getMethodName() ); if ( !Files.exists(dir)) { try @@ -49,7 +52,7 @@ public abstract class AbstractChecksumTestCase } catch ( IOException e ) { - fail( "Unable to create test output directory: " + dir.toAbsolutePath() ); + Assert.fail( "Unable to create test output directory: " + dir.toAbsolutePath() ); } } return dir; @@ -61,7 +64,7 @@ public abstract class AbstractChecksumTestCase Path file = dir.resolve(filename ); if ( !Files.exists(file)) { - fail( "Test Resource does not exist: " + file.toAbsolutePath() ); + Assert.fail( "Test Resource does not exist: " + file.toAbsolutePath() ); } return file; } diff --git a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumAlgorithmTest.java b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumAlgorithmTest.java index 56fc5ad49..579b24369 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumAlgorithmTest.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumAlgorithmTest.java @@ -19,12 +19,11 @@ package org.apache.archiva.checksum; * under the License. */ -import junit.framework.TestCase; import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner; import org.junit.Test; import org.junit.runner.RunWith; - import java.nio.file.Paths; +import org.junit.Assert; /** * ChecksumAlgorithmTest @@ -33,20 +32,19 @@ import java.nio.file.Paths; */ @RunWith( ArchivaBlockJUnit4ClassRunner.class ) public class ChecksumAlgorithmTest - extends TestCase { @Test public void testGetHashByExtensionSha1() { - assertEquals( ChecksumAlgorithm.SHA1, ChecksumAlgorithm.getByExtension( Paths.get( "something.jar.sha1" ) ) ); - assertEquals( ChecksumAlgorithm.SHA1, ChecksumAlgorithm.getByExtension( Paths.get( "OTHER.JAR.SHA1" ) ) ); + Assert.assertEquals( ChecksumAlgorithm.SHA1, ChecksumAlgorithm.getByExtension( Paths.get( "something.jar.sha1" ) ) ); + Assert.assertEquals( ChecksumAlgorithm.SHA1, ChecksumAlgorithm.getByExtension( Paths.get( "OTHER.JAR.SHA1" ) ) ); } @Test public void testGetHashByExtensionMd5() { - assertEquals( ChecksumAlgorithm.MD5, ChecksumAlgorithm.getByExtension( Paths.get( "something.jar.md5" ) ) ); - assertEquals( ChecksumAlgorithm.MD5, ChecksumAlgorithm.getByExtension( Paths.get( "OTHER.JAR.MD5" ) ) ); + Assert.assertEquals( ChecksumAlgorithm.MD5, ChecksumAlgorithm.getByExtension( Paths.get( "something.jar.md5" ) ) ); + Assert.assertEquals( ChecksumAlgorithm.MD5, ChecksumAlgorithm.getByExtension( Paths.get( "OTHER.JAR.MD5" ) ) ); } @Test @@ -55,7 +53,7 @@ public class ChecksumAlgorithmTest try { ChecksumAlgorithm.getByExtension( Paths.get( "something.jar" ) ); - fail( "Expected " + IllegalArgumentException.class.getName() ); + Assert.fail( "Expected " + IllegalArgumentException.class.getName() ); } catch ( IllegalArgumentException e ) { 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 ca3dab891..79767459c 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,12 +23,12 @@ import org.apache.archiva.common.utils.FileUtils; import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner; import org.junit.Test; import org.junit.runner.RunWith; - import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import org.junit.Assert; /** * ChecksumTest @@ -46,7 +46,7 @@ public class ChecksumTest public void testConstructSha1() { Checksum checksum = new Checksum( ChecksumAlgorithm.SHA1 ); - assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.SHA1 + Assert.assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.SHA1 .getAlgorithm() ); } @@ -54,7 +54,7 @@ public class ChecksumTest public void testConstructMd5() { Checksum checksum = new Checksum( ChecksumAlgorithm.MD5 ); - assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.MD5 + Assert.assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.MD5 .getAlgorithm() ); } @@ -65,7 +65,7 @@ public class ChecksumTest byte buf[] = ( "You know, I'm sick of following my dreams, man. " + "I'm just going to ask where they're going and hook up with 'em later. - Mitch Hedberg" ).getBytes(); checksum.update( buf, 0, buf.length ); - assertEquals( "Checksum", "e396119ae0542e85a74759602fd2f81e5d36d762", checksum.getChecksum() ); + Assert.assertEquals( "Checksum", "e396119ae0542e85a74759602fd2f81e5d36d762", checksum.getChecksum() ); } @Test @@ -84,32 +84,32 @@ public class ChecksumTest ChecksumUtil.update( checksums, checkFile ); - assertEquals( "Checksum SHA1", "e396119ae0542e85a74759602fd2f81e5d36d762", checksumSha1.getChecksum() ); - assertEquals( "Checksum MD5", "21c2c5ca87ec018adacb2e2fb3432219", checksumMd5.getChecksum() ); + Assert.assertEquals( "Checksum SHA1", "e396119ae0542e85a74759602fd2f81e5d36d762", checksumSha1.getChecksum() ); + Assert.assertEquals( "Checksum MD5", "21c2c5ca87ec018adacb2e2fb3432219", checksumMd5.getChecksum() ); } @Test public void testUpdateWholeUpdatePartial() { Checksum checksum = new Checksum( ChecksumAlgorithm.SHA1 ); - assertEquals( "Checksum unset", UNSET_SHA1, checksum.getChecksum() ); + Assert.assertEquals( "Checksum unset", UNSET_SHA1, checksum.getChecksum() ); String expected = "066c2cbbc8cdaecb8ff97dcb84502462d6f575f3"; byte reesepieces[] = "eatagramovabits".getBytes(); checksum.update( reesepieces, 0, reesepieces.length ); String actual = checksum.getChecksum(); - assertEquals( "Expected", expected, actual ); + Assert.assertEquals( "Expected", expected, actual ); // Reset the checksum. checksum.reset(); - assertEquals( "Checksum unset", UNSET_SHA1, checksum.getChecksum() ); + Assert.assertEquals( "Checksum unset", UNSET_SHA1, checksum.getChecksum() ); // Now parse it again in 3 pieces. checksum.update( reesepieces, 0, 5 ); checksum.update( reesepieces, 5, 5 ); checksum.update( reesepieces, 10, reesepieces.length - 10 ); - assertEquals( "Expected", expected, actual ); + Assert.assertEquals( "Expected", expected, actual ); } } 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 fb1ddd3b3..e9f2e433f 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 @@ -24,7 +24,6 @@ import org.apache.commons.lang3.StringUtils; import org.junit.Before; import org.junit.Test; import org.slf4j.LoggerFactory; - import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; @@ -32,6 +31,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.Arrays; +import org.junit.After; +import org.junit.Assert; /** * ChecksummedFileTest @@ -54,7 +55,7 @@ public class ChecksummedFileTest private static final Charset FILE_ENCODING = Charset.forName( "UTF-8" ); - @Before + @After public void cleanTestDir() { try @@ -64,9 +65,9 @@ public class ChecksummedFileTest catch ( IOException ex ) { LoggerFactory.getLogger( ChecksummedFileTest.class ).warn( ex.getMessage(), ex ); - } + } } - + private Path createTestableJar( String filename ) throws IOException { @@ -110,7 +111,7 @@ public class ChecksummedFileTest ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); String expectedChecksum = "f42047fe2e177ac04d0df7aa44d408be"; String actualChecksum = checksummedFile.calculateChecksum( ChecksumAlgorithm.MD5 ); - assertEquals( expectedChecksum, actualChecksum ); + Assert.assertEquals( expectedChecksum, actualChecksum ); } @Test @@ -121,7 +122,7 @@ public class ChecksummedFileTest ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); String expectedChecksum = "2bb14b388973351b0a4dfe11d171965f59cc61a1"; String actualChecksum = checksummedFile.calculateChecksum( ChecksumAlgorithm.SHA1 ); - assertEquals( expectedChecksum, actualChecksum ); + Assert.assertEquals( expectedChecksum, actualChecksum ); } @Test @@ -132,10 +133,10 @@ public class ChecksummedFileTest ChecksummedFile checksummedFile = new ChecksummedFile( testableJar ); checksummedFile.writeFile( ChecksumAlgorithm.SHA1 ); Path hashFile = checksummedFile.getChecksumFile( ChecksumAlgorithm.SHA1 ); - assertTrue( "ChecksumAlgorithm file should exist.", Files.exists(hashFile) ); + Assert.assertTrue( "ChecksumAlgorithm file should exist.", Files.exists(hashFile) ); String hashContents = org.apache.commons.io.FileUtils.readFileToString( hashFile.toFile(), "UTF-8" ); hashContents = StringUtils.trim( hashContents ); - assertEquals( "2bb14b388973351b0a4dfe11d171965f59cc61a1 redback-authz-open.jar", hashContents ); + Assert.assertEquals( "2bb14b388973351b0a4dfe11d171965f59cc61a1 redback-authz-open.jar", hashContents ); } @Test @@ -149,15 +150,15 @@ public class ChecksummedFileTest org.apache.commons.io.FileUtils.writeStringToFile( sha1File.toFile(), "sha1sum: redback-authz-open.jar: No such file or directory", "UTF-8" ); ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); - assertFalse( "ChecksummedFile.isValid(SHA1) == false", + Assert.assertFalse( "ChecksummedFile.isValid(SHA1) == false", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); UpdateStatusList fixed = checksummedFile.fixChecksums( Arrays.asList( ChecksumAlgorithm.SHA1 ) ); - assertEquals(1, fixed.getStatusList().size()); - assertFalse(fixed.getTotalStatus()==UpdateStatus.ERROR); - assertTrue( "ChecksummedFile.fixChecksums() == true", fixed.getStatusList().get(0).getValue()==UpdateStatus.UPDATED ); + Assert.assertEquals(1, fixed.getStatusList().size()); + Assert.assertFalse(fixed.getTotalStatus()==UpdateStatus.ERROR); + Assert.assertTrue( "ChecksummedFile.fixChecksums() == true", fixed.getStatusList().get(0).getValue()==UpdateStatus.UPDATED ); - assertTrue( "ChecksummedFile.isValid(SHA1) == true", + Assert.assertTrue( "ChecksummedFile.isValid(SHA1) == true", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); } @@ -165,7 +166,7 @@ public class ChecksummedFileTest public void testGetChecksumFile() { ChecksummedFile checksummedFile = new ChecksummedFile( Paths.get( "test.jar" ) ); - assertEquals( "test.jar.sha1", checksummedFile.getChecksumFile( ChecksumAlgorithm.SHA1 ).getFileName().toString() ); + Assert.assertEquals( "test.jar.sha1", checksummedFile.getChecksumFile( ChecksumAlgorithm.SHA1 ).getFileName().toString() ); } @Test @@ -175,7 +176,7 @@ public class ChecksummedFileTest Path jarFile = createTestableJar( "examples/redback-authz-open.jar", true, false ); ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); - assertTrue( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); + Assert.assertTrue( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); } @Test @@ -189,7 +190,7 @@ public class ChecksummedFileTest FileUtils.writeStringToFile( sha1File, FILE_ENCODING, "sha1sum: redback-authz-open.jar: No such file or directory" ); ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); - assertFalse( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); + Assert.assertFalse( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); } @@ -200,7 +201,7 @@ public class ChecksummedFileTest Path jarFile = createTestableJar( "examples/redback-authz-open.jar", false, false ); ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); - assertFalse( "ChecksummedFile.isValid(SHA1,MD5)", checksummedFile.isValidChecksums( + Assert.assertFalse( "ChecksummedFile.isValid(SHA1,MD5)", checksummedFile.isValidChecksums( Arrays.asList(ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 ) ) ); } @@ -212,7 +213,7 @@ public class ChecksummedFileTest Path jarFile = createTestableJar( "examples/redback-authz-open.jar", true, true ); ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); - assertTrue( "ChecksummedFile.isValid(SHA1,MD5)", checksummedFile.isValidChecksums( + Assert.assertTrue( "ChecksummedFile.isValid(SHA1,MD5)", checksummedFile.isValidChecksums( Arrays.asList(ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 ) ) ); } @@ -223,7 +224,7 @@ public class ChecksummedFileTest Path jarFile = createTestableJar( "examples/redback-authz-open.jar", true, false ); ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); - assertTrue( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksums( + Assert.assertTrue( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksums( Arrays.asList(ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 ) ) ); } @@ -240,7 +241,7 @@ public class ChecksummedFileTest ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); String s = checksummedFile.parseChecksum( expectedFile, ChecksumAlgorithm.SHA1, "servletapi/servletapi/2.4/servletapi-2.4.pom", FILE_ENCODING); - assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); + Assert.assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); } @@ -254,7 +255,7 @@ public class ChecksummedFileTest ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); String s = checksummedFile.parseChecksum( expectedFile, ChecksumAlgorithm.SHA1, "servletapi/servletapi/2.4/servletapi-2.4.pom", FILE_ENCODING ); - assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); + Assert.assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); } @Test @@ -267,7 +268,7 @@ public class ChecksummedFileTest ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); String s = checksummedFile.parseChecksum( expectedFile, ChecksumAlgorithm.SHA1, "servletapi/servletapi/2.4/servletapi-2.4.pom" , FILE_ENCODING); - assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); + Assert.assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); } @Test @@ -282,12 +283,12 @@ public class ChecksummedFileTest try { String s = checksummedFile.parseChecksum( expectedFile, ChecksumAlgorithm.SHA1, "maven-metadata-remote.xml", FILE_ENCODING ); - assertEquals( "Checksum doesn't match", REMOTE_METADATA_SHA1, s ); + Assert.assertEquals( "Checksum doesn't match", REMOTE_METADATA_SHA1, s ); } catch ( ChecksumValidationException e ) { e.printStackTrace(); - fail( "IOException should not occur." ); + Assert.fail( "IOException should not occur." ); } } @@ -303,12 +304,12 @@ public class ChecksummedFileTest try { String s = checksummedFile.parseChecksum( expectedFile, ChecksumAlgorithm.MD5, "maven-metadata-remote.xml", FILE_ENCODING ); - assertEquals( "Checksum doesn't match", REMOTE_METADATA_MD5, s ); + Assert.assertEquals( "Checksum doesn't match", REMOTE_METADATA_MD5, s ); } catch ( ChecksumValidationException e ) { e.printStackTrace(); - fail( "IOException should not occur." ); + Assert.fail( "IOException should not occur." ); } } } -- 2.39.5