Adjust to yangtools-2.0.0 changes
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / mdsal / binding / generator / impl / Bug4145Test.java
index c5ea0f50733d5ca6235d860412b655ed5580c6e0..2e273c056219c563222ff51e358c0b37fb6ef829 100644 (file)
@@ -10,28 +10,18 @@ package org.opendaylight.mdsal.binding.generator.impl;
 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(false).generateTypes(context);
         assertNotNull(generateTypes);
         assertTrue(generateTypes.size() > 0);
     }