import org.junit.Test;
import org.opendaylight.yangtools.util.xml.UntrustedXML;
import org.opendaylight.yangtools.yang.common.QName;
import org.junit.Test;
import org.opendaylight.yangtools.util.xml.UntrustedXML;
import org.opendaylight.yangtools.yang.common.QName;
private static final QName BAZ_TOP = QName.create(BAZ_NS, BAZ_REV, "baz-top");
private static final YangInstanceIdentifier BAZ_TOP_ID = YangInstanceIdentifier.of(BAZ_TOP);
private static final QName BAZ_TOP = QName.create(BAZ_NS, BAZ_REV, "baz-top");
private static final YangInstanceIdentifier BAZ_TOP_ID = YangInstanceIdentifier.of(BAZ_TOP);
- private SchemaContext schemaContext;
- private LeafRefContext leafRefContext;
+ private static SchemaContext schemaContext;
+ private static LeafRefContext leafRefContext;
+ private static ContainerSchemaNode fooTopNode;
+ private static ContainerSchemaNode bazTopNode;
+
schemaContext = YangParserTestUtils.parseYangResourceDirectory("/yangtools891");
leafRefContext = LeafRefContext.create(schemaContext);
schemaContext = YangParserTestUtils.parseYangResourceDirectory("/yangtools891");
leafRefContext = LeafRefContext.create(schemaContext);
final Module fooModule = schemaContext.findModule(FOO, Revision.of(FOO_REV)).get();
fooTopNode = (ContainerSchemaNode) fooModule.findDataChildByName(FOO_TOP).get();
final Module bazModule = schemaContext.findModule(BAZ, Revision.of(BAZ_REV)).get();
bazTopNode = (ContainerSchemaNode) bazModule.findDataChildByName(BAZ_TOP).get();
}
final Module fooModule = schemaContext.findModule(FOO, Revision.of(FOO_REV)).get();
fooTopNode = (ContainerSchemaNode) fooModule.findDataChildByName(FOO_TOP).get();
final Module bazModule = schemaContext.findModule(BAZ, Revision.of(BAZ_REV)).get();
bazTopNode = (ContainerSchemaNode) bazModule.findDataChildByName(BAZ_TOP).get();
}
@Test
public void testValid() throws Exception {
final NormalizedNode<?, ?> fooTop = readNode("/yangtools891/grouping-with-list-valid.xml", fooTopNode);
@Test
public void testValid() throws Exception {
final NormalizedNode<?, ?> fooTop = readNode("/yangtools891/grouping-with-list-valid.xml", fooTopNode);
- private NormalizedNode<?, ?> readNode(final String filename, final ContainerSchemaNode node) throws Exception {
+ private static NormalizedNode<?, ?> readNode(final String filename, final ContainerSchemaNode node)
+ throws Exception {
final InputStream resourceAsStream = Yangtools891Test.class.getResourceAsStream(filename);
final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream);
final NormalizedNodeResult result = new NormalizedNodeResult();
final InputStream resourceAsStream = Yangtools891Test.class.getResourceAsStream(filename);
final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream);
final NormalizedNodeResult result = new NormalizedNodeResult();