use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncWiremapDataJobTest method createPdu.
Asset createPdu() {
Asset asset = new Asset();
asset.setAssetName("ams5-k03-b-pdu");
asset.setAssetNumber(328076);
asset.setAssetSource("5c74da749662e398e01f665f");
asset.setCategory(AssetCategory.PDU);
return asset;
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncWiremapDataJobTest method generatorWiremapDataTest1.
@Test
public void generatorWiremapDataTest1() {
Asset assetFromflowgate = createServer();
EndDevice net1 = new EndDevice();
net1.setEndDeviceAssetId("5c8749469662e32e2470d654");
net1.setEndDeviceName("w4-pek2");
net1.setEndPort("onboard-1");
net1.setStartPort("03");
EndDevice net2 = new EndDevice();
net2.setEndDeviceAssetId("5c778c598ecf859960e2be30");
net2.setEndDeviceName("sin2-build-rdev1");
net2.setEndPort("onboard-1");
net2.setStartPort("01");
HashSet<String> nets = new HashSet<String>();
HashMap<String, String> fileds = new HashMap<String, String>();
nets.add(net1.toString());
nets.add(net2.toString());
fileds.put(FlowgateConstant.NETWORK_PORT_FOR_SERVER, String.join(FlowgateConstant.SPILIT_FLAG, nets));
assetFromflowgate.setJustificationfields(fileds);
Map<String, String> network = new HashMap<String, String>();
network.put("sin2-build-rdev1", "5c778c598ecf859960e2be30");
Map<String, String> pdu = new HashMap<String, String>();
pdu.put("w3r17c05-pdu4", "wertbhukloiup5996q23df530");
List<EndDevice> devices = getDevices();
Asset asset = labsdbService.generatorWiremapData(assetFromflowgate, pdu, devices, network);
List<String> networks = asset.getSwitches();
TestCase.assertEquals("5c778c598ecf859960e2be30", networks.get(0));
String networkdevices = asset.getJustificationfields().get(FlowgateConstant.NETWORK_PORT_FOR_SERVER);
String expectValue = String.join(FlowgateConstant.SPILIT_FLAG, nets);
TestCase.assertEquals(expectValue, networkdevices);
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncWiremapDataJobTest method filterServersTest4.
// PduMappingStatus and NetworkMappingStatus is not null
@Test
public void filterServersTest4() {
List<Asset> servers = new ArrayList<Asset>();
Asset asset1 = new Asset();
asset1.setId("5c778c598ecf859960e2c2a0");
asset1.setAssetName("w1-lil-c-016");
asset1.setAssetNumber(33503);
asset1.setAssetSource("5c74da749662e398e01f665f");
asset1.setCategory(AssetCategory.Server);
asset1.setModel("Dell");
asset1.setManufacturer("Dell");
AssetStatus assetstatus = new AssetStatus();
assetstatus.setStatus(AssetStatus.Status.Active);
assetstatus.setPduMapping(PduMapping.MAPPEDBYLABSDB);
assetstatus.setNetworkMapping(NetworkMapping.MAPPEDBYLABSDB);
asset1.setStatus(assetstatus);
Asset asset = new Asset();
asset.setId("5c778c598ecf859960e2d395");
asset.setAssetName("w1-eeqa-fas3250-01");
asset.setAssetNumber(53135);
asset.setAssetSource("5c74da749662e398e01f665f");
asset.setCategory(AssetCategory.Server);
asset.setModel("NetApp");
asset.setManufacturer("NetApp");
AssetStatus status = new AssetStatus();
status.setStatus(AssetStatus.Status.Active);
asset.setStatus(status);
servers.add(asset);
servers.add(asset1);
List<Asset> assetResult = labsdbService.filterServers(servers);
TestCase.assertEquals(1, assetResult.size());
for (Asset asset2 : assetResult) {
if (asset2.getAssetName().equals("w1-eeqa-fas3250-01")) {
TestCase.assertEquals("5c778c598ecf859960e2d395", asset2.getId());
}
}
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncWiremapDataJobTest method createNetWork.
Asset createNetWork() {
Asset asset = new Asset();
asset.setAssetName("w1s04-edge-x450-1");
asset.setAssetNumber(6443);
asset.setAssetSource("5c74da749662e398e01f665f");
asset.setCategory(AssetCategory.Networks);
asset.setModel("Extreme Networks");
asset.setManufacturer("Extreme Networks Summit X450a-48t");
return asset;
}
use of com.vmware.flowgate.common.model.Asset in project flowgate by vmware.
the class SyncWiremapDataJobTest method createServer.
Asset createServer() {
Asset asset = new Asset();
asset.setId("5c778c598ecf859960e2d395");
asset.setAssetName("w1-eeqa-fas3250-01");
asset.setAssetNumber(53135);
asset.setAssetSource("5c74da749662e398e01f665f");
asset.setCategory(AssetCategory.Server);
asset.setModel("NetApp");
asset.setManufacturer("NetApp");
return asset;
}
Aggregations