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.sal.binding.generator.impl;
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertNotNull;
14 import java.util.List;
15 import org.junit.Test;
16 import org.opendaylight.mdsal.binding.generator.api.BindingGenerator;
17 import org.opendaylight.mdsal.binding.model.api.Type;
18 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
19 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
21 public class UnionTypeDefTest {
24 public void unionTypeResolvingTest() throws Exception {
25 File abstractTopology = new File(getClass().getResource("/union-test-models/abstract-topology.yang").toURI());
26 File ietfInetTypes = new File(getClass().getResource("/ietf/ietf-inet-types.yang").toURI());
27 final SchemaContext context = YangParserTestUtils.parseYangSources(abstractTopology, ietfInetTypes);
29 assertNotNull("context is null", context);
30 final BindingGenerator bindingGen = new BindingGeneratorImpl(true);
31 final List<Type> genTypes = bindingGen.generateTypes(context);
33 assertNotNull("genTypes is null", genTypes);
34 assertFalse("genTypes is empty", genTypes.isEmpty());
36 // TODO: implement test