import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.config.util.xml.XmlUtil;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
+import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
import org.opendaylight.netconf.nettyutil.handler.NetconfEXICodec;
import org.opendaylight.netconf.nettyutil.handler.NetconfEXIToMessageDecoder;
final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
tcpSession.sessionUp();
final Session managementSession = tcpSession.toManagementSession();
- Assert.assertEquals(new String(managementSession.getSourceHost().getValue()), HOST);
+ Assert.assertEquals(HOST, managementSession.getSourceHost().getIpAddress().getIpv4Address().getValue());
Assert.assertEquals(managementSession.getUsername(), USER);
Assert.assertEquals(managementSession.getSessionId().toString(), SESSION_ID);
Assert.assertEquals(managementSession.getTransport(), NetconfTcp.class);
final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
tcpSession.sessionUp();
tcpSession.toManagementSession();
+ tcpSession.close();
}
@Test
final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
tcpSession.sessionUp();
final Session managementSession = tcpSession.toManagementSession();
- Assert.assertEquals(new String(managementSession.getSourceHost().getValue()), "::1");
+ Assert.assertEquals("::1", managementSession.getSourceHost().getIpAddress().getIpv6Address().getValue());
Assert.assertEquals(managementSession.getUsername(), USER);
Assert.assertEquals(managementSession.getSessionId().toString(), SESSION_ID);
Assert.assertEquals(managementSession.getTransport(), NetconfSsh.class);