Fix to remove camel case for Northbound API 99/999/3
authorPramila Singh <pramisin@cisco.com>
Mon, 26 Aug 2013 16:50:34 +0000 (09:50 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 26 Aug 2013 21:00:42 +0000 (21:00 +0000)
Change-Id: I2d13e9d53b0d73504c15d32a57207110d70afb3a
Signed-off-by: Pramila Singh <pramisin@cisco.com>
15 files changed:
opendaylight/northbound/integrationtest/src/test/java/org/opendaylight/controller/northbound/integrationtest/NorthboundIT.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Actions.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Bandwidth.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Buffers.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Capabilities.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Config.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Description.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ForwardingMode.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Latency.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/MacAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Name.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/State.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Tables.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Tier.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/TimeStamp.java

index dfc4b49..b4c3e1e 100644 (file)
@@ -208,29 +208,29 @@ public class NorthboundIT {
         if (timestamp == null || timestampName == null) {
             Assert.assertFalse(properties.has("timeStamp"));
         } else {
-            Assert.assertEquals(timestamp, (Integer) properties.getJSONObject("timeStamp").getInt("timestamp"));
-            Assert.assertEquals(timestampName, properties.getJSONObject("timeStamp").getString("timestampName"));
+            Assert.assertEquals(timestamp, (Integer) properties.getJSONObject("timeStamp").getInt("value"));
+            Assert.assertEquals(timestampName, properties.getJSONObject("timeStamp").getString("name"));
         }
         if (actionsValue == null) {
             Assert.assertFalse(properties.has("actions"));
         } else {
-            Assert.assertEquals(actionsValue, (Integer) properties.getJSONObject("actions").getInt("actionsValue"));
+            Assert.assertEquals(actionsValue, (Integer) properties.getJSONObject("actions").getInt("value"));
         }
         if (capabilitiesValue == null) {
             Assert.assertFalse(properties.has("capabilities"));
         } else {
             Assert.assertEquals(capabilitiesValue,
-                    (Integer) properties.getJSONObject("capabilities").getInt("capabilitiesValue"));
+                    (Integer) properties.getJSONObject("capabilities").getInt("value"));
         }
         if (tablesValue == null) {
             Assert.assertFalse(properties.has("tables"));
         } else {
-            Assert.assertEquals(tablesValue, (Integer) properties.getJSONObject("tables").getInt("tablesValue"));
+            Assert.assertEquals(tablesValue, (Integer) properties.getJSONObject("tables").getInt("value"));
         }
         if (buffersValue == null) {
             Assert.assertFalse(properties.has("buffers"));
         } else {
-            Assert.assertEquals(buffersValue, (Integer) properties.getJSONObject("buffers").getInt("buffersValue"));
+            Assert.assertEquals(buffersValue, (Integer) properties.getJSONObject("buffers").getInt("value"));
         }
     }
 
@@ -249,18 +249,18 @@ public class NorthboundIT {
         if (state == null) {
             Assert.assertFalse(properties.has("state"));
         } else {
-            Assert.assertEquals(state, (Integer) properties.getJSONObject("state").getInt("stateValue"));
+            Assert.assertEquals(state, (Integer) properties.getJSONObject("state").getInt("value"));
         }
         if (capabilities == null) {
             Assert.assertFalse(properties.has("capabilities"));
         } else {
             Assert.assertEquals(capabilities,
-                    (Integer) properties.getJSONObject("capabilities").getInt("capabilitiesValue"));
+                    (Integer) properties.getJSONObject("capabilities").getInt("value"));
         }
         if (bandwidth == null) {
             Assert.assertFalse(properties.has("bandwidth"));
         } else {
-            Assert.assertEquals(bandwidth, (Integer) properties.getJSONObject("bandwidth").getInt("bandwidthValue"));
+            Assert.assertEquals(bandwidth, (Integer) properties.getJSONObject("bandwidth").getInt("value"));
         }
 
     }
@@ -499,8 +499,8 @@ public class NorthboundIT {
         json = new JSONObject(jt);
         node = getJsonInstance(json, "nodeProperties", nodeId_1);
         Assert.assertNotNull(node);
-        Assert.assertEquals(1001, node.getJSONObject("properties").getJSONObject("tier").getInt("tierValue"));
-        Assert.assertEquals("node1", node.getJSONObject("properties").getJSONObject("description").getString("descriptionValue"));
+        Assert.assertEquals(1001, node.getJSONObject("properties").getJSONObject("tier").getInt("value"));
+        Assert.assertEquals("node1", node.getJSONObject("properties").getJSONObject("description").getString("value"));
 
         // Test delete nodeConnector property
         // Delete state property of nodeconnector1
@@ -1091,9 +1091,9 @@ public class NorthboundIT {
                 Assert.assertEquals(tailNode.getString("@type"),nodeType);
                 Assert.assertEquals(tailNode.getString("@type"), nodeConnType);
                 Assert.assertEquals(tailNC.getLong("@id"), tailNC1_nodeConnId);
-                Assert.assertEquals(bandw.getLong("bandwidthValue"), bw_1);
-                Assert.assertTrue((short) stt.getInt("stateValue") == state_1);
-                Assert.assertEquals(ltc.getLong("latencyValue"), lat_1);
+                Assert.assertEquals(bandw.getLong("value"), bw_1);
+                Assert.assertTrue((short) stt.getInt("value") == state_1);
+                Assert.assertEquals(ltc.getLong("value"), lat_1);
             } else if (headNC.getInt("@id") == headNC2_nodeConnId) {
                 Assert.assertEquals(headNode.getString("@type"),nodeType);
                 Assert.assertEquals(headNode.getLong("@id"), headNC2_nodeId);
@@ -1102,9 +1102,9 @@ public class NorthboundIT {
                 Assert.assertTrue(tailNode.getInt("@id") == tailNC2_nodeId);
                 Assert.assertEquals(tailNC.getString("@type"), nodeConnType);
                 Assert.assertEquals(tailNC.getLong("@id"), tailNC2_nodeConnId);
-                Assert.assertEquals(bandw.getLong("bandwidthValue"), bw_2);
-                Assert.assertTrue((short) stt.getInt("stateValue") == state_2);
-                Assert.assertEquals(ltc.getLong("latencyValue"), lat_2);
+                Assert.assertEquals(bandw.getLong("value"), bw_2);
+                Assert.assertTrue((short) stt.getInt("value") == state_2);
+                Assert.assertEquals(ltc.getLong("value"), lat_2);
             }
         }
 
index 135a67d..c268008 100644 (file)
@@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 public class Actions extends Property {
         private static final long serialVersionUID = 1L;
-    @XmlElement
+    @XmlElement(name="value")
     private int actionsValue;
 
     public enum ActionType {
@@ -69,6 +69,7 @@ public class Actions extends Property {
         this.actionsValue = 0;
     }
 
+    @Override
     public Actions clone() {
         return new Actions(this.actionsValue);
     }
index 8048cf8..1282d5e 100644 (file)
@@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 public class Bandwidth extends Property {
     private static final long serialVersionUID = 1L;
 
-    @XmlElement
+    @XmlElement(name="value")
     protected long bandwidthValue;
 
     public static final long BWUNK = 0;
@@ -71,6 +71,7 @@ public class Bandwidth extends Property {
         super(name);
     }
 
+    @Override
     public Bandwidth clone() {
         return new Bandwidth(this.bandwidthValue);
     }
index 99089d9..6d7369d 100644 (file)
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 public class Buffers extends Property {
         private static final long serialVersionUID = 1L;
-    @XmlElement
+    @XmlElement(name="value")
     private int buffersValue;
 
     public static final String BuffersPropName = "buffers";
@@ -46,6 +46,7 @@ public class Buffers extends Property {
         this.buffersValue = 0;
     }
 
+    @Override
     public Buffers clone() {
         return new Buffers(this.buffersValue);
     }
index fb121d7..7867b93 100644 (file)
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 public class Capabilities extends Property {
         private static final long serialVersionUID = 1L;
-    @XmlElement
+    @XmlElement(name="value")
     private int capabilitiesValue;
 
     public enum CapabilitiesType {
@@ -63,6 +63,7 @@ public class Capabilities extends Property {
         this.capabilitiesValue = 0;
     }
 
+    @Override
     public Capabilities clone() {
         return new Capabilities(this.capabilitiesValue);
     }
index bae984e..ef6efc5 100644 (file)
@@ -19,7 +19,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class Config extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private short configValue;
 
     public static final short ADMIN_DOWN = 0;
@@ -40,6 +40,7 @@ public class Config extends Property {
         this.configValue = config;
     }
 
+    @Override
     public Config clone() {
         return new Config(this.configValue);
     }
index 92cd5b1..6915404 100644 (file)
@@ -9,7 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class Description extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private String descriptionValue;
     public static final String propertyName = "description";
 
@@ -26,6 +26,7 @@ public class Description extends Property {
         this.descriptionValue = description;
     }
 
+    @Override
     public Description clone() {
         return new Description(this.descriptionValue);
     }
index c28eb13..a1d4ff9 100644 (file)
@@ -9,7 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class ForwardingMode extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private final int modeValue;
     public static final int REACTIVE_FORWARDING = 0;
     public static final int PROACTIVE_FORWARDING = 1;
index 818002a..a0ba47b 100644 (file)
@@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 public class Latency extends Property {
     private static final long serialVersionUID = 1L;
 
-    @XmlElement
+    @XmlElement(name="value")
     private long latencyValue;
 
     public static final long LATENCYUNK = 0;
@@ -61,6 +61,7 @@ public class Latency extends Property {
         this.latencyValue = (long) latency;
     }
 
+    @Override
     public Latency clone() {
         return new Latency(this.latencyValue);
     }
index 4470e17..27e74e0 100644 (file)
@@ -22,7 +22,7 @@ import org.opendaylight.controller.sal.utils.HexEncode;
 @XmlAccessorType(XmlAccessType.NONE)
 public class MacAddress extends Property implements Cloneable {
     private static final long serialVersionUID = 1L;
-    @XmlElement(name="macAddress")
+    @XmlElement(name="value")
     private final String address;
     public static final String name = "macAddress";
 
index ddb663f..d35610a 100644 (file)
@@ -18,7 +18,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class Name extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private String nameValue;
     public static final String NamePropName = "name";
 
@@ -35,6 +35,7 @@ public class Name extends Property {
         this.nameValue = name;
     }
 
+    @Override
     public Name clone() {
         return new Name(this.nameValue);
     }
index ba67e0d..058adb6 100644 (file)
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class State extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private short stateValue;
 
     public static final short EDGE_DOWN = 0;
@@ -41,6 +41,7 @@ public class State extends Property {
         this.stateValue = state;
     }
 
+    @Override
     public State clone() {
         return new State(this.stateValue);
     }
index 156a0b8..bd50cf9 100644 (file)
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 public class Tables extends Property {
         private static final long serialVersionUID = 1L;
-    @XmlElement
+    @XmlElement(name="value")
     private byte tablesValue;
 
     public static final String TablesPropName = "tables";
@@ -45,6 +45,7 @@ public class Tables extends Property {
         this.tablesValue = 0;
     }
 
+    @Override
     public Tables clone() {
         return new Tables(this.tablesValue);
     }
index ed4d02b..6756a82 100644 (file)
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class Tier extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private int tierValue;
     public static final String TierPropName = "tier";
 
@@ -37,6 +37,7 @@ public class Tier extends Property {
         this.tierValue = 0;
     }
 
+    @Override
     public Tier clone() {
         return new Tier(this.tierValue);
     }
index a15b3fa..b38ec85 100644 (file)
@@ -25,9 +25,9 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 public class TimeStamp extends Property {
     private static final long serialVersionUID = 1L;
-    @XmlElement
+    @XmlElement(name = "value")
     private long timestamp;
-    @XmlElement
+    @XmlElement(name = "name")
     private String timestampName;
 
     public static final String TimeStampPropName = "timeStamp";
@@ -57,6 +57,7 @@ public class TimeStamp extends Property {
         this.timestampName = null;
     }
 
+    @Override
     public TimeStamp clone() {
         return new TimeStamp(this.timestamp, this.timestampName);
     }