@Test public void testGetVMs() { System.out.println("getVMs"); RestVMClient instance = new RestVMClient("threeTierWebApp", "478"); String result = instance.getVMs(String.class); try { JAXBContext jaxbContext = JAXBContext.newInstance(VM.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); VM vmFromRest = (VM) jaxbUnmarshaller.unmarshal(new StringReader(result)); assertEquals(33, vmFromRest.getId()); assertEquals("0.0.0.0", vmFromRest.getIp()); assertEquals("ACTIVE", vmFromRest.getStatus()); } catch (JAXBException ex) { Logger.getLogger(RestVMClientTest.class.getName()).log(Level.SEVERE, null, ex); } }
public <T> T getVMs(Class<T> responseType) throws UniformInterfaceException { WebResource resource = webResource; return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType); }
RestVMClient { public <T> T getVMs(Class<T> responseType) throws UniformInterfaceException { WebResource resource = webResource; return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType); } }
RestVMClient { public <T> T getVMs(Class<T> responseType) throws UniformInterfaceException { WebResource resource = webResource; return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType); } RestVMClient(String applicationName, String deploymentId); }
RestVMClient { public <T> T getVMs(Class<T> responseType) throws UniformInterfaceException { WebResource resource = webResource; return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType); } RestVMClient(String applicationName, String deploymentId); void setResourcePath(String applicationName, String deploymentId); T getEnergySample(Class<T> responseType, String vmId, String eventId, String startTime, String interval, String endTime); T getPowerConsumption(Class<T> responseType, String vmId, String startTime, String endTime); T getCostEstimation(Class<T> responseType, String vmId, String eventId); T getVM(Class<T> responseType, String vmId); ClientResponse postVM(Object requestEntity); T getEnergyConsumption(Class<T> responseType, String vmId, String startTime, String endTime); ClientResponse deleteVM(String vm_id); T getVMs(Class<T> responseType); T getEnergyEstimation(Class<T> responseType, String vmId, String duration); T getEventPowerConsumption(Class<T> responseType, String vmId, String eventId, String startTime, String endTime); T getPowerEstimationForAnEvent(Class<T> responseType, String vmId, String eventId); T getPowerEstimation(Class<T> responseType, String vmId); T getEventEnergyConsumption(Class<T> responseType, String vmId, String eventId, String startTime, String endTime); T getEnergyEstimationForAnEvent(Class<T> responseType, String vmId, String eventId, String duration); void close(); }
RestVMClient { public <T> T getVMs(Class<T> responseType) throws UniformInterfaceException { WebResource resource = webResource; return resource.accept(javax.ws.rs.core.MediaType.APPLICATION_XML).get(responseType); } RestVMClient(String applicationName, String deploymentId); void setResourcePath(String applicationName, String deploymentId); T getEnergySample(Class<T> responseType, String vmId, String eventId, String startTime, String interval, String endTime); T getPowerConsumption(Class<T> responseType, String vmId, String startTime, String endTime); T getCostEstimation(Class<T> responseType, String vmId, String eventId); T getVM(Class<T> responseType, String vmId); ClientResponse postVM(Object requestEntity); T getEnergyConsumption(Class<T> responseType, String vmId, String startTime, String endTime); ClientResponse deleteVM(String vm_id); T getVMs(Class<T> responseType); T getEnergyEstimation(Class<T> responseType, String vmId, String duration); T getEventPowerConsumption(Class<T> responseType, String vmId, String eventId, String startTime, String endTime); T getPowerEstimationForAnEvent(Class<T> responseType, String vmId, String eventId); T getPowerEstimation(Class<T> responseType, String vmId); T getEventEnergyConsumption(Class<T> responseType, String vmId, String eventId, String startTime, String endTime); T getEnergyEstimationForAnEvent(Class<T> responseType, String vmId, String eventId, String duration); void close();  }