Do not include duplicate models 70/55970/1
authorRobert Varga <rovarga@cisco.com>
Sat, 11 Mar 2017 19:59:58 +0000 (20:59 +0100)
committerIgor Foltin <ifoltin@cisco.com>
Tue, 25 Apr 2017 10:13:35 +0000 (12:13 +0200)
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 a12dcf014fa55a95f0eff28a99f44cb78835fe64..b5218a0ddd91e9c5d38095f48f355d2b83df6bb4 100644 (file)
@@ -81,7 +81,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 = TestRestconfUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
index 604df056f74f728d56b90e08377ced2527b1277a..757f6f8ab521275c64670a99687fab9e61942426 100644 (file)
@@ -80,7 +80,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 = TestRestconfUtils.parseYangSources(testFiles);
 
index 37d56bfbf1b2f2c6363f79ee25d986f3aea905e2..b3280bc90ca7730866c46d93a3c6f3ba5bc59344 100644 (file)
@@ -55,7 +55,6 @@ public class TestJsonBodyWriter extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws Exception {
         Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = TestRestconfUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
index e14246434c06db91f3d6e4d510f478e042762e7a..a67f1eda572ebc6be17d7df57f4a1eb3234250cc 100644 (file)
@@ -76,7 +76,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 = TestRestconfUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
index 2bb8ece0e10fa8651e1ae52ec66dd4c38c9015f0..2a82f5d4e83e84e1b651b6ab12e1f8bc1d5ad005 100644 (file)
@@ -81,7 +81,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 = TestRestconfUtils.parseYangSources(testFiles);
 
index 67e6b6ddf2af02d5274fafc99616af038b1daa24..67ec6a795b02dff7444ed6747dcffa756f4e7f6d 100644 (file)
@@ -51,7 +51,6 @@ public class TestXmlBodyWriter extends AbstractBodyReaderTest {
     @BeforeClass
     public static void initialization() throws Exception {
         Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
-        testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = TestRestconfUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
@@ -68,4 +67,4 @@ public class TestXmlBodyWriter extends AbstractBodyReaderTest {
                 output);
         assertTrue(output.toString().contains("lf-test"));
     }
-}
\ No newline at end of file
+}
index 80b147be607d3d7ce96ac45809e8d871ec76b00e..0eb21520f42e14cb6e71715de16dc43b695f9923 100644 (file)
@@ -70,7 +70,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 = TestRestconfUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
         when(mountPointServiceHandler.get()).thenReturn(mock(DOMMountPointService.class));
@@ -174,4 +173,4 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
         assertEquals(dataNodeIdent, nnContext.getInstanceIdentifierContext().getInstanceIdentifier());
         assertNotNull(NormalizedNodes.findNode(nnContext.getData(), dataNodeIdent));
     }
-}
\ No newline at end of file
+}
index e1cbb96e5a17d5bff0786d30bdeb65add678e1ae..8eba0627b758dbf7aad0b34de2e4c521304f4fb1 100644 (file)
@@ -64,7 +64,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 = TestRestconfUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
         when(mountPointServiceHandler.get()).thenReturn(mock(DOMMountPointService.class));