Unit test post-clean-up fix
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug5829Test.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
9 package org.opendaylight.yangtools.yang.stmt;
10
11 import static org.junit.Assert.assertTrue;
12 import static org.junit.Assert.fail;
13
14 import java.io.FileNotFoundException;
15 import java.net.URISyntaxException;
16 import org.junit.Test;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
18 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
19
20 public class Bug5829Test {
21     @Test
22     public void test() throws SourceException, FileNotFoundException, ReactorException, URISyntaxException {
23         try {
24             StmtTestUtils.parseYangSources("/bugs/bug5829");
25             fail("Test should fail due to invalid yang source.");
26         } catch (Exception e) {
27             assertTrue(e.getMessage().startsWith(
28                     "Error in module 'foo': case nodes '(foo?revision=1970-01-01)two' and "
29                             + "'(foo?revision=1970-01-01)three' in choice '(foo?revision=1970-01-01)my-choice' "
30                             + "have child nodes with the same QName '(foo?revision=1970-01-01)two'."));
31         }
32     }
33 }