import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public class Bug5830Test {
private static final String NS = "foo";
private static final QName PRESENCE_CONTAINER_2 = QName.create(NS, REV, "presence-container-2");
private static final QName MANDATORY_LEAF_2 = QName.create(NS, REV, "mandatory-leaf-2");
- private static DataTree initDataTree(final SchemaContext schemaContext)
+ private static DataTree initDataTree(final EffectiveModelContext schemaContext)
throws DataValidationFailedException {
DataTree inMemoryDataTree = new InMemoryDataTreeFactory().create(
DataTreeConfiguration.DEFAULT_CONFIGURATION, schemaContext);
}
private static void testPresenceContainer() throws DataValidationFailedException {
- final SchemaContext schemaContext = TestModel.createTestContext("/bug5830/foo-presence.yang");
+ final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-presence.yang");
assertNotNull("Schema context must not be null.", schemaContext);
testContainerIsNotPresent(schemaContext);
}
private static void testNonPresenceContainer() throws DataValidationFailedException {
- final SchemaContext schemaContext = TestModel.createTestContext("/bug5830/foo-non-presence.yang");
+ final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-non-presence.yang");
assertNotNull("Schema context must not be null.", schemaContext);
try {
}
private static void testMultipleContainers() throws DataValidationFailedException {
- final SchemaContext schemaContext = TestModel.createTestContext("/bug5830/foo-multiple.yang");
+ final EffectiveModelContext schemaContext = TestModel.createTestContext("/bug-5830/foo-multiple.yang");
assertNotNull("Schema context must not be null.", schemaContext);
testContainerIsNotPresent(schemaContext);
}
}
- private static void testContainerIsNotPresent(final SchemaContext schemaContext)
+ private static void testContainerIsNotPresent(final EffectiveModelContext schemaContext)
throws DataValidationFailedException {
final DataTree inMemoryDataTree = initDataTree(schemaContext);
final MapEntryNode taskEntryNode = Builders.mapEntryBuilder()
inMemoryDataTree.commit(prepare);
}
- private static void testContainerIsPresent(final SchemaContext schemaContext) throws DataValidationFailedException {
+ private static void testContainerIsPresent(final EffectiveModelContext schemaContext)
+ throws DataValidationFailedException {
final DataTree inMemoryDataTree = initDataTree(schemaContext);
final MapEntryNode taskEntryNode = Builders.mapEntryBuilder()
inMemoryDataTree.commit(prepare);
}
- private static void testMandatoryDataLeafIsPresent(final SchemaContext schemaContext)
+ private static void testMandatoryDataLeafIsPresent(final EffectiveModelContext schemaContext)
throws DataValidationFailedException {
final DataTree inMemoryDataTree = initDataTree(schemaContext);
inMemoryDataTree.commit(prepare);
}
- private static void testMandatoryLeaf2IsPresent(final SchemaContext schemaContext,
+ private static void testMandatoryLeaf2IsPresent(final EffectiveModelContext schemaContext,
final boolean withPresenceContianer) throws DataValidationFailedException {
final DataTree inMemoryDataTree = initDataTree(schemaContext);