|
@@ -37,8 +37,6 @@ import java.util.Enumeration;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
-import junit.framework.AssertionFailedError;
|
|
|
|
-
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
@@ -328,7 +326,7 @@ public class TestNetUtils {
|
|
private void assertInException(Exception e, String text) throws Throwable {
|
|
private void assertInException(Exception e, String text) throws Throwable {
|
|
String message = extractExceptionMessage(e);
|
|
String message = extractExceptionMessage(e);
|
|
if (!(message.contains(text))) {
|
|
if (!(message.contains(text))) {
|
|
- throw new AssertionFailedError("Wrong text in message "
|
|
|
|
|
|
+ throw new AssertionError("Wrong text in message "
|
|
+ "\"" + message + "\""
|
|
+ "\"" + message + "\""
|
|
+ " expected \"" + text + "\"")
|
|
+ " expected \"" + text + "\"")
|
|
.initCause(e);
|
|
.initCause(e);
|
|
@@ -339,7 +337,7 @@ public class TestNetUtils {
|
|
assertNotNull("Null Exception", e);
|
|
assertNotNull("Null Exception", e);
|
|
String message = e.getMessage();
|
|
String message = e.getMessage();
|
|
if (message == null) {
|
|
if (message == null) {
|
|
- throw new AssertionFailedError("Empty text in exception " + e)
|
|
|
|
|
|
+ throw new AssertionError("Empty text in exception " + e)
|
|
.initCause(e);
|
|
.initCause(e);
|
|
}
|
|
}
|
|
return message;
|
|
return message;
|
|
@@ -349,7 +347,7 @@ public class TestNetUtils {
|
|
throws Throwable{
|
|
throws Throwable{
|
|
String message = extractExceptionMessage(e);
|
|
String message = extractExceptionMessage(e);
|
|
if (message.contains(text)) {
|
|
if (message.contains(text)) {
|
|
- throw new AssertionFailedError("Wrong text in message "
|
|
|
|
|
|
+ throw new AssertionError("Wrong text in message "
|
|
+ "\"" + message + "\""
|
|
+ "\"" + message + "\""
|
|
+ " did not expect \"" + text + "\"")
|
|
+ " did not expect \"" + text + "\"")
|
|
.initCause(e);
|
|
.initCause(e);
|
|
@@ -364,7 +362,7 @@ public class TestNetUtils {
|
|
"localhost", LOCAL_PORT, e);
|
|
"localhost", LOCAL_PORT, e);
|
|
LOG.info(wrapped.toString(), wrapped);
|
|
LOG.info(wrapped.toString(), wrapped);
|
|
if(!(wrapped.getClass().equals(expectedClass))) {
|
|
if(!(wrapped.getClass().equals(expectedClass))) {
|
|
- throw new AssertionFailedError("Wrong exception class; expected "
|
|
|
|
|
|
+ throw new AssertionError("Wrong exception class; expected "
|
|
+ expectedClass
|
|
+ expectedClass
|
|
+ " got " + wrapped.getClass() + ": " + wrapped).initCause(wrapped);
|
|
+ " got " + wrapped.getClass() + ": " + wrapped).initCause(wrapped);
|
|
}
|
|
}
|