X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=parser%2Fyang-parser-rfc7950%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fstmt%2FYangParserNegativeTest.java;fp=parser%2Fyang-parser-rfc7950%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fstmt%2FYangParserNegativeTest.java;h=ad7ce2b243550ad3855707efcae5b19b44283654;hb=d9480cd6eeaf989d8d7059fa468b17fbd2d6dd71;hp=104a4270523bc41b7cbf26355096544ecd99d45d;hpb=7b4b4db3689c9e350f0d3e11f25292876fea237d;p=yangtools.git diff --git a/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserNegativeTest.java b/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserNegativeTest.java index 104a427052..ad7ce2b243 100644 --- a/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserNegativeTest.java +++ b/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YangParserNegativeTest.java @@ -76,7 +76,7 @@ public class YangParserNegativeTest { @Test public void testInvalidRange() { final SomeModifiersUnresolvedException ex = assertThrows(SomeModifiersUnresolvedException.class, - () -> TestUtils.loadModuleResources(getClass(), "/negative-scenario/testfile6.yang")); + () -> TestUtils.parseYangSource("/negative-scenario/testfile6.yang")); final Throwable cause = ex.getCause(); assertThat(cause, isA(SourceException.class)); assertThat(cause.getMessage(), startsWith("Invalid range constraint: [[5..20]]")); @@ -85,7 +85,7 @@ public class YangParserNegativeTest { @Test public void testDuplicateContainer() { final SomeModifiersUnresolvedException ex = assertThrows(SomeModifiersUnresolvedException.class, - () -> TestUtils.loadModuleResources(getClass(), "/negative-scenario/duplicity/container.yang")); + () -> TestUtils.parseYangSource("/negative-scenario/duplicity/container.yang")); final Throwable cause = ex.getCause(); assertThat(cause, isA(SourceException.class)); assertThat(cause.getMessage(), containsString("Error in module 'container': cannot add " @@ -96,7 +96,7 @@ public class YangParserNegativeTest { @Test public void testDuplicateContainerList() { final SomeModifiersUnresolvedException ex = assertThrows(SomeModifiersUnresolvedException.class, - () -> TestUtils.loadModuleResources(getClass(), "/negative-scenario/duplicity/container-list.yang")); + () -> TestUtils.parseYangSource("/negative-scenario/duplicity/container-list.yang")); final Throwable cause = ex.getCause(); assertThat(cause, isA(SourceException.class)); assertThat(cause.getMessage(), containsString("Error in module 'container-list': cannot add " @@ -107,7 +107,7 @@ public class YangParserNegativeTest { @Test public void testDuplicateContainerLeaf() { final SomeModifiersUnresolvedException ex = assertThrows(SomeModifiersUnresolvedException.class, - () -> TestUtils.loadModuleResources(getClass(), "/negative-scenario/duplicity/container-leaf.yang")); + () -> TestUtils.parseYangSource("/negative-scenario/duplicity/container-leaf.yang")); final Throwable cause = ex.getCause(); assertThat(cause, isA(SourceException.class)); assertThat(cause.getMessage(), containsString("Error in module 'container-leaf': cannot add " @@ -118,7 +118,7 @@ public class YangParserNegativeTest { @Test public void testDuplicateTypedef() { final SomeModifiersUnresolvedException ex = assertThrows(SomeModifiersUnresolvedException.class, - () -> TestUtils.loadModuleResources(getClass(), "/negative-scenario/duplicity/typedef.yang")); + () -> TestUtils.parseYangSource("/negative-scenario/duplicity/typedef.yang")); final Throwable cause = ex.getCause(); assertThat(cause, isA(SourceException.class)); assertThat(cause.getMessage(), startsWith( @@ -161,7 +161,7 @@ public class YangParserNegativeTest { @Test public void testInvalidListKeyDefinition() { final SomeModifiersUnresolvedException ex = assertThrows(SomeModifiersUnresolvedException.class, - () -> TestUtils.loadModuleResources(getClass(), "/negative-scenario/invalid-list-key-def.yang")); + () -> TestUtils.parseYangSource("/negative-scenario/invalid-list-key-def.yang")); final Throwable cause = ex.getCause(); assertThat(cause, isA(InferenceException.class)); assertThat(cause.getMessage(), startsWith(