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.mdsal.binding.generator.impl;
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertNotNull;
14 import java.net.URISyntaxException;
16 import java.util.ArrayList;
17 import java.util.List;
18 import org.junit.BeforeClass;
19 import org.junit.Test;
20 import org.opendaylight.mdsal.binding.generator.api.BindingGenerator;
21 import org.opendaylight.mdsal.binding.model.api.Type;
22 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
23 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
25 public class BinaryTypeTest {
26 private final static List<File> yangModels = new ArrayList<>();
27 private final static URL yangModelsFolder = AugmentedTypeTest.class
28 .getResource("/binary-type-test-models");
31 public static void loadTestResources() throws URISyntaxException {
32 final File augFolder = new File(yangModelsFolder.toURI());
33 for (final File fileEntry : augFolder.listFiles()) {
34 if (fileEntry.isFile()) {
35 yangModels.add(fileEntry);
41 public void binaryTypeTest() throws Exception {
42 final SchemaContext context = YangParserTestUtils.parseYangFiles(yangModels);
44 assertNotNull("context is null", context);
45 final BindingGenerator bindingGen = new BindingGeneratorImpl(true);
46 final List<Type> genTypes = bindingGen.generateTypes(context);
48 assertNotNull("genTypes is null", genTypes);
49 assertFalse("genTypes is empty", genTypes.isEmpty());
51 //TODO: implement test