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.junit.Assert.assertTrue;
11 import static org.junit.Assert.fail;
13 import com.google.common.base.Throwables;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
18 public class Bug4410Test {
21 public void test() throws Exception {
23 StmtTestUtils.parseYangSources("/bugs/bug4410");
24 fail("SomeModifiersUnresolvedException should be thrown.");
25 } catch (SomeModifiersUnresolvedException e) {
26 Throwable rootCause = Throwables.getRootCause(e);
27 assertTrue(rootCause instanceof InferenceException);
28 final String message = rootCause.getMessage();
29 assertTrue(message.startsWith("Type [(foo)"));
30 assertTrue(message.contains("was not found"));