Package org.apache.deltacloud.client.unmarshal

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


  @Test
  public void realmsMayBeUnmarshalled() throws DeltaCloudClientException {
    ByteArrayInputStream inputStream = new ByteArrayInputStream(RealmsResponse.response.getBytes());
    List<Realm> realms = new ArrayList<Realm>();
    new RealmsUnmarshaller().unmarshall(inputStream, realms);
    assertEquals(2, realms.size());

    Realm realm = realms.get(0);
    assertEquals(RealmsResponse.id1, realm.getId());
    assertEquals(RealmsResponse.name1, realm.getName());
View Full Code Here


  @Override
  public List<Realm> listRealms() throws DeltaCloudClientException {
    try {
      InputStream inputStream = request(new ListRealmsRequest(baseUrl));
      List<Realm> realms = new ArrayList<Realm>();
      new RealmsUnmarshaller().unmarshall(inputStream, realms);
      return realms;
    } catch (Exception e) {
      throw new DeltaCloudClientException(
          MessageFormat.format("could not get realms on cloud at \"{0}\"", baseUrl), e);
    }
View Full Code Here

TOP

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

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.