X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=parser%2Fyang-parser-rfc7950%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fstmt%2Frfc6020%2Feffective%2FElementCountConstraintsTest.java;h=22345b38cea1f405ead9d273cceff29d8ad8334f;hb=33c637e8cca6b731c2a75af4a2698f750d1e9b03;hp=205580e02d48a72f006e5ddf943c17c76f282d1f;hpb=c9543ea06b176ae07a205abe29fc385a7b7548ad;p=yangtools.git diff --git a/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/ElementCountConstraintsTest.java b/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/ElementCountConstraintsTest.java index 205580e02d..22345b38ce 100644 --- a/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/ElementCountConstraintsTest.java +++ b/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/ElementCountConstraintsTest.java @@ -9,28 +9,21 @@ package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import java.io.IOException; -import java.net.URISyntaxException; import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.model.api.ElementCountConstraint; import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; import org.opendaylight.yangtools.yang.model.api.Module; -import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException; -import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; -import org.opendaylight.yangtools.yang.stmt.StmtTestUtils; +import org.opendaylight.yangtools.yang.stmt.AbstractYangTest; -public class ElementCountConstraintsTest { +public class ElementCountConstraintsTest extends AbstractYangTest { @Test - public void testElementCountConstraints() - throws YangSyntaxErrorException, ReactorException, URISyntaxException, IOException { - final var schemaContext = StmtTestUtils.parseYangSource("/constraint-definitions-test/foo.yang"); - assertNotNull(schemaContext); + public void testElementCountConstraints() { + final var context = assertEffectiveModel("/constraint-definitions-test/foo.yang"); - final Module testModule = schemaContext.findModule("foo", Revision.of("2016-09-20")).get(); + final Module testModule = context.findModule("foo", Revision.of("2016-09-20")).get(); final LeafListSchemaNode constrainedLeafList1 = (LeafListSchemaNode) testModule.getDataChildByName( QName.create(testModule.getQNameModule(), "constrained-leaf-list-1")); ElementCountConstraint constraints1 = constrainedLeafList1.getElementCountConstraint().get();