Introduce formatting methods for SourceException
[yangtools.git] / yang / yang-parser-impl / src / test / java / org / opendaylight / yangtools / yang / stmt / retest / YangParserNegativeTest.java
index 80ed386a63fe91b6517d075aa61672a1aa18d743..cd6e6f5ff5443b3ff75440146cfc8812da1fc510 100644 (file)
@@ -96,8 +96,8 @@ public class YangParserNegativeTest {
         } catch (SomeModifiersUnresolvedException e) {
             final Throwable rootCause = Throwables.getRootCause(e);
             assertTrue(rootCause instanceof InferenceException);
-            assertTrue(rootCause.getMessage().startsWith("Augment target not found: Absolute{path=[(urn:simple" +
-                            ".container.demo?revision=1970-01-01)unknown]}"));
+            assertTrue(rootCause.getMessage().startsWith(
+                "Augment target 'Absolute{path=[(urn:simple.container.demo?revision=1970-01-01)unknown]}' not found"));
         }
     }
 
@@ -151,7 +151,7 @@ public class YangParserNegativeTest {
                 fail("SourceException should be thrown");
             }
         } catch (SourceException e) {
-            String expected = "Error in module 'container': can not add '(urn:simple.container" +
+            String expected = "Error in module 'container': cannot add '(urn:simple.container" +
                     ".demo?revision=1970-01-01)foo'. Node name collision: '(urn:simple.container" +
                     ".demo?revision=1970-01-01)foo' already declared.";
             assertTrue(e.getMessage().contains(expected));
@@ -167,7 +167,7 @@ public class YangParserNegativeTest {
                 fail("SourceException should be thrown");
             }
         } catch (SourceException e) {
-            String expected = "Error in module 'container-list': can not add '(urn:simple.container" +
+            String expected = "Error in module 'container-list': cannot add '(urn:simple.container" +
                     ".demo?revision=1970-01-01)foo'. Node name collision: '(urn:simple.container" +
                     ".demo?revision=1970-01-01)foo' already declared.";
             assertTrue(e.getMessage().contains(expected));
@@ -183,7 +183,7 @@ public class YangParserNegativeTest {
                 fail("SourceException should be thrown");
             }
         } catch (SourceException e) {
-            String expected = "Error in module 'container-leaf': can not add '(urn:simple.container" +
+            String expected = "Error in module 'container-leaf': cannot add '(urn:simple.container" +
                     ".demo?revision=1970-01-01)foo'. Node name collision: '(urn:simple.container" +
                     ".demo?revision=1970-01-01)foo' already declared.";
             assertTrue(e.getMessage().contains(expected));
@@ -199,7 +199,7 @@ public class YangParserNegativeTest {
                 fail("SourceException should be thrown");
             }
         } catch (SourceException e) {
-            String expected = "Error in module 'typedef': can not add '(urn:simple.container" +
+            String expected = "Error in module 'typedef': cannot add '(urn:simple.container" +
                     ".demo?revision=1970-01-01)int-ext'. Node name collision: '(urn:simple.container" +
                     ".demo?revision=1970-01-01)int-ext' already declared.";
             assertTrue(e.getMessage().startsWith(expected));