X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Fnetconf%2FNetconfToNotificationTest.java;h=96c478f0977c2c963ef14c497bd3e64f9c9a0102;hp=294efadc6f9506cb32bdaa7e8404b33c6a034e89;hb=e433e0aa67cc6d144cd3d8d6117de864eb7ebf97;hpb=5273304e9f607a15c1c17aca1c05d7aac2c0260e diff --git a/opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfToNotificationTest.java b/opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfToNotificationTest.java index 294efadc6f..96c478f097 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfToNotificationTest.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/test/java/org/opendaylight/controller/sal/connect/netconf/NetconfToNotificationTest.java @@ -6,13 +6,17 @@ import static org.junit.Assert.assertTrue; import com.google.common.collect.Iterables; import java.io.InputStream; +import java.text.SimpleDateFormat; import java.util.Collections; import java.util.List; import java.util.Set; import javax.xml.parsers.DocumentBuilderFactory; import org.junit.Before; import org.junit.Test; +import org.opendaylight.controller.md.sal.dom.api.DOMEvent; +import org.opendaylight.controller.md.sal.dom.api.DOMNotification; import org.opendaylight.controller.netconf.api.NetconfMessage; +import org.opendaylight.controller.netconf.notifications.NetconfNotification; import org.opendaylight.controller.netconf.util.xml.XmlUtil; import org.opendaylight.controller.sal.connect.netconf.schema.mapping.NetconfMessageTransformer; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -60,9 +64,12 @@ public class NetconfToNotificationTest { @Test public void test() throws Exception { - final ContainerNode root = messageTransformer.toNotification(userNotification); + final DOMNotification domNotification = messageTransformer.toNotification(userNotification); + final ContainerNode root = domNotification.getBody(); assertNotNull(root); assertEquals(6, Iterables.size(root.getValue())); assertEquals("user-visited-page", root.getNodeType().getLocalName()); + assertEquals(new SimpleDateFormat(NetconfNotification.RFC3339_DATE_FORMAT_BLUEPRINT).parse("2007-07-08T00:01:00Z"), + ((DOMEvent) domNotification).getEventTime()); } }