1 package org.opendaylight.yangtools.sal.binding.generator.impl;
3 import static org.junit.Assert.assertNotNull;
4 import static org.junit.Assert.assertTrue;
5 import java.io.IOException;
6 import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
7 import java.net.URISyntaxException;
10 import org.opendaylight.yangtools.sal.binding.model.api.Type;
11 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
12 import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
13 import org.junit.Test;
15 public class Bug4145Test {
17 public void bug4145Test() throws URISyntaxException, IOException, YangSyntaxErrorException {
18 File resourceFile = new File(getClass().getResource(
19 "/bug-4145/foo.yang").toURI());
20 File resourceDir = resourceFile.getParentFile();
22 YangParserImpl parser = YangParserImpl.getInstance();
23 SchemaContext context = parser.parseFile(resourceFile, resourceDir);
25 List<Type> generateTypes = new BindingGeneratorImpl(false)
26 .generateTypes(context);
27 assertNotNull(generateTypes);
28 assertTrue(generateTypes.size() > 0);