use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncSensorMetaDataJobTest method createAsset1.
Asset createAsset1() {
Asset asset = new Asset();
asset.setAssetName("pek-wor-pdu-02");
asset.setAssetNumber(89765);
asset.setAssetSource("po09imkhdplbvf540fwusy67n");
asset.setCategory(AssetCategory.PDU);
asset.setModel("Dell 750");
asset.setManufacturer("Dell");
return asset;
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncSensorMetaDataJobTest method createAsset.
Asset createAsset() {
Asset asset = new Asset();
asset.setAssetName("pek-wor-sensor-02");
asset.setAssetNumber(12345);
asset.setAssetSource("l9i8728d55368540fcba1692");
asset.setCategory(AssetCategory.Sensors);
HashMap<String, String> justificationfields = generateExtraInfo("106");
asset.setJustificationfields(justificationfields);
asset.setModel("Dell 750");
asset.setManufacturer("Dell");
return asset;
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncSensorMetaDataJobTest method getAssets.
public List<Asset> getAssets(AssetCategory category) {
List<Asset> assets = new ArrayList<Asset>();
switch(category) {
case Sensors:
assets.add(createAsset());
break;
case PDU:
Asset pdu = createAsset1();
pdu.setFloor("1st");
pdu.setRoom("SJC31");
pdu.setBuilding("2805 Lafayette St");
pdu.setCity("Santa Clara");
pdu.setCountry("USA");
pdu.setRegion("NASA");
assets.add(pdu);
break;
default:
break;
}
return assets;
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncSensorMetaDataJobTest method testAggregatorSensorIdAndSourceForPdu3.
@Test
public void testAggregatorSensorIdAndSourceForPdu3() {
Asset pdu = createAsset1();
HashMap<String, String> justificationfields = new HashMap<String, String>();
justificationfields.put(AssetSubCategory.Temperature.toString(), "509_l9i8728d55368540fcba1692");
pdu.setJustificationfields(justificationfields);
Sensor sensor = new Sensor();
sensor.setId(606);
sensor.setType(PowerIQService.HumiditySensor);
String source = "l9i8728d55368540fcba1692";
pdu = powerIQService.aggregatorSensorIdAndSourceForPdu(pdu, sensor, source);
TestCase.assertEquals(sensor.getId() + FlowgateConstant.SEPARATOR + source, pdu.getJustificationfields().get(AssetSubCategory.Humidity.toString()));
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncSensorMetaDataJobTest method testAggregatorSensorIdAndSourceForPdu2.
@Test
public void testAggregatorSensorIdAndSourceForPdu2() {
Asset pdu = createAsset1();
HashMap<String, String> justificationfields = new HashMap<String, String>();
String filed = "509" + FlowgateConstant.SEPARATOR + "l9i8728d55368540fcba1692,606" + FlowgateConstant.SEPARATOR + "l9i8728d55368540fcba1692";
justificationfields.put(AssetSubCategory.Humidity.toString(), filed);
pdu.setJustificationfields(justificationfields);
Sensor sensor = new Sensor();
sensor.setId(610);
sensor.setType(PowerIQService.HumiditySensor);
String source = "l9i8728d55368540fcba1692";
pdu = powerIQService.aggregatorSensorIdAndSourceForPdu(pdu, sensor, source);
TestCase.assertEquals(filed + FlowgateConstant.SPILIT_FLAG + sensor.getId() + FlowgateConstant.SEPARATOR + source, pdu.getJustificationfields().get(AssetSubCategory.Humidity.toString()));
}
Aggregations