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
8 package org.opendaylight.yangtools.yang.stmt;
10 import static org.hamcrest.CoreMatchers.startsWith;
12 import org.junit.jupiter.api.Test;
14 class ListKeysTest extends AbstractYangTest {
16 void correctListKeysTest() {
17 assertEffectiveModel("/list-keys-test/correct-list-keys-test.yang");
21 void incorrectListKeysTest1() {
22 assertInferenceException(startsWith("Key 'test1_key1 test1_key2' misses node 'test1_key2'"),
23 "/list-keys-test/incorrect-list-keys-test.yang");
27 void incorrectListKeysTest2() {
28 assertInferenceException(startsWith("Key 'test1_key1 test1_key2' misses node 'test1_key2'"),
29 "/list-keys-test/incorrect-list-keys-test2.yang");
33 void incorrectListKeysTest3() {
34 assertInferenceException(startsWith("Key 'grp_list' misses node 'grp_list'"),
35 "/list-keys-test/incorrect-list-keys-test3.yang");
39 void incorrectListKeysTest4() {
40 assertInferenceException(startsWith("Key 'grp_leaf' misses node 'grp_leaf'"),
41 "/list-keys-test/incorrect-list-keys-test4.yang");