1 package org.opendaylight.controller.netconf.impl;
3 import io.netty.channel.local.LocalAddress;
4 import org.apache.sshd.common.SshdSocketAddress;
7 import java.net.InetSocketAddress;
9 import static org.junit.Assert.assertEquals;
10 import static org.junit.Assert.assertNotNull;
12 public class NetconfServerSessionNegotiatorTest {
15 public void testGetInetSocketAddress() throws Exception {
17 InetSocketAddress socketAddress = new InetSocketAddress(10);
19 assertNotNull(NetconfServerSessionNegotiator.getHostName(socketAddress));
21 assertEquals(socketAddress.getHostName(),
22 NetconfServerSessionNegotiator.getHostName(socketAddress)
25 socketAddress = new InetSocketAddress("TestPortInet", 20);
27 assertEquals(socketAddress.getHostName(),
28 NetconfServerSessionNegotiator.getHostName(socketAddress)
31 assertEquals(String.valueOf(socketAddress.getPort()),
32 NetconfServerSessionNegotiator.getHostName(socketAddress)
35 LocalAddress localAddress = new LocalAddress("TestPortLocal");
37 assertEquals(String.valueOf(localAddress.id()),
38 NetconfServerSessionNegotiator.getHostName(localAddress)
41 SshdSocketAddress embeddedAddress = new SshdSocketAddress(