Fix leafref-to-enum encoding
[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 static final List<File> YANG_MODELS = new ArrayList<>();
27     private static final URL YANG_MODELS_FOLDER = AugmentedTypeTest.class.getResource("/binary-type-test-models");
28
29     @BeforeClass
30     public static void loadTestResources() throws URISyntaxException {
31         final File augFolder = new File(YANG_MODELS_FOLDER.toURI());
32         for (final File fileEntry : augFolder.listFiles()) {
33             if (fileEntry.isFile()) {
34                 YANG_MODELS.add(fileEntry);
35             }
36         }
37     }
38
39     @Test
40     public void binaryTypeTest() {
41         final SchemaContext context = YangParserTestUtils.parseYangFiles(YANG_MODELS);
42
43         assertNotNull("context is null", context);
44         final BindingGenerator bindingGen = new BindingGeneratorImpl();
45         final List<Type> genTypes = bindingGen.generateTypes(context);
46
47         assertNotNull("genTypes is null", genTypes);
48         assertFalse("genTypes is empty", genTypes.isEmpty());
49
50         //TODO: implement test
51     }
52 }