Bug 5882: Wrong placement of deprecated annotation
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / yangtools / sal / binding / generator / impl / GeneratedTypesLeafrefTest.java
index 70d242ee3f0fb73f94190abefcac8db58171234b..944e5f4c0e08fd58b0c1c59412949ab5066e4dbc 100644 (file)
@@ -10,10 +10,10 @@ package org.opendaylight.yangtools.sal.binding.generator.impl;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import com.google.common.io.ByteSource;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -24,7 +24,6 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.Set;
-
 import org.junit.Test;
 import org.opendaylight.yangtools.sal.binding.generator.api.BindingGenerator;
 import org.opendaylight.yangtools.sal.binding.model.api.GeneratedProperty;
@@ -49,7 +48,7 @@ public class GeneratedTypesLeafrefTest {
         return ctx.getModules();
     }
 
-    private SchemaContext resolveSchemaContextFromFiles(final URI... yangFiles) throws IOException {
+    private static SchemaContext resolveSchemaContextFromFiles(final URI... yangFiles) throws IOException {
         final YangContextParser parser = new YangParserImpl();
 
         final List<File> inputFiles = new ArrayList<File>();
@@ -259,9 +258,8 @@ public class GeneratedTypesLeafrefTest {
             bindingGen.generateTypes(context);
             fail("Expected IllegalArgumentException caused by invalid leafref path");
         } catch (IllegalArgumentException e) {
-            String expected = "Failed to find leafref target: ../id";
-            assertEquals(expected, e.getMessage());
+            String expected = "Failed to find leafref target: ../id in module foo (QNameModule{ns=urn:yang.foo, rev=2014-03-10})";
+            assertTrue(e.getMessage().startsWith(expected));
         }
     }
-
 }
\ No newline at end of file