import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
import java.util.List;
import org.junit.Test;
-import org.opendaylight.mdsal.binding.generator.impl.BindingGeneratorImpl;
import org.opendaylight.mdsal.binding.model.api.Type;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public class Bug4145Test {
@Test
- public void bug4145Test() throws URISyntaxException, IOException, YangSyntaxErrorException, ReactorException {
- File resourceFile = new File(getClass().getResource(
- "/bug-4145/foo.yang").toURI());
+ public void bug4145Test() {
+ SchemaContext context = YangParserTestUtils.parseYangResource("/bug-4145/foo.yang");
- SchemaContext context = YangParserTestUtils.parseYangSources(resourceFile);
-
- List<Type> generateTypes = new BindingGeneratorImpl(false)
- .generateTypes(context);
+ List<Type> generateTypes = new BindingGeneratorImpl().generateTypes(context);
assertNotNull(generateTypes);
assertTrue(generateTypes.size() > 0);
}