Do not rely on union char[] values
[netconf.git] / netconf / netconf-impl / src / test / java / org / opendaylight / netconf / impl / NetconfServerSessionTest.java
index 6e4408643680c39c21ef1a3c224aaa19ae8ba856..6e3dc9e153d64c7079ab336aa4c6d2911223a766 100644 (file)
@@ -138,7 +138,7 @@ public class NetconfServerSessionTest {
         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);
@@ -152,6 +152,7 @@ public class NetconfServerSessionTest {
         final NetconfServerSession tcpSession = new NetconfServerSession(listener, ch, 1L, header);
         tcpSession.sessionUp();
         tcpSession.toManagementSession();
+        tcpSession.close();
     }
 
     @Test
@@ -162,7 +163,7 @@ public class NetconfServerSessionTest {
         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);