@Test public void testGetVMs() { System.out.println("getVMs"); OvfDefinition deploymentOVF = null; Collection<VM> expResult = new ArrayList<>(); Collection<VM> result = EnergyModeller.getVMs(deploymentOVF); assertEquals(expResult, result); deploymentOVF = getSampleOVF(); expResult.add(new VM(1, 512, 0.87890625)); result = EnergyModeller.getVMs(deploymentOVF); assertEquals(expResult, result); }
public static Collection<VM> getVMs(OvfDefinition deploymentOVF) { ArrayList<VM> answer = new ArrayList<>(); if (deploymentOVF == null) { return answer; } DiskSection diskSection = deploymentOVF.getDiskSection(); VirtualSystemCollection vmsSection = deploymentOVF.getVirtualSystemCollection(); String deploymentId = getDeploymentID(deploymentOVF); for (VirtualSystem virtualMachine : vmsSection.getVirtualSystemArray()) { VM vm = getVM(deploymentId, virtualMachine, diskSection); answer.add(vm); } return answer; }
OVFConverterFactory { public static Collection<VM> getVMs(OvfDefinition deploymentOVF) { ArrayList<VM> answer = new ArrayList<>(); if (deploymentOVF == null) { return answer; } DiskSection diskSection = deploymentOVF.getDiskSection(); VirtualSystemCollection vmsSection = deploymentOVF.getVirtualSystemCollection(); String deploymentId = getDeploymentID(deploymentOVF); for (VirtualSystem virtualMachine : vmsSection.getVirtualSystemArray()) { VM vm = getVM(deploymentId, virtualMachine, diskSection); answer.add(vm); } return answer; } }
OVFConverterFactory { public static Collection<VM> getVMs(OvfDefinition deploymentOVF) { ArrayList<VM> answer = new ArrayList<>(); if (deploymentOVF == null) { return answer; } DiskSection diskSection = deploymentOVF.getDiskSection(); VirtualSystemCollection vmsSection = deploymentOVF.getVirtualSystemCollection(); String deploymentId = getDeploymentID(deploymentOVF); for (VirtualSystem virtualMachine : vmsSection.getVirtualSystemArray()) { VM vm = getVM(deploymentId, virtualMachine, diskSection); answer.add(vm); } return answer; }  }
OVFConverterFactory { public static Collection<VM> getVMs(OvfDefinition deploymentOVF) { ArrayList<VM> answer = new ArrayList<>(); if (deploymentOVF == null) { return answer; } DiskSection diskSection = deploymentOVF.getDiskSection(); VirtualSystemCollection vmsSection = deploymentOVF.getVirtualSystemCollection(); String deploymentId = getDeploymentID(deploymentOVF); for (VirtualSystem virtualMachine : vmsSection.getVirtualSystemArray()) { VM vm = getVM(deploymentId, virtualMachine, diskSection); answer.add(vm); } return answer; }  static Collection<VM> getVMs(OvfDefinition deploymentOVF); static VM getVM(String deploymentId, VirtualSystem virtualMachine, DiskSection diskSection); static String findHostRosourceId(String hostResource); }
OVFConverterFactory { public static Collection<VM> getVMs(OvfDefinition deploymentOVF) { ArrayList<VM> answer = new ArrayList<>(); if (deploymentOVF == null) { return answer; } DiskSection diskSection = deploymentOVF.getDiskSection(); VirtualSystemCollection vmsSection = deploymentOVF.getVirtualSystemCollection(); String deploymentId = getDeploymentID(deploymentOVF); for (VirtualSystem virtualMachine : vmsSection.getVirtualSystemArray()) { VM vm = getVM(deploymentId, virtualMachine, diskSection); answer.add(vm); } return answer; }  static Collection<VM> getVMs(OvfDefinition deploymentOVF); static VM getVM(String deploymentId, VirtualSystem virtualMachine, DiskSection diskSection); static String findHostRosourceId(String hostResource);  }