diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShell.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShell.java index 162a9421d32..da931965740 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShell.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShell.java @@ -17,7 +17,6 @@ */ package org.apache.hadoop.fs; -import junit.framework.AssertionFailedError; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.shell.Command; import org.apache.hadoop.fs.shell.CommandFactory; @@ -45,7 +44,7 @@ public class TestFsShell { } if (!(th instanceof RuntimeException)) { - throw new AssertionFailedError("Expected Runtime exception, got: " + th) + throw new AssertionError("Expected Runtime exception, got: " + th) .initCause(th); } } diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java index e59ac779828..1375d9b0b9a 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestNetUtils.java @@ -37,8 +37,6 @@ import java.util.Enumeration; import java.util.List; import java.util.concurrent.TimeUnit; -import junit.framework.AssertionFailedError; - import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -328,7 +326,7 @@ public class TestNetUtils { private void assertInException(Exception e, String text) throws Throwable { String message = extractExceptionMessage(e); if (!(message.contains(text))) { - throw new AssertionFailedError("Wrong text in message " + throw new AssertionError("Wrong text in message " + "\"" + message + "\"" + " expected \"" + text + "\"") .initCause(e); @@ -339,7 +337,7 @@ public class TestNetUtils { assertNotNull("Null Exception", e); String message = e.getMessage(); if (message == null) { - throw new AssertionFailedError("Empty text in exception " + e) + throw new AssertionError("Empty text in exception " + e) .initCause(e); } return message; @@ -349,7 +347,7 @@ public class TestNetUtils { throws Throwable{ String message = extractExceptionMessage(e); if (message.contains(text)) { - throw new AssertionFailedError("Wrong text in message " + throw new AssertionError("Wrong text in message " + "\"" + message + "\"" + " did not expect \"" + text + "\"") .initCause(e); @@ -364,7 +362,7 @@ public class TestNetUtils { "localhost", LOCAL_PORT, e); LOG.info(wrapped.toString(), wrapped); if(!(wrapped.getClass().equals(expectedClass))) { - throw new AssertionFailedError("Wrong exception class; expected " + throw new AssertionError("Wrong exception class; expected " + expectedClass + " got " + wrapped.getClass() + ": " + wrapped).initCause(wrapped); } diff --git a/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftFileSystemContract.java b/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftFileSystemContract.java index 46a5f0f637e..76716b2e503 100644 --- a/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftFileSystemContract.java +++ b/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftFileSystemContract.java @@ -18,7 +18,6 @@ package org.apache.hadoop.fs.swift; -import junit.framework.AssertionFailedError; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -119,7 +118,7 @@ public class TestSwiftFileSystemContract public void testWriteReadAndDeleteEmptyFile() throws Exception { try { super.testWriteReadAndDeleteEmptyFile(); - } catch (AssertionFailedError e) { + } catch (AssertionError e) { SwiftTestUtils.downgrade("empty files get mistaken for directories", e); } }