Do not include duplicate models 83/53183/1
authorRobert Varga <rovarga@cisco.com>
Sat, 11 Mar 2017 19:59:58 +0000 (20:59 +0100)
committerRobert Varga <rovarga@cisco.com>
Sat, 11 Mar 2017 20:13:18 +0000 (21:13 +0100)
Adding same module into the CrossSourceStatementReactor guarantees
namespace conflicts, which are flushed out by BUG-7424 handling.

Make sure we do not add same modules multiple times.

Change-Id: I76a300c14392e1de02d8f055100c75a5c66fe61b
Signed-off-by: Robert Varga <rovarga@cisco.com>
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestJsonBodyReader.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestJsonBodyReaderMountPoint.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestJsonBodyWriter.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestXmlBodyReader.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestXmlBodyReaderMountPoint.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestXmlBodyWriter.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/jersey/providers/JsonBodyReaderTest.java
restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/jersey/providers/XmlBodyReaderTest.java

index b3cc32dcaf53c9426f021d611b511df2344b5208..a15cf3e09f3196032331d43d7dc605a22de26488 100644 (file)
@@ -82,7 +82,6 @@ public class TestJsonBodyReader extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws NoSuchFieldException, SecurityException, FileNotFoundException, SourceException, ReactorException {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
index f4f063964d47820e202a288cc3844af976794f47..879445ab3f618ef49067b60ebf0f3ba136cb6e0f 100644 (file)
@@ -81,7 +81,6 @@ public class TestJsonBodyReaderMountPoint extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws Exception {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
 
index d708ef822c96b204f07c92fca1715d27805a65b2..438a16cd5f6337381c9e3246913d66e5f592559c 100644 (file)
@@ -54,7 +54,6 @@ public class TestJsonBodyWriter extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws Exception {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
index 5817257b362cbbdbd7b33c3e09138379ede97786..01cd84bbd297bfa20eed8ffe805c80dd9ef1c98f 100644 (file)
@@ -77,7 +77,6 @@ public class TestXmlBodyReader extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws Exception {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
index bc35c07d966ed63cfd4301c58df45fc2ea7313f4..67ae1a23cb9bdc08eccc4953ddf4b96844352155 100644 (file)
@@ -82,7 +82,6 @@ public class TestXmlBodyReaderMountPoint extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws Exception {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
 
index 3ea5f837b7efbea7d234372efeaa02347c0238e9..ceb4289193296f1fe101fe451e894c3ee078db6a 100644 (file)
@@ -50,7 +50,6 @@ public class TestXmlBodyWriter extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws Exception {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
@@ -67,4 +66,4 @@ public class TestXmlBodyWriter extends AbstractBodyReaderTest {
                 output);
         assertTrue(output.toString().contains("lf-test"));
     }
-}
\ No newline at end of file
+}
index 4fffdb6d8eccd880a1c8c64a8152f478f9c42772..2b691e530163dca9b365bc114401dbf9373992f6 100644 (file)
@@ -71,7 +71,6 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
             throws NoSuchFieldException, SecurityException, FileNotFoundException, SourceException, ReactorException {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
         testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
-        testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
         when(mountPointServiceHandler.get()).thenReturn(mock(DOMMountPointService.class));
@@ -175,4 +174,4 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
         assertEquals(dataNodeIdent, nnContext.getInstanceIdentifierContext().getInstanceIdentifier());
         assertNotNull(NormalizedNodes.findNode(nnContext.getData(), dataNodeIdent));
     }
-}
\ No newline at end of file
+}
index 3cb0e30f02e96c949788f17fb1d34d5649ddb129..375886c2cc47ea5c1d5b0d406cabb8ebe01df855 100644 (file)
@@ -65,7 +65,6 @@ public class XmlBodyReaderTest extends AbstractBodyReaderTest {
     public static void initialization() throws Exception {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
         testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
-        testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
         when(mountPointServiceHandler.get()).thenReturn(mock(DOMMountPointService.class));