2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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 NameCollisionWithinCaseTest extends AbstractYangTest {
16 void testChildNameCollisionOfAugmentCase() {
17 assertSourceException(startsWith("Cannot add data tree child with name (foo?revision=2018-02-11)bar, "
18 + "a conflicting child already exists [at "), "/bugs/name-collision-within-case/foo.yang");
22 void testChildNameCollisionOfAugmentChoice() {
23 assertSourceException(startsWith("Cannot add data tree child with name (bar?revision=2018-02-11)bar, "
24 + "a conflicting child already exists [at "), "/bugs/name-collision-within-case/bar.yang");
28 void testChildNameCollisionNormal() {
29 assertSourceException(startsWith("Error in module 'baz': cannot add '(baz?revision=2018-02-28)bar'."
30 + " Node name collision: "), "/bugs/name-collision-within-case/baz.yang");