Bug 6244: Add context to exceptions thrown by yang statement parser
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / Bug6131Test.java
index e8d1f752a01dade8f944221ab7556eee398c4049..ebab29e3b19dc420ecf01d3161004f244fa97a2b 100644 (file)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.yangtools.yang.stmt;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.FileNotFoundException;
 import java.net.URISyntaxException;
@@ -21,8 +22,9 @@ public class Bug6131Test {
     public void test() throws ReactorException, SourceException, FileNotFoundException, URISyntaxException {
         try {
             StmtTestUtils.parseYangSources("/bugs/bug6131");
+            fail("A NullPointerException should have been thrown.");
         } catch (final Exception e) {
-            assertEquals("Malformed source. Valid root element is missing.", e.getMessage());
+            assertTrue(e instanceof NullPointerException);
         }
     }
 }
\ No newline at end of file