2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.yangtools.yang.parser.stmt.rfc7950;
11 import static org.hamcrest.CoreMatchers.startsWith;
12 import static org.junit.Assert.assertNotNull;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.InvalidSubstatementException;
16 import org.opendaylight.yangtools.yang.stmt.AbstractYangTest;
17 import org.opendaylight.yangtools.yang.stmt.StmtTestUtils;
19 public class Bug6867BasicTest extends AbstractYangTest {
22 public void valid10Test() throws Exception {
23 assertEffectiveModel("/rfc7950/basic-test/valid-10.yang");
27 public void valid11Test() throws Exception {
28 assertEffectiveModel("/rfc7950/basic-test/valid-11.yang");
32 public void invalid10Test() {
33 assertException(InvalidSubstatementException.class, startsWith("NOTIFICATION is not valid for CONTAINER"),
34 "/rfc7950/basic-test/invalid-10.yang");
38 public void invalid11Test() {
39 assertException(InvalidSubstatementException.class, startsWith("RPC is not valid for CONTAINER"),
40 "/rfc7950/basic-test/invalid-11.yang");
44 public void anyData11Test() throws Exception {
45 assertEffectiveModel("/rfc7950/basic-test/anydata-11.yang");
49 public void anyData10Test() {
50 assertSourceException(startsWith("anydata is not a YANG statement or use of extension"),
51 "/rfc7950/basic-test/anydata-10.yang");
55 public void yangModelTest() throws Exception {
56 assertNotNull(StmtTestUtils.parseYangSources("/rfc7950/model"));
60 public void unsupportedVersionTest() {
61 assertSourceException(startsWith("Unsupported YANG version 2.3"),
62 "/rfc7950/basic-test/unsupported-version.yang");