}
}
- EffectiveModelContext build() throws ReactorException {
+ ReactorDeclaredModel build() throws ReactorException {
executePhases();
return transform();
}
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,
/**
* Build the effective model context.
*/
- public EffectiveModelContext build() throws ReactorException {
+ public ReactorDeclaredModel build() throws ReactorException {
return context.build();
}
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);
}
* 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;
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 {
@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);
* 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;
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 {
@Test
public void readAndParseYangFileTest() throws SourceException, ReactorException {
- EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+ ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
.addSources(AUGMENTED, ROOT)
.build();
assertNotNull(result);
* 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;
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 {
@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);
@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);
* 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;
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 {
@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);
@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);
@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);
@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);
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;
@Test
public void includeTest() throws SourceException, ReactorException {
- EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+ ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
.addSources(ROOT, SUBMODULE1, SUBMODULE2)
.build();
assertNotNull(result);
* 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;
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 {
@Test
public void revsEqualTest() throws ReactorException {
- EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+ ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
.addSources(EQUAL_REV, EQUAL_ROOT)
.build();
assertNotNull(result);
@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);
@Test
public void revNowhereTest() throws ReactorException {
- EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+ ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
.addSources(NOWHERE_REV, NOWHERE_ROOT)
.build();
assertNotNull(result);
* 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;
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 {
@Test
public void keySimpleTest() throws ReactorException {
- EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+ ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
.addSource(KEY_SIMPLE_AND_COMP)
.build();
assertNotNull(result);
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
@Test
public void readAndParseYangFileTestModel() throws ReactorException {
- EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+ ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
.addSources(BAZ, FOO, BAR, SUBFOO)
.build();
assertNotNull(result);
@Test
public void readAndParseYangFileTestModel2() throws ReactorException {
- EffectiveModelContext result = RFC7950Reactors.defaultReactor().newBuild()
+ ReactorDeclaredModel result = RFC7950Reactors.defaultReactor().newBuild()
.addSources(BAZ2, FOO2, BAR2, SUBFOO2)
.build();
assertNotNull(result);