ab50acd53e78583a9ee65bcf3a3f461c191bf712
[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.model.api.Type;
21 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
22 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
23
24 public class BinaryTypeTest {
25     private static final List<File> YANG_MODELS = new ArrayList<>();
26     private static final URL YANG_MODELS_FOLDER = AugmentedTypeTest.class.getResource("/binary-type-test-models");
27
28     @BeforeClass
29     public static void loadTestResources() throws URISyntaxException {
30         final File augFolder = new File(YANG_MODELS_FOLDER.toURI());
31         for (final File fileEntry : augFolder.listFiles()) {
32             if (fileEntry.isFile()) {
33                 YANG_MODELS.add(fileEntry);
34             }
35         }
36     }
37
38     @Test
39     public void binaryTypeTest() {
40         final SchemaContext context = YangParserTestUtils.parseYangFiles(YANG_MODELS);
41
42         assertNotNull("context is null", context);
43         final List<Type> genTypes = DefaultBindingGenerator.generateFor(context);
44
45         assertNotNull("genTypes is null", genTypes);
46         assertFalse("genTypes is empty", genTypes.isEmpty());
47
48         //TODO: implement test
49     }
50 }