2 * Copyright (c) 2017 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.mdsal.binding.javav2.runtime.context;
11 import static org.junit.Assert.assertNotNull;
14 import java.io.FileNotFoundException;
15 import java.net.URISyntaxException;
16 import org.junit.Before;
17 import org.junit.Test;
18 import org.opendaylight.mdsal.binding.javav2.generator.impl.GeneratedClassLoadingStrategy;
19 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
20 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
21 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
22 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
24 public class BindingRuntimeContextTest {
26 private SchemaContext schemaContext;
27 private BindingRuntimeContext brc;
28 private DataNodeContainer myCont;
31 public void setup() throws URISyntaxException, FileNotFoundException, ReactorException {
32 schemaContext = YangParserTestUtils.parseYangSources(
33 new File(getClass().getResource("/yang/test-runtime.yang").toURI()));
34 myCont = (DataNodeContainer) schemaContext.getChildNodes().iterator().next();
35 brc = BindingRuntimeContext.create(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(), schemaContext);
39 public void basicTest() {
40 assertNotNull(brc.getSchemaContext());
41 assertNotNull(brc.getStrategy());
42 assertNotNull(brc.getChoiceCaseChildren(myCont));