X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-monitoring%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fmonitoring%2Fxml%2FJaxBSerializerTest.java;h=4b5dcd7d5578941523d0b76eb6f88aa97c353b13;hp=d0d587fb84263c02ef99cb0727de1d4c81b28223;hb=879a57936375ca3dec48c5bf52b0b5988c807bae;hpb=a4bffc377489ceab979de681257c9629c561f4d7
diff --git a/opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/xml/JaxBSerializerTest.java b/opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/xml/JaxBSerializerTest.java
index d0d587fb84..4b5dcd7d55 100644
--- a/opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/xml/JaxBSerializerTest.java
+++ b/opendaylight/netconf/netconf-monitoring/src/test/java/org/opendaylight/controller/netconf/monitoring/xml/JaxBSerializerTest.java
@@ -38,7 +38,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.
public class JaxBSerializerTest {
@Test
- public void testName() throws Exception {
+ public void testSerialization() throws Exception {
final NetconfMonitoringService service = new NetconfMonitoringService() {
@@ -53,29 +53,29 @@ public class JaxBSerializerTest {
}
};
final NetconfState model = new NetconfState(service);
- final String xml = XmlUtil.toString(new JaxBSerializer().toXml(model));
+ final String xml = XmlUtil.toString(new JaxBSerializer().toXml(model)).replaceAll("\\s", "");
assertThat(xml, CoreMatchers.containsString(
- "\n" +
- "yang\n" +
- "id\n" +
- "NETCONF\n" +
- "localhost\n" +
- "v1\n" +
- "\n"));
+ "" +
+ "yang" +
+ "id" +
+ "NETCONF" +
+ "localhost" +
+ "v1" +
+ ""));
assertThat(xml, CoreMatchers.containsString(
- "\n" +
- "1\n" +
- "0\n" +
- "0\n" +
- "loginTime\n" +
- "0\n" +
- "0\n" +
- "client\n" +
- "address/port\n" +
- "ncme:netconf-tcp\n" +
- "username\n" +
+ "" +
+ "1" +
+ "0" +
+ "0" +
+ "2010-10-10T12:32:32Z" +
+ "0" +
+ "0" +
+ "client" +
+ "192.168.1.1" +
+ "ncme:netconf-tcp" +
+ "username" +
""));
}
@@ -96,8 +96,8 @@ public class JaxBSerializerTest {
final Session1 mockedSession1 = mock(Session1.class);
doReturn("client").when(mockedSession1).getSessionIdentifier();
doReturn(1L).when(mocked).getSessionId();
- doReturn(new DateAndTime("loginTime")).when(mocked).getLoginTime();
- doReturn(new Host(new DomainName("address/port"))).when(mocked).getSourceHost();
+ doReturn(new DateAndTime("2010-10-10T12:32:32Z")).when(mocked).getLoginTime();
+ doReturn(new Host(new DomainName("192.168.1.1"))).when(mocked).getSourceHost();
doReturn(new ZeroBasedCounter32(0L)).when(mocked).getInBadRpcs();
doReturn(new ZeroBasedCounter32(0L)).when(mocked).getInRpcs();
doReturn(new ZeroBasedCounter32(0L)).when(mocked).getOutNotifications();