X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2FNetconfMappingTest.java;h=28849d0033d5c93a0bd98e6ee9d61cb8a00f5845;hp=e41b174b664740c685faa041d64c208630bf21c2;hb=4b4a46cfd4b18fd2efc71488ff2161f4d47af358;hpb=8a60e7caa7a442c67e69ff9a42c438f80e41f107 diff --git a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java index e41b174b66..28849d0033 100644 --- a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java +++ b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java @@ -55,10 +55,10 @@ import org.custommonkey.xmlunit.NodeTestException; import org.custommonkey.xmlunit.NodeTester; import org.custommonkey.xmlunit.XMLAssert; import org.custommonkey.xmlunit.XMLUnit; +import org.hamcrest.CoreMatchers; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; -import org.junit.matchers.JUnitMatchers; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.opendaylight.controller.config.api.ConflictingVersionException; @@ -569,7 +569,7 @@ public class NetconfMappingTest extends AbstractConfigTest { } private void assertContainsString(String string, String substring) { - assertThat(string, JUnitMatchers.containsString(substring)); + assertThat(string, CoreMatchers.containsString(substring)); } private void checkEnum(final Document response) throws Exception { @@ -662,7 +662,7 @@ public class NetconfMappingTest extends AbstractConfigTest { assertEquals(8 * 4, getElementsSize(response, "inner-inner-running-data")); assertEquals(8 * 4, getElementsSize(response, "deep3")); assertEquals(8 * 4 * 2, getElementsSize(response, "list-of-strings")); - assertEquals(8, getElementsSize(response, "inner-running-data-additional")); + assertEquals(8, getElementsSize(response, "inner-running-data-additional", "urn:opendaylight:params:xml:ns:yang:controller:test:impl")); assertEquals(8, getElementsSize(response, "deep4")); // TODO assert keys @@ -693,6 +693,10 @@ public class NetconfMappingTest extends AbstractConfigTest { return response.getElementsByTagName(elementName).getLength(); } + private int getElementsSize(Document response, String elementName, String namespace) { + return response.getElementsByTagNameNS(namespace, elementName).getLength(); + } + private Document executeOp(final NetconfOperation op, final String filename) throws ParserConfigurationException, SAXException, IOException, NetconfDocumentedException {