2 * Copyright (c) 2013 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.controller.config.yangjmxgenerator.unknownextension;
10 import static org.junit.Assert.assertTrue;
11 import static org.junit.Assert.fail;
13 import com.google.common.collect.Lists;
14 import java.io.InputStream;
15 import java.util.List;
16 import org.junit.Test;
17 import org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants;
18 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntryTest;
19 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModelSearchUtils;
20 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
21 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
23 public class UnknownExtensionTest extends ServiceInterfaceEntryTest {
26 public void testStopOnUnknownLanguageExtension() throws Exception {
27 List<InputStream> yangISs = Lists.newArrayList(getClass()
28 .getResourceAsStream("test-ifcWithUnknownExtension.yang"));
29 yangISs.addAll(getConfigApiYangInputStreams());
31 final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
32 context = reactor.buildEffective(yangISs);
33 namesToModules = YangModelSearchUtils.mapModulesByNames(context
35 configModule = namesToModules.get(ConfigConstants.CONFIG_MODULE);
36 threadsModule = namesToModules
37 .get(ConfigConstants.CONFIG_THREADS_MODULE);
39 super.testCreateFromIdentities();
41 } catch (IllegalStateException e) {
44 e.getMessage().startsWith(
45 "Unexpected unknown schema node."));
48 for (InputStream is : yangISs) {