2 * Copyright (c) 2016 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.mdsal.binding.generator.impl;
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertNotNull;
14 import java.net.URISyntaxException;
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;
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");
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);
39 public void binaryTypeTest() {
40 final SchemaContext context = YangParserTestUtils.parseYangFiles(YANG_MODELS);
42 assertNotNull("context is null", context);
43 final List<Type> genTypes = DefaultBindingGenerator.generateFor(context);
45 assertNotNull("genTypes is null", genTypes);
46 assertFalse("genTypes is empty", genTypes.isEmpty());
48 //TODO: implement test