Package org.apache.deltacloud.client.unmarshal

Examples of org.apache.deltacloud.client.unmarshal.APIUnmarshaller


  @Test
  public void ec2DriverIsUnmarshalled() throws MalformedURLException, DeltaCloudClientException {
    API api = new API();
    ByteArrayInputStream inputStream = new ByteArrayInputStream(APIResponse.apiResponse.getBytes());
    new APIUnmarshaller().unmarshall(inputStream, api);
    assertNotNull(api);
    assertEquals(APIResponse.driver, api.getDriver().name().toLowerCase());
  }
View Full Code Here


  @Test
  public void invalidDriverUnmarshalledToUnknown() throws MalformedURLException, DeltaCloudClientException {
    API api = new API();
    ByteArrayInputStream inputStream = new ByteArrayInputStream(APIResponse.invalidDriverApiResponse.getBytes());
    new APIUnmarshaller().unmarshall(inputStream, api);
    assertNotNull(api);
    assertEquals(Driver.UNKNOWN, api.getDriver());
  }
View Full Code Here

  }

  public Driver getServerType() {
    try {
      InputStream response = request(new TypeRequest(baseUrl));
      API api = new APIUnmarshaller().unmarshall(response, new API());
      return api.getDriver();
    } catch (DeltaCloudClientException e) {
      return Driver.UNKNOWN;
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.deltacloud.client.unmarshal.APIUnmarshaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.