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:
Robert Joseph Evans 2012-05-09 17:06:27 +00:00
parent b1e883132b
commit c853a425a0
2 changed files with 25 additions and 0 deletions

View File

@ -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

View File

@ -322,6 +322,29 @@ public void testConfRpc() throws Exception {
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");