Rename EffectiveModelContext to ReactorDeclaredModel 80/81380/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 4 Apr 2019 19:24:33 +0000 (21:24 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 4 Apr 2019 19:47:38 +0000 (21:47 +0200)
This renames EffectiveModelContext to vacate the name, with the new
name better reflecting its nature.

Change-Id: I84000e2c19d9bdee6f561fd83f39bb5eb2033bab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/BuildGlobalContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/CrossSourceStatementReactor.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ReactorDeclaredModel.java [moved from yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/EffectiveModelContext.java with 85% similarity]
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/AugmentArgumentParsingTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/AugmentSimplestTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/ImportResolutionBasicTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/ImportRevisionsTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/IncludeResolutionTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/IncludeRevisionsTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/KeyTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YangFileStmtTest.java

index e5c71054db4a9191c9bca8252d2cbbc666866213..f2a25b45757f9d9279a73890d301bcaf9bd80d15 100644 (file)
@@ -222,7 +222,7 @@ class BuildGlobalContext extends NamespaceStorageSupport implements Registry {
         }
     }
 
-    EffectiveModelContext build() throws ReactorException {
+    ReactorDeclaredModel build() throws ReactorException {
         executePhases();
         return transform();
     }
@@ -232,13 +232,13 @@ class BuildGlobalContext extends NamespaceStorageSupport implements Registry {
         return transformEffective();
     }
 
-    private EffectiveModelContext transform() {
+    private ReactorDeclaredModel transform() {
         checkState(finishedPhase == ModelProcessingPhase.EFFECTIVE_MODEL);
         final List<DeclaredStatement<?>> rootStatements = new ArrayList<>(sources.size());
         for (final SourceSpecificContext source : sources) {
             rootStatements.add(source.getRoot().buildDeclared());
         }
-        return new EffectiveModelContext(rootStatements);
+        return new ReactorDeclaredModel(rootStatements);
     }
 
     private SomeModifiersUnresolvedException propagateException(final SourceSpecificContext source,
index 842ed8827924b12973fb20b876a75a96d331347f..dca20a74aa3161e2dc4de49d928bd368e0fbeada 100644 (file)
@@ -189,7 +189,7 @@ public final class CrossSourceStatementReactor {
         /**
          * Build the effective model context.
          */
-        public EffectiveModelContext build() throws ReactorException {
+        public ReactorDeclaredModel build() throws ReactorException {
             return context.build();
         }
 
@@ -12,11 +12,10 @@ import java.util.List;
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
 
-public class EffectiveModelContext implements Immutable {
-
+public class ReactorDeclaredModel implements Immutable {
     private final ImmutableList<DeclaredStatement<?>> rootStatements;
 
-    public EffectiveModelContext(List<DeclaredStatement<?>> rootStatements) {
+    public ReactorDeclaredModel(final List<DeclaredStatement<?>> rootStatements) {
         this.rootStatements = ImmutableList.copyOf(rootStatements);
     }
 
index 6a8444584453756ea504abf284fb65d5ae4ff438..031ccbf69342ba457db6218a38f6b13ce0516083 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertNotNull;
@@ -20,7 +19,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 
 public class AugmentArgumentParsingTest {
 
@@ -43,7 +42,7 @@ public class AugmentArgumentParsingTest {
 
     @Test
     public void validAugAbsTest() throws ReactorException {
-        final EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        final ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(IMPORTED, VALID_ARGS)
                 .build();
         assertNotNull(result);
index 12f379173d3e87bd65c8f566523645c1c7452bab..869da59634ce50ffff4dce51a665223141850bca 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertNotNull;
@@ -16,7 +15,7 @@ import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 
 public class AugmentSimplestTest {
 
@@ -26,7 +25,7 @@ public class AugmentSimplestTest {
 
     @Test
     public void readAndParseYangFileTest() throws SourceException, ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(AUGMENTED, ROOT)
                 .build();
         assertNotNull(result);
index fabd392ffe03af74e2f2ea1ea16d9e105a431cdf..15f093aa06ed6a010b978be569ae61f432a7f8ce 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertEquals;
@@ -22,7 +21,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 
 public class ImportResolutionBasicTest {
 
@@ -46,7 +45,7 @@ public class ImportResolutionBasicTest {
 
     @Test
     public void inImportOrderTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(ROOT_WITHOUT_IMPORT, IMPORT_ROOT, IMPORT_DERIVED)
                 .build();
         assertNotNull(result);
@@ -54,7 +53,7 @@ public class ImportResolutionBasicTest {
 
     @Test
     public void inInverseOfImportOrderTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(IMPORT_DERIVED, IMPORT_ROOT, ROOT_WITHOUT_IMPORT)
                 .build();
         assertNotNull(result);
index 3441c2729c78303a2482fb1ae67da4822015af63..b05608bc0b8b15e796bac0bcb99eddc7d1c3bb16 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertNotNull;
@@ -16,7 +15,7 @@ import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 
 public class ImportRevisionsTest {
 
@@ -43,7 +42,7 @@ public class ImportRevisionsTest {
 
     @Test
     public void equalRevisionDatesTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(ROOT_WITH_EQUAL_DATE, IMPORTED_WITH_EQUAL_DATE)
                 .build();
         assertNotNull(result);
@@ -58,7 +57,7 @@ public class ImportRevisionsTest {
 
     @Test(expected = SomeModifiersUnresolvedException.class)
     public void revisionDatesInRootOnlyTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(ROOT_WITH_DATE, IMPORTED_WITHOUT_DATE)
                 .build();
         assertNotNull(result);
@@ -66,7 +65,7 @@ public class ImportRevisionsTest {
 
     @Test
     public void revisionDatesInImportedOnlyTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(ROOT_WITHOUT_DATE, IMPORTED_WITH_DATE)
                 .build();
         assertNotNull(result);
@@ -74,7 +73,7 @@ public class ImportRevisionsTest {
 
     @Test
     public void noRevisionInRootAndImportedTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(ROOT_WITH_NO_DATE, IMPORTED_WITH_NO_DATE)
                 .build();
         assertNotNull(result);
index e3d45ff3551bf3099449717a405a2fe55472bdb3..5daf0a86ca5528763a3b398e6c930c33ff9ec157 100644 (file)
@@ -22,7 +22,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedEx
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -46,7 +46,7 @@ public class IncludeResolutionTest {
 
     @Test
     public void includeTest() throws SourceException, ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(ROOT, SUBMODULE1, SUBMODULE2)
                 .build();
         assertNotNull(result);
index 7c4e6b4ce123c747796275d0261a3b940cd8449f..694fc7e173d8721cee689e66e80163db549c29c8 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertEquals;
@@ -21,7 +20,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 
 public class IncludeRevisionsTest {
 
@@ -38,7 +37,7 @@ public class IncludeRevisionsTest {
 
     @Test
     public void revsEqualTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(EQUAL_REV, EQUAL_ROOT)
                 .build();
         assertNotNull(result);
@@ -58,7 +57,7 @@ public class IncludeRevisionsTest {
 
     @Test
     public void revIncludeOnly() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(SUBMOD_ONLY_REV, SUBMOD_ONLY_ROOT)
                 .build();
         assertNotNull(result);
@@ -78,7 +77,7 @@ public class IncludeRevisionsTest {
 
     @Test
     public void revNowhereTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(NOWHERE_REV, NOWHERE_ROOT)
                 .build();
         assertNotNull(result);
index f8c5f51561f6e8ad90531a854f633317d09cd11c..1d0bbc367af361258b4c9b103c1aa165f925fd2c 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.yangtools.yang.stmt;
 
 import static org.junit.Assert.assertNotNull;
@@ -19,7 +18,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 
 public class KeyTest {
 
@@ -30,7 +29,7 @@ public class KeyTest {
 
     @Test
     public void keySimpleTest() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSource(KEY_SIMPLE_AND_COMP)
                 .build();
         assertNotNull(result);
index f2c47245ad24bda2b7ca0177df71d990ba4270f1..a510d3c2cf1c4bcdac33cf858127eac50911566b 100644 (file)
@@ -15,7 +15,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.parser.stmt.reactor.ReactorDeclaredModel;
 
 public class YangFileStmtTest {
     //basic statements to parse and write
@@ -43,7 +43,7 @@ public class YangFileStmtTest {
 
     @Test
     public void readAndParseYangFileTestModel() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(BAZ, FOO, BAR, SUBFOO)
                 .build();
         assertNotNull(result);
@@ -51,7 +51,7 @@ public class YangFileStmtTest {
 
     @Test
     public void readAndParseYangFileTestModel2() throws ReactorException {
-        EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+        ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
                 .addSources(BAZ2, FOO2, BAR2, SUBFOO2)
                 .build();
         assertNotNull(result);