|
@@ -19,6 +19,7 @@ package org.apache.hadoop.net;
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
+import java.io.EOFException;
|
|
|
import java.io.IOException;
|
|
|
import java.net.BindException;
|
|
|
import java.net.ConnectException;
|
|
@@ -256,6 +257,17 @@ public class TestNetUtils {
|
|
|
assertInException(wrapped, "/UnknownHost");
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testWrapEOFException() throws Throwable {
|
|
|
+ IOException e = new EOFException("eof");
|
|
|
+ IOException wrapped = verifyExceptionClass(e, EOFException.class);
|
|
|
+ assertInException(wrapped, "eof");
|
|
|
+ assertWikified(wrapped);
|
|
|
+ assertInException(wrapped, "localhost");
|
|
|
+ assertRemoteDetailsIncluded(wrapped);
|
|
|
+ assertInException(wrapped, "/EOFException");
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testGetConnectAddress() throws IOException {
|
|
|
NetUtils.addStaticResolution("host", "127.0.0.1");
|