From 3573880a7b68e6b7b2d66a6fa652288a04701133 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Sat, 20 Jun 2015 05:06:56 -0400 Subject: [PATCH] Make leafrefFromLeafListToLeafTest impervious to list order In NnToJsonLeafrefType#leafrefFromLeafListToLeafTest, the leaf list is unordered but the regex expects a certain order based on the way the list is currently hashed. But this makes it susceptible to failure if something changes upstream to alter the order. So I changed the regex to not depend on the order. Note: an upcoming yang tools patch will alter the order as a side effect that affects this test. Change-Id: Ibf95271b008134c3f75fc99c9ee7ba0d643dfe7a Signed-off-by: Tom Pantelis --- .../sal/restconf/impl/nn/to/json/test/NnToJsonLeafrefType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/json/test/NnToJsonLeafrefType.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/json/test/NnToJsonLeafrefType.java index 65fcc668bc..132b9f1e10 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/json/test/NnToJsonLeafrefType.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/nn/to/json/test/NnToJsonLeafrefType.java @@ -71,7 +71,7 @@ public class NnToJsonLeafrefType extends AbstractBodyReaderTest { public void leafrefFromLeafListToLeafTest() throws Exception { final String json = toJson("/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml"); validateJson( - ".*\"cont-augment-module\\p{Blank}*:\\p{Blank}*lflst1\":\\p{Blank}*.*\"346\",*\"347\",*\"345\".*", + ".*\"cont-augment-module\\p{Blank}*:\\p{Blank}*lflst1\":\\p{Blank}*.*\"34[5|6|7]\",*\"34[5|6|7]\",*\"34[5|6|7]\".*", json); } -- 2.36.6