Search in sources :

Example 1 with MountEffectiveStatement

use of org.opendaylight.yangtools.odlext.model.api.MountEffectiveStatement in project yangtools by opendaylight.

the class MountTest method test.

@Test
public void test() throws Exception {
    final ModuleEffectiveStatement foo = reactor.newBuild().addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource("/yang-ext.yang"))).addSource(YangStatementStreamSource.create(YangTextSchemaSource.forResource("/mount.yang"))).buildEffective().getModuleStatements().get(FOO);
    final Optional<MountEffectiveStatement> fooMount = foo.findDataTreeNode(QName.create(FOO, "foo")).orElseThrow().findFirstEffectiveSubstatement(MountEffectiveStatement.class);
    assertTrue(fooMount.isPresent());
    final Optional<MountEffectiveStatement> barMount = foo.findDataTreeNode(QName.create(FOO, "bar")).orElseThrow().findFirstEffectiveSubstatement(MountEffectiveStatement.class);
    assertTrue(barMount.isPresent());
}
Also used : MountEffectiveStatement(org.opendaylight.yangtools.odlext.model.api.MountEffectiveStatement) ModuleEffectiveStatement(org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 MountEffectiveStatement (org.opendaylight.yangtools.odlext.model.api.MountEffectiveStatement)1 ModuleEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement)1