Replace calls of StmtTestUtils.parseYangSource(String)
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug7424Test.java
1 /*
2  * Copyright (c) 2017 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
12 import org.junit.Test;
13
14 public class Bug7424Test extends AbstractYangTest {
15     @Test
16     public void testRpc()throws Exception {
17         assertSourceException(startsWith("Error in module 'foo': cannot add '(foo)name'. Node name collision:"
18                 + " '(foo)name' already declared"), "/bugs/bug7424/foo-rpc.yang");
19     }
20
21     @Test
22     public void testNotification() {
23         assertSourceException(startsWith("Error in module 'foo': cannot add '(foo)name'. Node name collision:"
24                 + " '(foo)name' already declared"), "/bugs/bug7424/foo-notification.yang");
25     }
26
27     @Test
28     public void testData() {
29         assertSourceException(startsWith("Error in module 'foo': cannot add '(foo)name'. Node name collision:"
30                 + " '(foo)name' already declared"), "/bugs/bug7424/foo-data.yang");
31     }
32
33     @Test
34     public void testRpcUses() {
35         assertSourceException(startsWith("Error in module 'foo': cannot add '(foo)name'. Node name collision:"
36                 + " '(foo)name' already declared"), "/bugs/bug7424/foo-rpc-uses.yang");
37     }
38 }