Fix broken tests according to yangtools changes
[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.net.URISyntaxException;
15 import java.net.URL;
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;
24
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");
29
30     @BeforeClass
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);
36             }
37         }
38     }
39
40     @Test
41     public void binaryTypeTest() throws Exception {
42         final SchemaContext context = YangParserTestUtils.parseYangFiles(yangModels);
43
44         assertNotNull("context is null", context);
45         final BindingGenerator bindingGen = new BindingGeneratorImpl(true);
46         final List<Type> genTypes = bindingGen.generateTypes(context);
47
48         assertNotNull("genTypes is null", genTypes);
49         assertFalse("genTypes is empty", genTypes.isEmpty());
50
51         //TODO: implement test
52     }
53 }