Further testing cleanup
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug4933Test.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.stmt;
9
10 import static org.hamcrest.CoreMatchers.startsWith;
11 import static org.junit.Assert.assertEquals;
12
13 import java.util.Collection;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.model.api.Deviation;
16 import org.opendaylight.yangtools.yang.model.api.Module;
17
18 public class Bug4933Test extends AbstractYangTest {
19     @Test
20     public void test() {
21         final var context = assertEffectiveModelDir("/bugs/bug4933/correct");
22
23         final Module foo = context.findModules("foo").iterator().next();
24         Collection<? extends Deviation> deviations = foo.getDeviations();
25         assertEquals(4, deviations.size());
26     }
27
28     @Test
29     public void incorrectKeywordTest() {
30         assertSourceExceptionDir("/bugs/bug4933/incorrect",
31             startsWith("String 'not_supported' is not valid deviate argument"));
32     }
33 }