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%2FYT857Test.java;h=c9e2c680b9e720e3885ad243e76826f1eb3b2b52;hb=33c637e8cca6b731c2a75af4a2698f750d1e9b03;hp=834aeac605b78a96b71c936128ed2f497d6ef6a3;hpb=c9543ea06b176ae07a205abe29fc385a7b7548ad;p=yangtools.git diff --git a/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT857Test.java b/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT857Test.java index 834aeac605..c9e2c680b9 100644 --- a/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT857Test.java +++ b/parser/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/YT857Test.java @@ -7,26 +7,14 @@ */ package org.opendaylight.yangtools.yang.stmt; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.startsWith; -import static org.junit.Assert.fail; import org.junit.Test; -import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; -import org.opendaylight.yangtools.yang.parser.spi.source.SourceException; -public class YT857Test { +public class YT857Test extends AbstractYangTest { @Test - public void testConflictDetection() throws Exception { - try { - StmtTestUtils.parseYangSource("/bugs/YT857/foo.yang"); - fail("Conflict on models should have been detected"); - } catch (ReactorException e) { - final Throwable cause = e.getCause(); - assertThat(cause, instanceOf(SourceException.class)); - assertThat(cause.getMessage(), - startsWith("Cannot add data tree child with name (foo)one, a conflicting child already exists")); - } + public void testConflictDetection() { + assertSourceException(startsWith("Cannot add data tree child with name (foo)one, a conflicting" + + " child already exists"), "/bugs/YT857/foo.yang"); } }