- JSONArray propsArray = node.getJSONArray("properties");
-
- for (int j = 0; j < propsArray.length(); j++) {
- JSONObject properties = propsArray.getJSONObject(j);
- String propName = properties.getString("name");
- if (propName.equals("timeStamp")) {
- if (timestamp == null || timestampName == null) {
- Assert.assertFalse("Timestamp exist", true);
- } else {
- Assert.assertEquals(timestamp, (Integer) properties.getInt("value"));
- Assert.assertEquals(timestampName, properties.getString("timestampName"));
- }
- }
- if (propName.equals("actions")) {
- if (actionsValue == null) {
- Assert.assertFalse("Actions exist", true);
- } else {
- Assert.assertEquals(actionsValue, (Integer) properties.getInt("value"));
- }
- }
- if (propName.equals("capabilities")) {
- if (capabilitiesValue == null) {
- Assert.assertFalse("Capabilities exist", true);
- } else {
- Assert.assertEquals(capabilitiesValue, (Integer) properties.getInt("value"));
- }
- }
- if (propName.equals("tables")) {
- if (tablesValue == null) {
- Assert.assertFalse("Tables exist", true);
- } else {
- Assert.assertEquals(tablesValue, (Integer) properties.getInt("value"));
- }
- }
- if (propName.equals("buffers")) {
- if (buffersValue == null) {
- Assert.assertFalse("Buffers exist", true);
- } else {
- Assert.assertEquals(buffersValue, (Integer) properties.getInt("value"));
- }
- }
+ JSONObject properties = node.getJSONObject("properties");
+
+ if (timestamp == null || timestampName == null) {
+ Assert.assertFalse(properties.has("timeStamp"));
+ } else {
+ 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("value"));
+ }
+ if (capabilitiesValue == null) {
+ Assert.assertFalse(properties.has("capabilities"));
+ } else {
+ Assert.assertEquals(capabilitiesValue,
+ (Integer) properties.getJSONObject("capabilities").getInt("value"));
+ }
+ if (tablesValue == null) {
+ Assert.assertFalse(properties.has("tables"));
+ } else {
+ 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("value"));