Fix type ordering assumptions 42/67242/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 17 Jan 2018 15:58:59 +0000 (16:58 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 17 Jan 2018 15:58:59 +0000 (16:58 +0100)
There are two types in this test with the same name. Do not assume
they will be reported in a particular order, but rather pick the
correct one for testing.

Change-Id: I0593b6505d7aec985504e92f8487b562c96c2a7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/GeneratedTypesLeafrefTest.java

index 1d1e691bb306dbbd3fb3ea17f7e28ad79f4317a2..6cad8aa404905a7d77105354fdfb42b23595b16e 100644 (file)
@@ -50,7 +50,9 @@ public class GeneratedTypesLeafrefTest {
         GeneratedType gtTopology = null;
         for (final Type type : genTypes) {
             String name = type.getName();
-            if ("InterfaceKey".equals(name)) {
+            if ("InterfaceKey".equals(name)
+                    && "org.opendaylight.yang.gen.v1.urn.model._abstract.topology.rev130208.topology.interfaces".equals(
+                        type.getPackageName())) {
                 gtIfcKey = (GeneratedTransferObject) type;
             } else if ("Interface".equals(name)) {
                 gtIfc = (GeneratedType) type;