Revert "Fix broken tests according to yangtools...
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / mdsal / binding / generator / impl / BinaryTypeTest.java
1 /*
2  * Copyright (c) 2016 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.mdsal.binding.generator.impl;
9
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertNotNull;
12
13 import java.io.File;
14 import java.io.IOException;
15 import java.net.URISyntaxException;
16 import java.net.URL;
17 import java.util.ArrayList;
18 import java.util.List;
19 import org.junit.BeforeClass;
20 import org.junit.Test;
21 import org.opendaylight.mdsal.binding.generator.api.BindingGenerator;
22 import org.opendaylight.mdsal.binding.generator.impl.BindingGeneratorImpl;
23 import org.opendaylight.mdsal.binding.model.api.Type;
24 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
25 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
26 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
27 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
28
29 public class BinaryTypeTest {
30     private final static List<File> yangModels = new ArrayList<>();
31     private final static URL yangModelsFolder = AugmentedTypeTest.class
32             .getResource("/binary-type-test-models");
33
34     @BeforeClass
35     public static void loadTestResources() throws URISyntaxException {
36         final File augFolder = new File(yangModelsFolder.toURI());
37         for (final File fileEntry : augFolder.listFiles()) {
38             if (fileEntry.isFile()) {
39                 yangModels.add(fileEntry);
40             }
41         }
42     }
43
44     @Test
45     public void binaryTypeTest() throws IOException, SourceException, ReactorException {
46         final SchemaContext context = YangParserTestUtils.parseYangSources(yangModels);
47
48         assertNotNull("context is null", context);
49         final BindingGenerator bindingGen = new BindingGeneratorImpl(true);
50         final List<Type> genTypes = bindingGen.generateTypes(context);
51
52         assertNotNull("genTypes is null", genTypes);
53         assertFalse("genTypes is empty", genTypes.isEmpty());
54
55         //TODO: implement test
56     }
57 }