@Test public void validation() throws JSONException { JSONObject jsonObject; jsonObject = TestUtils.getJsonHardwareLayout("", getDatacenters()); failValidation(jsonObject); jsonObject = TestUtils.getJsonHardwareLayout("Beta", getDatacentersWithDuplicateDisks()); failValidation(jsonObject); jsonObject = TestUtils.getJsonHardwareLayout("Beta", getDatacentersWithDuplicateDataNodes()); failValidation(jsonObject); jsonObject = TestUtils.getJsonHardwareLayout("Beta", getDuplicateDatacenters()); failValidation(jsonObject); }
public List<Datacenter> getDatacenters() { return datacenters; }
HardwareLayout { public List<Datacenter> getDatacenters() { return datacenters; } }
HardwareLayout { public List<Datacenter> getDatacenters() { return datacenters; } HardwareLayout(JSONObject jsonObject, ClusterMapConfig clusterMapConfig); }
HardwareLayout { public List<Datacenter> getDatacenters() { return datacenters; } HardwareLayout(JSONObject jsonObject, ClusterMapConfig clusterMapConfig); String getClusterName(); long getVersion(); List<Datacenter> getDatacenters(); long getRawCapacityInBytes(); long getDatacenterCount(); long getDataNodeCount(); long getDiskCount(); long getDataNodeInHardStateCount(HardwareState hardwareState); long calculateUnavailableDataNodeCount(); long getDiskInHardStateCount(HardwareState hardwareState); long calculateUnavailableDiskCount(); Datacenter findDatacenter(String datacenterName); Datacenter findDatacenter(byte id); DataNode findDataNode(String hostname, int port); Disk findDisk(String hostname, int port, String mountPath); JSONObject toJSONObject(); @Override String toString(); @Override boolean equals(Object o); }
HardwareLayout { public List<Datacenter> getDatacenters() { return datacenters; } HardwareLayout(JSONObject jsonObject, ClusterMapConfig clusterMapConfig); String getClusterName(); long getVersion(); List<Datacenter> getDatacenters(); long getRawCapacityInBytes(); long getDatacenterCount(); long getDataNodeCount(); long getDiskCount(); long getDataNodeInHardStateCount(HardwareState hardwareState); long calculateUnavailableDataNodeCount(); long getDiskInHardStateCount(HardwareState hardwareState); long calculateUnavailableDiskCount(); Datacenter findDatacenter(String datacenterName); Datacenter findDatacenter(byte id); DataNode findDataNode(String hostname, int port); Disk findDisk(String hostname, int port, String mountPath); JSONObject toJSONObject(); @Override String toString(); @Override boolean equals(Object o);  }