HADOOP-8373. Port RPC.getServerAddress to 0.23 (Daryn Sharp via bobby)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1336299 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b1e883132b
commit
c853a425a0
|
@ -550,6 +550,8 @@ Release 0.23.3 - UNRELEASED
|
|||
|
||||
HADOOP-8341. Fix or filter findbugs issues in hadoop-tools (bobby)
|
||||
|
||||
HADOOP-8373. Port RPC.getServerAddress to 0.23 (Daryn Sharp via bobby)
|
||||
|
||||
Release 0.23.2 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -322,6 +322,29 @@ public class TestRPC {
|
|||
server.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProxyAddress() throws Exception {
|
||||
Server server = RPC.getServer(TestProtocol.class,
|
||||
new TestImpl(), ADDRESS, 0, conf);
|
||||
TestProtocol proxy = null;
|
||||
|
||||
try {
|
||||
server.start();
|
||||
InetSocketAddress addr = NetUtils.getConnectAddress(server);
|
||||
|
||||
// create a client
|
||||
proxy = (TestProtocol)RPC.getProxy(
|
||||
TestProtocol.class, TestProtocol.versionID, addr, conf);
|
||||
|
||||
assertEquals(addr, RPC.getServerAddress(proxy));
|
||||
} finally {
|
||||
server.stop();
|
||||
if (proxy != null) {
|
||||
RPC.stopProxy(proxy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSlowRpc() throws Exception {
|
||||
System.out.println("Testing Slow RPC");
|
||||
|
|
Loading…
Reference in New Issue