2 * Copyright (c) 2013 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.io.IOException;
15 import java.net.URISyntaxException;
17 import java.util.ArrayList;
18 import java.util.List;
19 import org.junit.BeforeClass;
20 import org.junit.Test;
21 import org.opendaylight.yangtools.sal.binding.generator.api.BindingGenerator;
22 import org.opendaylight.yangtools.sal.binding.model.api.Type;
23 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
24 import org.opendaylight.yangtools.yang.model.parser.api.YangContextParser;
25 import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
27 public class BinaryTypeTest {
28 private final static List<File> yangModels = new ArrayList<>();
29 private final static URL yangModelsFolder = AugmentedTypeTest.class
30 .getResource("/binary-type-test-models");
33 public static void loadTestResources() throws URISyntaxException {
34 final File augFolder = new File(yangModelsFolder.toURI());
35 for (final File fileEntry : augFolder.listFiles()) {
36 if (fileEntry.isFile()) {
37 yangModels.add(fileEntry);
43 public void binaryTypeTest() throws IOException {
44 final YangContextParser parser = new YangParserImpl();
45 final SchemaContext context = parser.parseFiles(yangModels);
47 assertNotNull("context is null", context);
48 final BindingGenerator bindingGen = new BindingGeneratorImpl();
49 final List<Type> genTypes = bindingGen.generateTypes(context);
51 assertNotNull("genTypes is null", genTypes);
52 assertFalse("genTypes is empty", genTypes.isEmpty());
54 //TODO: implement test