import org.opendaylight.yangtools.yang.data.api.YangNetconfError;
import org.opendaylight.yangtools.yang.data.api.schema.stream.InputStreamNormalizer;
import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizationException;
-import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
@Test
void parseDatastore() throws Exception {
- assertEquals(Builders.containerBuilder()
+ assertEquals(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(DATA_NID)
- .withChild(Builders.containerBuilder()
+ .withChild(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(FOO))
.withChild(ImmutableNodes.leafNode(STR, "str"))
.build())
- .withChild(Builders.containerBuilder()
+ .withChild(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(BAR))
.withChild(ImmutableNodes.leafNode(UINT, Uint32.TWO))
.build())
@Test
void parseData() throws Exception {
- assertEquals(Builders.containerBuilder()
+ assertEquals(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(FOO))
.withChild(ImmutableNodes.leafNode(STR, "str"))
.build(),
}"""));
assertEquals(List.of(), prefixAndNode.prefix());
- assertEquals(Builders.containerBuilder()
+ assertEquals(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(FOO))
.withChild(ImmutableNodes.leafNode(STR, "str"))
.build(), prefixAndNode.result().data());
]
}"""));
assertEquals(List.of(new NodeIdentifier(BAZ)), prefixAndNode.prefix());
- assertEquals(Builders.mapEntryBuilder()
+ assertEquals(ImmutableNodes.newMapEntryBuilder()
.withNodeIdentifier(NodeIdentifierWithPredicates.of(BAZ, Map.of(ONE, Boolean.TRUE, TWO, "two")))
.withChild(ImmutableNodes.leafNode(ONE, Boolean.TRUE))
.withChild(ImmutableNodes.leafNode(TWO, "two"))
}
}"""));
assertEquals(List.of(new NodeIdentifier(BAZ)), prefixAndNode.prefix());
- assertEquals(Builders.mapEntryBuilder()
+ assertEquals(ImmutableNodes.newMapEntryBuilder()
.withNodeIdentifier(NodeIdentifierWithPredicates.of(BAZ, Map.of(ONE, Boolean.TRUE, TWO, "two")))
.withChild(ImmutableNodes.leafNode(ONE, Boolean.TRUE))
.withChild(ImmutableNodes.leafNode(TWO, "two"))
final var stack = SchemaInferenceStack.of(MODEL_CONTEXT);
stack.enterSchemaTree(THUD);
- assertEquals(Builders.containerBuilder()
+ assertEquals(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(QName.create("foo", "input")))
.withChild(ImmutableNodes.leafNode(UINT, Uint32.TWO))
.build(),
stack.enterSchemaTree(BAZ);
stack.enterSchemaTree(QUX);
- assertEquals(Builders.containerBuilder()
+ assertEquals(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(QName.create("foo", "input")))
.withChild(ImmutableNodes.leafNode(STR, "str"))
.build(),
final var stack = SchemaInferenceStack.of(MODEL_CONTEXT);
stack.enterSchemaTree(THUD);
- assertEquals(Builders.containerBuilder()
+ assertEquals(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(QName.create("foo", "output")))
.build(),
PARSER.parseOutput(stack.toInference(), stream("""
stack.enterSchemaTree(BAZ);
stack.enterSchemaTree(QUX);
- assertEquals(Builders.containerBuilder()
+ assertEquals(ImmutableNodes.newContainerBuilder()
.withNodeIdentifier(new NodeIdentifier(QName.create("foo", "output")))
.build(),
PARSER.parseOutput(stack.toInference(), stream("""