Package org.apache.deltacloud.client

Examples of org.apache.deltacloud.client.Realm


*/
public class RealmDomUnmarshallingTest {

  @Test
  public void realmMayBeUnmarshalled() throws DeltaCloudClientException {
    Realm realm = new Realm();
    ByteArrayInputStream inputStream = new ByteArrayInputStream(RealmResponseFakes.realmResponse.response.getBytes());
    new RealmUnmarshaller().unmarshall(inputStream, realm);
    assertNotNull(realm);
    assertEquals(RealmResponseFakes.realmResponse.id, realm.getId());
    assertEquals(RealmResponseFakes.realmResponse.name, realm.getName());
    assertEquals(RealmState.valueOf(RealmResponseFakes.realmResponse.state.toUpperCase()), realm.getState());
    assertEquals(RealmResponseFakes.realmResponse.getIntLimit(), realm.getLimit());
  }
View Full Code Here


    assertEquals(RealmResponseFakes.realmResponse.getIntLimit(), realm.getLimit());
  }

  @Test
  public void emptyLimitSetsDefaultLimit() throws DeltaCloudClientException {
    Realm realm = new Realm();
    ByteArrayInputStream inputStream = new ByteArrayInputStream(RealmResponseFakes.invalidLimitRealmResponse.response.getBytes());
    new RealmUnmarshaller().unmarshall(inputStream, realm);
    assertNotNull(realm);
    assertEquals(Realm.LIMIT_DEFAULT, realm.getLimit());
  }
View Full Code Here

    assertEquals(Realm.LIMIT_DEFAULT, realm.getLimit());
  }

  @Test
  public void invalidStateSetsUNKNOWNState() throws DeltaCloudClientException {
    Realm realm = new Realm();
    ByteArrayInputStream inputStream = new ByteArrayInputStream(RealmResponseFakes.invalidLimitRealmResponse.response.getBytes());
    new RealmUnmarshaller().unmarshall(inputStream, realm);
    assertNotNull(realm);
    assertEquals(Realm.LIMIT_DEFAULT, realm.getLimit());
  }
View Full Code Here

    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());

    realm = realms.get(1);
    assertEquals(RealmsResponse.id2, realm.getId());
    assertEquals(RealmsResponse.name2, realm.getName());
  }
View Full Code Here

  }

  @Test
  public void canGetProfile() throws DeltaCloudClientException {
    // get a profile seen in the web UI
    Realm realm = testSetup.getClient().listRealms("eu");
    assertNotNull(realm);
    assertRealm("Europe", Realm.RealmState.AVAILABLE, Realm.LIMIT_DEFAULT, realm);
  }
View Full Code Here

    super("realms", "realm");
  }

  @Override
  protected Realm unmarshallChild(Node node) throws DeltaCloudClientException {
    return new RealmUnmarshaller().unmarshall((Element) node, new Realm());
  }
View Full Code Here

TOP

Related Classes of org.apache.deltacloud.client.Realm

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.