Sort reported nodes 82/19682/2
authorRobert Varga <rovarga@cisco.com>
Tue, 5 May 2015 14:57:26 +0000 (16:57 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 6 May 2015 09:16:41 +0000 (11:16 +0200)
The order of the nodes is asserted by the unit tests -- make sure this
is predictable across JDK versions.

Change-Id: I804024fe66530aa380dbd48907268fc12a4d3085
Signed-off-by: Robert Varga <rovarga@cisco.com>
northbound/src/main/java/org/opendaylight/ovsdb/northbound/NodeResource.java

index a4fc913c0f011167cab3a2c5aa653cbdf5388c2e..034ddff6becd9eb4267e574a7a17414badae528b 100644 (file)
@@ -2,6 +2,7 @@ package org.opendaylight.ovsdb.northbound;
 
 import com.fasterxml.jackson.databind.SerializationFeature;
 import java.io.InputStream;
+import java.util.Collections;
 import java.util.List;
 
 import javax.ws.rs.Consumes;
@@ -99,6 +100,7 @@ public class NodeResource {
         for (Node node : nodes) {
             nodeIds.add(node.getId().getValue());
         }
+        Collections.sort(nodeIds);
 
         String response = objectMapper.writeValueAsString(nodeIds);
         return Response.status(Response.Status.OK)