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.assertEquals;
11 import static org.junit.Assert.assertTrue;
13 import java.io.IOException;
14 import java.net.URISyntaxException;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
19 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
22 * Test for testing of extensions and their arguments.
24 * @author Lukas Sedlak <lsedlak@cisco.com>
26 public class ParsingExtensionValueTest {
29 public void extensionTest() throws IOException, YangSyntaxErrorException, URISyntaxException {
31 TestUtils.loadModules(getClass().getResource("/extensions").toURI());
32 } catch (ReactorException e) {
33 assertEquals(SomeModifiersUnresolvedException.class, e.getClass());
34 assertTrue(e.getCause() instanceof SourceException);
35 assertTrue(e.getCause().getMessage().startsWith("ext:id is not a YANG statement or use of extension"));