2 * Copyright (c) 2017 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.junit.Assert.assertTrue;
11 import static org.junit.Assert.fail;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
16 public class Bug7424Test {
18 public void testRpc() throws Exception {
20 StmtTestUtils.parseYangSource("/bugs/bug7424/foo-rpc.yang");
21 fail("Test should fail due to invalid yang model.");
22 } catch (final SomeModifiersUnresolvedException e) {
27 "Error in module 'foo': cannot add '(foo?revision=1970-01-01)name'. "
28 + "Node name collision: '(foo?revision=1970-01-01)name' already declared."));
33 public void testNotification() throws Exception {
35 StmtTestUtils.parseYangSource("/bugs/bug7424/foo-notification.yang");
36 fail("Test should fail due to invalid yang model.");
37 } catch (final SomeModifiersUnresolvedException e) {
42 "Error in module 'foo': cannot add '(foo?revision=1970-01-01)name'. "
43 + "Node name collision: '(foo?revision=1970-01-01)name' already declared."));
48 public void testData() throws Exception {
50 StmtTestUtils.parseYangSource("/bugs/bug7424/foo-data.yang");
51 fail("Test should fail due to invalid yang model.");
52 } catch (final SomeModifiersUnresolvedException e) {
57 "Error in module 'foo': cannot add '(foo?revision=1970-01-01)name'. "
58 + "Node name collision: '(foo?revision=1970-01-01)name' already declared."));
63 public void testRpcUses() throws Exception {
65 StmtTestUtils.parseYangSource("/bugs/bug7424/foo-rpc-uses.yang");
66 fail("Test should fail due to invalid yang model.");
67 } catch (final SomeModifiersUnresolvedException e) {
72 "Error in module 'foo': cannot add '(foo?revision=1970-01-01)name'. "
73 + "Node name collision: '(foo?revision=1970-01-01)name' already declared."));