|
@@ -25,9 +25,12 @@ import org.apache.hadoop.service.Service.STATE;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.server.webproxy.WebAppProxyServer;
|
|
import org.apache.hadoop.yarn.server.webproxy.WebAppProxyServer;
|
|
import org.junit.After;
|
|
import org.junit.After;
|
|
|
|
+import org.junit.Assert;
|
|
import org.junit.Before;
|
|
import org.junit.Before;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
+import java.net.InetSocketAddress;
|
|
|
|
+
|
|
public class TestWebAppProxyServer {
|
|
public class TestWebAppProxyServer {
|
|
private WebAppProxyServer webAppProxy = null;
|
|
private WebAppProxyServer webAppProxy = null;
|
|
private final String proxyAddress = "0.0.0.0:8888";
|
|
private final String proxyAddress = "0.0.0.0:8888";
|
|
@@ -56,4 +59,14 @@ public class TestWebAppProxyServer {
|
|
}
|
|
}
|
|
assertEquals(STATE.STARTED, webAppProxy.getServiceState());
|
|
assertEquals(STATE.STARTED, webAppProxy.getServiceState());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void testBindAddress() {
|
|
|
|
+ YarnConfiguration conf = new YarnConfiguration();
|
|
|
|
+
|
|
|
|
+ InetSocketAddress defaultBindAddress = WebAppProxyServer.getBindAddress(conf);
|
|
|
|
+ Assert.assertEquals("Web Proxy default bind address port is incorrect",
|
|
|
|
+ YarnConfiguration.DEFAULT_PROXY_PORT,
|
|
|
|
+ defaultBindAddress.getPort());
|
|
|
|
+ }
|
|
}
|
|
}
|