Revert "Fix broken tests according to yangtools...
[mdsal.git] / binding2 / mdsal-binding2-runtime / src / test / java / org / opendaylight / mdsal / binding / javav2 / runtime / context / BindingRuntimeContextTest.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.mdsal.binding.javav2.runtime.context;
10
11 import static org.junit.Assert.assertNotNull;
12
13 import java.io.File;
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;
23
24 public class BindingRuntimeContextTest {
25
26     private SchemaContext schemaContext;
27     private BindingRuntimeContext brc;
28     private DataNodeContainer myCont;
29
30     @Before
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);
36     }
37
38     @Test
39     public void basicTest() {
40         assertNotNull(brc.getSchemaContext());
41         assertNotNull(brc.getStrategy());
42         assertNotNull(brc.getChoiceCaseChildren(myCont));
43     }
44 }