package org.rackspace.stingray.client.integration;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openstack.atlas.util.crypto.exception.DecryptException;
import org.rackspace.stingray.client.StingrayRestClient;
import org.rackspace.stingray.client.exception.StingrayRestClientException;
import org.rackspace.stingray.client.exception.StingrayRestClientObjectNotFoundException;
import org.rackspace.stingray.client.pool.Pool;
import org.rackspace.stingray.client.pool.PoolBasic;
import org.rackspace.stingray.client.pool.PoolProperties;
public class ClientExceptionITest extends StingrayTestBase {
//Verify marshaling of all exception messages...
String vsName;
Pool pool;
PoolProperties poolProperties;
PoolBasic poolBasic;
@Before
@Override
public void standUp() throws DecryptException {
super.standUp();
vsName = TESTNAME;
pool = new Pool();
poolProperties = new PoolProperties();
poolBasic = new PoolBasic();
poolProperties.setBasic(poolBasic);
pool.setProperties(poolProperties);
}
/**
* Tests the creation of a Pool
* Verifies using get and a comparison of content contained
*
* @throws org.rackspace.stingray.client.exception.StingrayRestClientException,
* StingrayRestClientObjectNotFoundException
*/
@Test
public void testCreatePool() throws StingrayRestClientException, StingrayRestClientObjectNotFoundException {
pool.getProperties().setHttp(null);
Pool createdPool = client.createPool(vsName, pool);
Assert.assertNotNull(createdPool);
Pool retrievedPool = client.getPool(vsName);
Assert.assertNotNull(retrievedPool);
client.deletePool(vsName);
}
}