370d3567a8cbbab57a8884c8abe414fa0a5ff1b9
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / yangtools / sal / binding / generator / impl / stmt / parser / retest / ControllerTest.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. 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 package org.opendaylight.yangtools.sal.binding.generator.impl.stmt.parser.retest;
9
10 import static org.junit.Assert.assertNotNull;
11 import static org.junit.Assert.assertTrue;
12 import org.opendaylight.yangtools.sal.binding.generator.impl.BindingGeneratorImpl;
13 import java.io.File;
14 import java.util.List;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.sal.binding.generator.api.BindingGenerator;
17 import org.opendaylight.yangtools.sal.binding.model.api.Type;
18 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
19
20 public class ControllerTest {
21
22     @Test
23     public void controllerAugmentationTest() throws Exception {
24         File cn = new File(getClass().getResource("/controller-models/controller-network.yang").toURI());
25         File co = new File(getClass().getResource("/controller-models/controller-openflow.yang").toURI());
26         File ietfInetTypes = new File(getClass().getResource("/ietf/ietf-inet-types.yang").toURI());
27
28         final SchemaContext context =  RetestUtils.parseYangSources(cn, co, ietfInetTypes);
29         assertNotNull("Schema Context is null", context);
30
31         final BindingGenerator bindingGen = new BindingGeneratorImpl(true);
32         final List<Type> genTypes = bindingGen.generateTypes(context);
33
34         assertNotNull(genTypes);
35         assertTrue(!genTypes.isEmpty());
36     }
37 }