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 java.io.FileNotFoundException;
15 import java.net.URISyntaxException;
16 import org.junit.Test;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
20 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
22 public class Bug4410Test {
25 public void test() throws SourceException, FileNotFoundException, ReactorException, URISyntaxException {
27 StmtTestUtils.parseYangSources("/bugs/bug4410");
28 fail("SomeModifiersUnresolvedException should be thrown.");
29 } catch (SomeModifiersUnresolvedException e) {
30 Throwable rootCause = Throwables.getRootCause(e);
31 assertTrue(rootCause instanceof InferenceException);
32 final String message = rootCause.getMessage();
33 assertTrue(message.startsWith("Type [(foo?revision=1970-01-01)"));
34 assertTrue(message.contains("was not found"));