beta-7 regressions

This commit is contained in:
Adrian Cole 2010-09-19 21:30:07 -07:00
parent 1981b15837
commit 0f0710e2f9
39 changed files with 198 additions and 304 deletions

View File

@ -189,33 +189,6 @@
<outputDirectory>providers/aws</outputDirectory> <outputDirectory>providers/aws</outputDirectory>
</fileSet> </fileSet>
<!-- aws extensions: jets3t -->
<fileSet>
<directory>aws/extensions/jets3t/target</directory>
<includes>
<include>jclouds-jets3t-${project.version}.jar</include>
</includes>
<outputDirectory>providers/aws/extensions/jets3t/lib</outputDirectory>
</fileSet>
<fileSet>
<directory>aws/extensions/jets3t/target</directory>
<includes>
<include>jclouds-jets3t-${project.version}-sources.jar</include>
</includes>
<outputDirectory>providers/aws/extensions/jets3t/src</outputDirectory>
</fileSet>
<fileSet>
<directory>aws/extensions/jets3t/target/apidocs</directory>
<outputDirectory>providers/aws/extensions/jets3t/docs</outputDirectory>
</fileSet>
<fileSet>
<directory>aws/extensions/jets3t</directory>
<includes>
<include>README.txt</include>
</includes>
<outputDirectory>providers/aws/extensions/jets3t</outputDirectory>
</fileSet>
<!-- providers: azure --> <!-- providers: azure -->
<fileSet> <fileSet>
<directory>azure/target</directory> <directory>azure/target</directory>
@ -351,6 +324,33 @@
<outputDirectory>providers/rimuhosting</outputDirectory> <outputDirectory>providers/rimuhosting</outputDirectory>
</fileSet> </fileSet>
<!-- providers: bluelock -->
<fileSet>
<directory>vcloud/core/target</directory>
<includes>
<include>jclouds-vcloud-${project.version}.jar</include>
</includes>
<outputDirectory>providers/vcloud/lib</outputDirectory>
</fileSet>
<fileSet>
<directory>vcloud/core/target</directory>
<includes>
<include>jclouds-vcloud-${project.version}-sources.jar</include>
</includes>
<outputDirectory>providers/vcloud/src</outputDirectory>
</fileSet>
<fileSet>
<directory>vcloud/vcloud/target/apidocs</directory>
<outputDirectory>providers/vcloud/docs</outputDirectory>
</fileSet>
<fileSet>
<directory>vcloud/core</directory>
<includes>
<include>README.txt</include>
</includes>
<outputDirectory>providers/vcloud</outputDirectory>
</fileSet>
<!-- providers: bluelock --> <!-- providers: bluelock -->
<fileSet> <fileSet>
<directory>vcloud/core/target</directory> <directory>vcloud/core/target</directory>
@ -433,33 +433,6 @@
<outputDirectory>providers/terremark</outputDirectory> <outputDirectory>providers/terremark</outputDirectory>
</fileSet> </fileSet>
<!-- providers: twitter -->
<fileSet>
<directory>twitter/target</directory>
<includes>
<include>jclouds-twitter-${project.version}.jar</include>
</includes>
<outputDirectory>providers/twitter/lib</outputDirectory>
</fileSet>
<fileSet>
<directory>twitter/target</directory>
<includes>
<include>jclouds-twitter-${project.version}-sources.jar</include>
</includes>
<outputDirectory>providers/twitter/src</outputDirectory>
</fileSet>
<fileSet>
<directory>twitter/target/apidocs</directory>
<outputDirectory>providers/twitter/docs</outputDirectory>
</fileSet>
<fileSet>
<directory>twitter</directory>
<includes>
<include>README.txt</include>
</includes>
<outputDirectory>providers/twitter</outputDirectory>
</fileSet>
<!-- extensions: bouncycastle --> <!-- extensions: bouncycastle -->
<fileSet> <fileSet>
<directory>extensions/bouncycastle/target</directory> <directory>extensions/bouncycastle/target</directory>
@ -568,31 +541,31 @@
<outputDirectory>extensions/joda</outputDirectory> <outputDirectory>extensions/joda</outputDirectory>
</fileSet> </fileSet>
<!-- extensions: httpnio --> <!-- extensions: apachehc -->
<fileSet> <fileSet>
<directory>extensions/httpnio/target</directory> <directory>extensions/apachehc/target</directory>
<includes> <includes>
<include>jclouds-httpnio-${project.version}.jar</include> <include>jclouds-apachehc-${project.version}.jar</include>
</includes> </includes>
<outputDirectory>extensions/httpnio/lib</outputDirectory> <outputDirectory>extensions/apachehc/lib</outputDirectory>
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>extensions/httpnio/target</directory> <directory>extensions/apachehc/target</directory>
<includes> <includes>
<include>jclouds-httpnio-${project.version}-sources.jar</include> <include>jclouds-apachehc-${project.version}-sources.jar</include>
</includes> </includes>
<outputDirectory>extensions/httpnio/src</outputDirectory> <outputDirectory>extensions/apachehc/src</outputDirectory>
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>extensions/httpnio/target/apidocs</directory> <directory>extensions/apachehc/target/apidocs</directory>
<outputDirectory>extensions/httpnio/docs</outputDirectory> <outputDirectory>extensions/apachehc/docs</outputDirectory>
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>extensions/httpnio</directory> <directory>extensions/apachehc</directory>
<includes> <includes>
<include>README.txt</include> <include>README.txt</include>
</includes> </includes>
<outputDirectory>extensions/httpnio</outputDirectory> <outputDirectory>extensions/apachehc</outputDirectory>
</fileSet> </fileSet>
<!-- extensions: jsch --> <!-- extensions: jsch -->

View File

@ -103,7 +103,6 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
} }
private static final int INCONSISTENCY_WINDOW = 5000; private static final int INCONSISTENCY_WINDOW = 5000;
protected AtmosStorageClient connection;
private String containerPrefix = BaseBlobStoreIntegrationTest.CONTAINER_PREFIX + "live"; private String containerPrefix = BaseBlobStoreIntegrationTest.CONTAINER_PREFIX + "live";
URI container1; URI container1;
@ -111,13 +110,12 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
@Test @Test
public void testListDirectorys() throws Exception { public void testListDirectorys() throws Exception {
BoundedSet<? extends DirectoryEntry> response = connection.listDirectories(); BoundedSet<? extends DirectoryEntry> response = getApi().listDirectories();
assert null != response; assert null != response;
} }
String privateDirectory; String privateDirectory;
String publicDirectory; String publicDirectory;
String identity;
@Test(timeOut = 5 * 60 * 1000) @Test(timeOut = 5 * 60 * 1000)
public void testCreateDirectory() throws Exception { public void testCreateDirectory() throws Exception {
@ -125,7 +123,7 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
while (!created) { while (!created) {
privateDirectory = containerPrefix + new SecureRandom().nextInt(); privateDirectory = containerPrefix + new SecureRandom().nextInt();
try { try {
created = connection.createDirectory(privateDirectory) != null; created = getApi().createDirectory(privateDirectory) != null;
} catch (UndeclaredThrowableException e) { } catch (UndeclaredThrowableException e) {
HttpResponseException htpe = (HttpResponseException) e.getCause().getCause(); HttpResponseException htpe = (HttpResponseException) e.getCause().getCause();
if (htpe.getResponse().getStatusCode() == 409) if (htpe.getResponse().getStatusCode() == 409)
@ -133,9 +131,9 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
throw e; throw e;
} }
} }
BoundedSet<? extends DirectoryEntry> response = connection.listDirectories(); BoundedSet<? extends DirectoryEntry> response = getApi().listDirectories();
for (DirectoryEntry id : response) { for (DirectoryEntry id : response) {
BoundedSet<? extends DirectoryEntry> r2 = connection.listDirectory(id.getObjectName()); BoundedSet<? extends DirectoryEntry> r2 = getApi().listDirectory(id.getObjectName());
assert r2 != null; assert r2 != null;
} }
} }
@ -145,12 +143,11 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
createOrReplaceObject("object2", "here is my data!", "meta-value1"); createOrReplaceObject("object2", "here is my data!", "meta-value1");
createOrReplaceObject("object3", "here is my data!", "meta-value1"); createOrReplaceObject("object3", "here is my data!", "meta-value1");
createOrReplaceObject("object4", "here is my data!", "meta-value1"); createOrReplaceObject("object4", "here is my data!", "meta-value1");
BoundedSet<? extends DirectoryEntry> r2 = connection BoundedSet<? extends DirectoryEntry> r2 = getApi().listDirectory(privateDirectory, ListOptions.Builder.limit(1));
.listDirectory(privateDirectory, ListOptions.Builder.limit(1));
assertEquals(r2.size(), 1); assertEquals(r2.size(), 1);
assert r2.getToken() != null; assert r2.getToken() != null;
assertEquals(Iterables.getLast(Sets.newTreeSet(r2)).getObjectName(), "object2"); assertEquals(Iterables.getLast(Sets.newTreeSet(r2)).getObjectName(), "object2");
r2 = connection.listDirectory(privateDirectory, ListOptions.Builder.token(r2.getToken())); r2 = getApi().listDirectory(privateDirectory, ListOptions.Builder.token(r2.getToken()));
assertEquals(r2.size(), 2); assertEquals(r2.size(), 2);
assert r2.getToken() == null; assert r2.getToken() == null;
assertEquals(Iterables.getLast(Sets.newTreeSet(r2)).getObjectName(), "object4"); assertEquals(Iterables.getLast(Sets.newTreeSet(r2)).getObjectName(), "object4");
@ -195,7 +192,7 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
private void createOrReplaceObject(String name, Object data, String metadataValue) throws Exception { private void createOrReplaceObject(String name, Object data, String metadataValue) throws Exception {
// Test PUT with string data, ETag hash, and a piece of metadata // Test PUT with string data, ETag hash, and a piece of metadata
AtmosObject object = connection.newObject(); AtmosObject object = getApi().newObject();
object.getContentMetadata().setName(name); object.getContentMetadata().setName(name);
object.setPayload(Payloads.newPayload(data)); object.setPayload(Payloads.newPayload(data));
object.getContentMetadata().setContentLength(16l); object.getContentMetadata().setContentLength(16l);
@ -231,12 +228,12 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
protected void assertEventuallyObjectMatches(final String name, final String compare, final String metadataValue) protected void assertEventuallyObjectMatches(final String name, final String compare, final String metadataValue)
throws InterruptedException { throws InterruptedException {
assertEventually(new ObjectMatches(connection, privateDirectory + "/" + name, metadataValue, compare)); assertEventually(new ObjectMatches(getApi(), privateDirectory + "/" + name, metadataValue, compare));
} }
protected void assertEventuallyHeadMatches(final String name, final String metadataValue) protected void assertEventuallyHeadMatches(final String name, final String metadataValue)
throws InterruptedException { throws InterruptedException {
assertEventually(new HeadMatches(connection, privateDirectory + "/" + name, metadataValue)); assertEventually(new HeadMatches(getApi(), privateDirectory + "/" + name, metadataValue));
} }
private static void verifyHeadObject(AtmosStorageClient connection, String path, String metadataValue) private static void verifyHeadObject(AtmosStorageClient connection, String path, String metadataValue)
@ -291,7 +288,7 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
deleteConfirmed(privateDirectory + "/" + object.getContentMetadata().getName()); deleteConfirmed(privateDirectory + "/" + object.getContentMetadata().getName());
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
try { try {
connection.createFile(privateDirectory, object); getApi().createFile(privateDirectory, object);
System.err.printf("%s %s; %dms%n", "created", object.getPayload() instanceof InputStreamPayload ? "stream" System.err.printf("%s %s; %dms%n", "created", object.getPayload() instanceof InputStreamPayload ? "stream"
: "string", System.currentTimeMillis() - time); : "string", System.currentTimeMillis() - time);
} catch (Exception e) { } catch (Exception e) {
@ -312,12 +309,12 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
protected void deleteImmediateAndVerifyWithHead(final String path) throws InterruptedException, ExecutionException, protected void deleteImmediateAndVerifyWithHead(final String path) throws InterruptedException, ExecutionException,
TimeoutException { TimeoutException {
try { try {
connection.deletePath(path); getApi().deletePath(path);
} catch (KeyNotFoundException ex) { } catch (KeyNotFoundException ex) {
} }
assert !connection.pathExists(path); assert !getApi().pathExists(path);
System.err.printf("path %s doesn't exist%n", path); System.err.printf("path %s doesn't exist%n", path);
assert !connection.pathExists(path); assert !getApi().pathExists(path);
System.err.printf("path %s doesn't exist%n", path); System.err.printf("path %s doesn't exist%n", path);
} }
@ -325,12 +322,12 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
protected void deleteConsistencyAware(final String path) throws InterruptedException, ExecutionException, protected void deleteConsistencyAware(final String path) throws InterruptedException, ExecutionException,
TimeoutException { TimeoutException {
try { try {
connection.deletePath(path); getApi().deletePath(path);
} catch (KeyNotFoundException ex) { } catch (KeyNotFoundException ex) {
} }
assert Utils.eventuallyTrue(new Supplier<Boolean>() { assert Utils.eventuallyTrue(new Supplier<Boolean>() {
public Boolean get() { public Boolean get() {
return !connection.pathExists(path); return !getApi().pathExists(path);
} }
}, INCONSISTENCY_WINDOW); }, INCONSISTENCY_WINDOW);
} }
@ -358,15 +355,15 @@ public class AtmosStorageClientLiveTest extends BaseBlobStoreIntegrationTest {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
boolean update = true; boolean update = true;
try { try {
connection.getSystemMetadata(privateDirectory + "/object"); getApi().getSystemMetadata(privateDirectory + "/object");
} catch (KeyNotFoundException ex) { } catch (KeyNotFoundException ex) {
update = false; update = false;
} }
try { try {
if (update) if (update)
connection.updateFile(privateDirectory, object); getApi().updateFile(privateDirectory, object);
else else
connection.createFile(privateDirectory, object); getApi().createFile(privateDirectory, object);
System.err.printf("%s %s; %dms%n", update ? "updated" : "created", System.err.printf("%s %s; %dms%n", update ? "updated" : "created",
object.getPayload() instanceof InputStreamPayload ? "stream" : "string", System.currentTimeMillis() object.getPayload() instanceof InputStreamPayload ? "stream" : "string", System.currentTimeMillis()
- time); - time);

View File

@ -19,8 +19,12 @@
package org.jclouds.atmosonline.saas.blobstore.integration; package org.jclouds.atmosonline.saas.blobstore.integration;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTest; import org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -40,4 +44,9 @@ public class AtmosStorageContainerIntegrationLiveTest extends BaseContainerInteg
public void testListContainerMarker() throws InterruptedException, UnsupportedEncodingException { public void testListContainerMarker() throws InterruptedException, UnsupportedEncodingException {
// Not currently working https://community.emc.com/thread/100545 // Not currently working https://community.emc.com/thread/100545
} }
protected void checkMD5(BlobMetadata metadata) throws IOException {
// atmos doesn't support MD5
assertEquals(metadata.getContentMetadata().getContentMD5(), null);
}
} }

View File

@ -19,6 +19,8 @@
package org.jclouds.atmosonline.saas.blobstore.integration; package org.jclouds.atmosonline.saas.blobstore.integration;
import static org.testng.Assert.assertEquals;
import org.jclouds.blobstore.integration.internal.BaseBlobLiveTest; import org.jclouds.blobstore.integration.internal.BaseBlobLiveTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -28,5 +30,8 @@ import org.testng.annotations.Test;
*/ */
@Test(groups = { "live" }, testName = "emcsaas.AtmosStorageLiveTest") @Test(groups = { "live" }, testName = "emcsaas.AtmosStorageLiveTest")
public class AtmosStorageLiveTest extends BaseBlobLiveTest { public class AtmosStorageLiveTest extends BaseBlobLiveTest {
protected void checkMD5(String container, String name, byte[] md5) {
// atmos does not support content-md5 yet
assertEquals(context.getBlobStore().blobMetadata(container, name).getContentMetadata().getContentMD5(), null);
}
} }

View File

@ -19,6 +19,10 @@
package org.jclouds.atmosonline.saas.blobstore.integration; package org.jclouds.atmosonline.saas.blobstore.integration;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest; import org.jclouds.blobstore.integration.internal.BaseBlobMapIntegrationTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -28,4 +32,10 @@ import org.testng.annotations.Test;
@Test(groups = "live", testName = "emcsaas.AtmosStorageMapIntegrationTest") @Test(groups = "live", testName = "emcsaas.AtmosStorageMapIntegrationTest")
public class AtmosStorageMapIntegrationLiveTest extends BaseBlobMapIntegrationTest { public class AtmosStorageMapIntegrationLiveTest extends BaseBlobMapIntegrationTest {
@Override
// NO support for Content-MD5, so contains cannot work
public void testContains() throws InterruptedException, ExecutionException, TimeoutException, IOException {
}
} }

View File

@ -23,12 +23,15 @@ import static com.google.common.base.Preconditions.checkArgument;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_DEFAULT_REGIONS; import static org.jclouds.aws.reference.AWSConstants.PROPERTY_DEFAULT_REGIONS;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_REGIONS; import static org.jclouds.aws.reference.AWSConstants.PROPERTY_REGIONS;
import javax.annotation.Resource;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.inject.Singleton; import javax.inject.Singleton;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import org.jclouds.aws.domain.Region;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.logging.Logger;
import org.jclouds.rest.binders.BindToStringPayload; import org.jclouds.rest.binders.BindToStringPayload;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
@ -44,6 +47,8 @@ import com.google.common.collect.Iterables;
*/ */
@Singleton @Singleton
public class BindRegionToXmlPayload extends BindToStringPayload { public class BindRegionToXmlPayload extends BindToStringPayload {
@Resource
protected Logger logger = Logger.NULL;
private final Iterable<String> defaultRegions; private final Iterable<String> defaultRegions;
private final Iterable<String> regions; private final Iterable<String> regions;
@ -67,12 +72,16 @@ public class BindRegionToXmlPayload extends BindToStringPayload {
} else if (Iterables.contains(regions, constraint)) { } else if (Iterables.contains(regions, constraint)) {
value = constraint; value = constraint;
} else { } else {
throw new IllegalStateException("unimplemented location: " + constraint); if (constraint.equals(Region.EU_WEST_1)) {
value = "EU";
} else {
logger.warn("region %s not in %s ", constraint, regions);
value = constraint;
}
} }
String payload = String String payload = String.format(
.format( "<CreateBucketConfiguration><LocationConstraint>%s</LocationConstraint></CreateBucketConfiguration>",
"<CreateBucketConfiguration><LocationConstraint>%s</LocationConstraint></CreateBucketConfiguration>", value);
value);
super.bindToRequest(request, payload); super.bindToRequest(request, payload);
request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_XML); request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_XML);
} }

View File

@ -29,7 +29,6 @@ import javax.inject.Singleton;
import org.jclouds.aws.domain.AWSError; import org.jclouds.aws.domain.AWSError;
import org.jclouds.aws.xml.ErrorHandler; import org.jclouds.aws.xml.ErrorHandler;
import org.jclouds.http.HttpException;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ParseSax;
@ -71,8 +70,7 @@ public class AWSUtils {
&& response.getPayload().getContentMetadata().getContentType().indexOf("text/plain") != -1) && response.getPayload().getContentMetadata().getContentType().indexOf("text/plain") != -1)
return null; return null;
try { try {
AWSError error = (AWSError) factory.create(errorHandlerProvider.get()).setContext(request) AWSError error = (AWSError) factory.create(errorHandlerProvider.get()).setContext(request).apply(response);
.apply(response);
if (error.getRequestId() == null) if (error.getRequestId() == null)
error.setRequestId(response.getFirstHeaderOrNull(requestId)); error.setRequestId(response.getFirstHeaderOrNull(requestId));
error.setRequestToken(response.getFirstHeaderOrNull(requestToken)); error.setRequestToken(response.getFirstHeaderOrNull(requestToken));
@ -81,7 +79,7 @@ public class AWSUtils {
error.setSignature(signer.sign(error.getStringSigned())); error.setSignature(signer.sign(error.getStringSigned()));
} }
return error; return error;
} catch (HttpException e) { } catch (RuntimeException e) {
logger.warn(e, "error parsing error"); logger.warn(e, "error parsing error");
return null; return null;
} }

View File

@ -34,6 +34,7 @@ import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.OperatingSystem; import org.jclouds.compute.domain.OperatingSystem;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.scriptbuilder.domain.Statement; import org.jclouds.scriptbuilder.domain.Statement;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
@ -43,7 +44,7 @@ import org.testng.annotations.Test;
*/ */
@Test(groups = "live", testName = "jclouds.ComputeAndBlobStoreTogetherHappilyLiveTest") @Test(groups = "live", testName = "jclouds.ComputeAndBlobStoreTogetherHappilyLiveTest")
public class ComputeAndBlobStoreTogetherHappilyLiveTest extends BlobStoreAndComputeServiceLiveTest { public class ComputeAndBlobStoreTogetherHappilyLiveTest extends BlobStoreAndComputeServiceLiveTest {
@BeforeClass
protected void setupCredentials() { protected void setupCredentials() {
blobStoreProvider = "s3"; blobStoreProvider = "s3";
computeServiceProvider = "ec2"; computeServiceProvider = "ec2";

View File

@ -60,17 +60,17 @@ public class BlobStoreAndComputeServiceLiveTest {
+ ".identity"); + ".identity");
String credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider String credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider
+ ".credential"); + ".credential");
String endpoint = checkNotNull(System.getProperty("test." + provider + ".endpoint"), "test." + provider String endpoint = System.getProperty("test." + provider + ".endpoint");
+ ".endpoint"); String apiversion = System.getProperty("test." + provider + ".apiversion");
String apiversion = checkNotNull(System.getProperty("test." + provider + ".apiversion"), "test." + provider
+ ".apiversion");
Properties overrides = new Properties(); Properties overrides = new Properties();
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true"); overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true"); overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
overrides.setProperty(provider + ".identity", identity); overrides.setProperty(provider + ".identity", identity);
overrides.setProperty(provider + ".credential", credential); overrides.setProperty(provider + ".credential", credential);
overrides.setProperty(provider + ".endpoint", endpoint); if (endpoint != null)
overrides.setProperty(provider + ".apiversion", apiversion); overrides.setProperty(provider + ".endpoint", endpoint);
if (apiversion != null)
overrides.setProperty(provider + ".apiversion", apiversion);
return overrides; return overrides;
} }

View File

@ -49,7 +49,6 @@ import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory; import org.jclouds.rest.RestContextFactory;
import org.jclouds.ssh.jsch.config.JschSshClientModule; import org.jclouds.ssh.jsch.config.JschSshClientModule;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;

View File

@ -34,6 +34,7 @@ import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.domain.Template; import org.jclouds.compute.domain.Template;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -51,13 +52,12 @@ public class EC2TemplateBuilderLiveTest {
protected String endpoint; protected String endpoint;
protected String apiversion; protected String apiversion;
@BeforeClass
protected void setupCredentials() { protected void setupCredentials() {
identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity"); identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity");
credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider credential = System.getProperty("test." + provider + ".credential");
+ ".credential"); endpoint = System.getProperty("test." + provider + ".endpoint");
endpoint = checkNotNull(System.getProperty("test." + provider + ".endpoint"), "test." + provider + ".endpoint"); apiversion = System.getProperty("test." + provider + ".apiversion");
apiversion = checkNotNull(System.getProperty("test." + provider + ".apiversion"), "test." + provider
+ ".apiversion");
} }
protected Properties setupProperties() { protected Properties setupProperties() {
@ -65,9 +65,12 @@ public class EC2TemplateBuilderLiveTest {
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true"); overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true"); overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
overrides.setProperty(provider + ".identity", identity); overrides.setProperty(provider + ".identity", identity);
overrides.setProperty(provider + ".credential", credential); if (credential != null)
overrides.setProperty(provider + ".endpoint", endpoint); overrides.setProperty(provider + ".credential", credential);
overrides.setProperty(provider + ".apiversion", apiversion); if (endpoint != null)
overrides.setProperty(provider + ".endpoint", endpoint);
if (apiversion != null)
overrides.setProperty(provider + ".apiversion", apiversion);
return overrides; return overrides;
} }
@ -79,7 +82,7 @@ public class EC2TemplateBuilderLiveTest {
.<Module> of(new Log4JLoggingModule()), setupProperties()); .<Module> of(new Log4JLoggingModule()), setupProperties());
Template template = newContext.getComputeService().templateBuilder().imageId("us-east-1/ami-ccb35ea5") Template template = newContext.getComputeService().templateBuilder().imageId("us-east-1/ami-ccb35ea5")
.hardwareId(InstanceType.M2_2XLARGE).build(); .hardwareId(InstanceType.M2_2XLARGE).build();
System.out.println(template.getHardware()); System.out.println(template.getHardware());
assert (template.getImage().getProviderId().startsWith("ami-")) : template; assert (template.getImage().getProviderId().startsWith("ami-")) : template;
@ -106,7 +109,7 @@ public class EC2TemplateBuilderLiveTest {
Template defaultTemplate = newContext.getComputeService().templateBuilder().build(); Template defaultTemplate = newContext.getComputeService().templateBuilder().build();
assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate;
assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "0.9.7-beta"); assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "0.9.8-beta");
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX);
assertEquals(defaultTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs"); assertEquals(defaultTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs");
@ -127,7 +130,7 @@ public class EC2TemplateBuilderLiveTest {
.<Module> of(new Log4JLoggingModule()), setupProperties()); .<Module> of(new Log4JLoggingModule()), setupProperties());
Template microTemplate = newContext.getComputeService().templateBuilder().hardwareId(InstanceType.T1_MICRO) Template microTemplate = newContext.getComputeService().templateBuilder().hardwareId(InstanceType.T1_MICRO)
.build(); .build();
System.out.println(microTemplate.getHardware()); System.out.println(microTemplate.getHardware());
assert (microTemplate.getImage().getProviderId().startsWith("ami-")) : microTemplate; assert (microTemplate.getImage().getProviderId().startsWith("ami-")) : microTemplate;
@ -167,7 +170,7 @@ public class EC2TemplateBuilderLiveTest {
assertEquals(template.getLocation().getId(), "us-east-1"); assertEquals(template.getLocation().getId(), "us-east-1");
assertEquals(getCores(template.getHardware()), 2.0d); assertEquals(getCores(template.getHardware()), 2.0d);
assertEquals(template.getHardware().getId(), "m1.large"); // because it assertEquals(template.getHardware().getId(), "m1.large"); // because it
// is 64bit // is 64bit
// ensure we cache the new image for next time // ensure we cache the new image for next time
assertEquals(newContext.getComputeService().listImages().size(), 1); assertEquals(newContext.getComputeService().listImages().size(), 1);

View File

@ -50,7 +50,7 @@ public class EucalyptusComputeServiceLiveTest extends EC2ComputeServiceLiveTest
Template defaultTemplate = client.templateBuilder().build(); Template defaultTemplate = client.templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.CENTOS); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.CENTOS);
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); assertEquals(getCores(defaultTemplate.getHardware()), 2.0d);
} }
} }

View File

@ -31,9 +31,9 @@ import org.testng.annotations.Test;
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(enabled = false, groups = "live", sequential = true, testName = "ec2.NebulaComputeServiceLiveTest") @Test(enabled = false, groups = "live", sequential = true, testName = "ec2.NebulaComputeServiceLiveTest")
public class NovaComputeServiceLiveTest extends EC2ComputeServiceLiveTest { public class NovaComputeServiceLiveTestDisabled extends EC2ComputeServiceLiveTest {
public NovaComputeServiceLiveTest() { public NovaComputeServiceLiveTestDisabled() {
provider = "nova"; provider = "nova";
} }

View File

@ -42,8 +42,8 @@ import com.google.inject.Module;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", testName = "ec2.NebulaTemplateBuilderLiveTest") @Test(enabled = false, groups = "live", testName = "ec2.NebulaTemplateBuilderLiveTest")
public class NovaTemplateBuilderLiveTest { public class NovaTemplateBuilderLiveTestDisabled {
protected String provider = "nova"; protected String provider = "nova";
protected String identity; protected String identity;
protected String credential; protected String credential;

View File

@ -38,9 +38,9 @@ import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.aws.ec2.domain.Image; import org.jclouds.aws.ec2.domain.Image;
import org.jclouds.aws.ec2.domain.RootDeviceType; import org.jclouds.aws.ec2.domain.RootDeviceType;
import org.jclouds.aws.ec2.domain.Image.ImageType; import org.jclouds.aws.ec2.domain.Image.ImageType;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -98,8 +98,8 @@ public class AMIClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()),
overrides); overrides).getProviderSpecificContext();
client = context.getApi().getAMIServices(); client = context.getApi().getAMIServices();
} }

View File

@ -37,9 +37,9 @@ import org.jclouds.aws.domain.Region;
import org.jclouds.aws.ec2.EC2AsyncClient; import org.jclouds.aws.ec2.EC2AsyncClient;
import org.jclouds.aws.ec2.EC2Client; import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.aws.ec2.domain.AvailabilityZoneInfo; import org.jclouds.aws.ec2.domain.AvailabilityZoneInfo;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -90,8 +90,8 @@ public class AvailabilityZoneAndRegionClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()),
overrides); overrides).getProviderSpecificContext();
client = context.getApi().getAvailabilityZoneAndRegionServices(); client = context.getApi().getAvailabilityZoneAndRegionServices();
} }

View File

@ -39,10 +39,10 @@ import org.jclouds.aws.ec2.domain.Snapshot;
import org.jclouds.aws.ec2.domain.Volume; import org.jclouds.aws.ec2.domain.Volume;
import org.jclouds.aws.ec2.predicates.SnapshotCompleted; import org.jclouds.aws.ec2.predicates.SnapshotCompleted;
import org.jclouds.aws.ec2.predicates.VolumeAvailable; import org.jclouds.aws.ec2.predicates.VolumeAvailable;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.predicates.RetryablePredicate; import org.jclouds.predicates.RetryablePredicate;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -95,8 +95,8 @@ public class ElasticBlockStoreClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()),
overrides); overrides).getProviderSpecificContext();
client = context.getApi().getElasticBlockStoreServices(); client = context.getApi().getElasticBlockStoreServices();
} }

View File

@ -31,9 +31,9 @@ import org.jclouds.aws.domain.Region;
import org.jclouds.aws.ec2.EC2AsyncClient; import org.jclouds.aws.ec2.EC2AsyncClient;
import org.jclouds.aws.ec2.EC2Client; import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.aws.ec2.domain.PublicIpInstanceIdPair; import org.jclouds.aws.ec2.domain.PublicIpInstanceIdPair;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -84,8 +84,8 @@ public class ElasticIPAddressClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()),
overrides); overrides).getProviderSpecificContext();
client = context.getApi().getElasticIPAddressServices(); client = context.getApi().getElasticIPAddressServices();
} }

View File

@ -31,9 +31,9 @@ import org.jclouds.aws.ec2.EC2AsyncClient;
import org.jclouds.aws.ec2.EC2Client; import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.aws.ec2.domain.Reservation; import org.jclouds.aws.ec2.domain.Reservation;
import org.jclouds.aws.ec2.domain.RunningInstance; import org.jclouds.aws.ec2.domain.RunningInstance;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -83,8 +83,8 @@ public class InstanceClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()),
overrides); overrides).getProviderSpecificContext();
client = context.getApi().getInstanceServices(); client = context.getApi().getInstanceServices();
} }

View File

@ -32,9 +32,9 @@ import org.jclouds.aws.domain.Region;
import org.jclouds.aws.ec2.EC2AsyncClient; import org.jclouds.aws.ec2.EC2AsyncClient;
import org.jclouds.aws.ec2.EC2Client; import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.aws.ec2.domain.KeyPair; import org.jclouds.aws.ec2.domain.KeyPair;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -85,8 +85,8 @@ public class KeyPairClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider,
overrides); ImmutableSet.<Module> of(new Log4JLoggingModule()), overrides).getProviderSpecificContext();
client = context.getApi().getKeyPairServices(); client = context.getApi().getKeyPairServices();
} }

View File

@ -29,9 +29,9 @@ import org.jclouds.Constants;
import org.jclouds.aws.ec2.EC2AsyncClient; import org.jclouds.aws.ec2.EC2AsyncClient;
import org.jclouds.aws.ec2.EC2Client; import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.aws.ec2.domain.MonitoringState; import org.jclouds.aws.ec2.domain.MonitoringState;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -79,8 +79,8 @@ public class MonitoringClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider,
overrides); ImmutableSet.<Module> of(new Log4JLoggingModule()), overrides).getProviderSpecificContext();
client = context.getApi().getMonitoringServices(); client = context.getApi().getMonitoringServices();
} }

View File

@ -108,8 +108,8 @@ public class PlacementGroupClientLiveTest {
public void setupClient() throws FileNotFoundException, IOException { public void setupClient() throws FileNotFoundException, IOException {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new ComputeServiceContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider, ImmutableSet
overrides); .<Module> of(new Log4JLoggingModule()), overrides);
keyPair = BaseComputeServiceLiveTest.setupKeyPair(); keyPair = BaseComputeServiceLiveTest.setupKeyPair();
client = EC2Client.class.cast(context.getProviderSpecificContext().getApi()); client = EC2Client.class.cast(context.getProviderSpecificContext().getApi());

View File

@ -38,9 +38,9 @@ import org.jclouds.aws.ec2.domain.IpPermission;
import org.jclouds.aws.ec2.domain.IpProtocol; import org.jclouds.aws.ec2.domain.IpProtocol;
import org.jclouds.aws.ec2.domain.SecurityGroup; import org.jclouds.aws.ec2.domain.SecurityGroup;
import org.jclouds.aws.ec2.domain.UserIdGroupPair; import org.jclouds.aws.ec2.domain.UserIdGroupPair;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.AfterTest; import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -91,8 +91,8 @@ public class SecurityGroupClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider,
overrides); ImmutableSet.<Module> of(new Log4JLoggingModule()), overrides).getProviderSpecificContext();
client = context.getApi().getSecurityGroupServices(); client = context.getApi().getSecurityGroupServices();
} }

View File

@ -26,9 +26,9 @@ import java.util.Properties;
import org.jclouds.Constants; import org.jclouds.Constants;
import org.jclouds.aws.ec2.EC2AsyncClient; import org.jclouds.aws.ec2.EC2AsyncClient;
import org.jclouds.aws.ec2.EC2Client; import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -79,8 +79,8 @@ public class WindowsClientLiveTest {
public void setupClient() { public void setupClient() {
setupCredentials(); setupCredentials();
Properties overrides = setupProperties(); Properties overrides = setupProperties();
context = new RestContextFactory().createContext(provider, ImmutableSet.<Module> of(new Log4JLoggingModule()), context = new ComputeServiceContextFactory().createContext(provider,
overrides); ImmutableSet.<Module> of(new Log4JLoggingModule()), overrides).getProviderSpecificContext();
client = context.getApi().getWindowsServices(); client = context.getApi().getWindowsServices();
} }

View File

@ -298,33 +298,6 @@ public class BucketsLiveTest extends BaseBlobStoreIntegrationTest {
} }
} }
/**
* using scratch bucketName as we are changing location
*/
public void testNorthernCalifornia() throws Exception {
final String bucketName = getScratchContainerName();
try {
getApi().putBucketInRegion(Region.EU_WEST_1, bucketName + "cali",
withBucketAcl(CannedAccessPolicy.PUBLIC_READ));
assertConsistencyAware(new Runnable() {
public void run() {
try {
AccessControlList acl = getApi().getBucketACL(bucketName + "cali");
assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString());
} catch (Exception e) {
Throwables.propagateIfPossible(e);
}
}
});
assertEquals(Region.EU_WEST_1, getApi().getBucketLocation(bucketName + "cali"));
// TODO: I believe that the following should work based on the above acl assertion passing.
// However, it fails on 403
// URL url = new URL(String.format("http://%s.s3.amazonaws.com", bucketName));
// Utils.toStringAndClose(url.openStream());
} finally {
destroyContainer(bucketName + "cali");
}
}
void bucketExists() throws Exception { void bucketExists() throws Exception {
String bucketName = getContainerName(); String bucketName = getContainerName();

View File

@ -187,11 +187,11 @@
<systemProperties> <systemProperties>
<property> <property>
<name>jclouds.test.identity</name> <name>jclouds.test.identity</name>
<value>${jclouds.aws.accesskeyid}</value> <value>${test.aws.identity}</value>
</property> </property>
<property> <property>
<name>jclouds.test.credential</name> <name>jclouds.test.credential</name>
<value>${jclouds.aws.secretaccesskey}</value> <value>${test.aws.credential}</value>
</property> </property>
<property> <property>
<name>appengine.home</name> <name>appengine.home</name>

View File

@ -68,10 +68,14 @@ public class BaseBlobLiveTest extends BaseBlobStoreIntegrationTest {
String container = getContainerName(); String container = getContainerName();
try { try {
context.getBlobStore().putBlob(container, blob); context.getBlobStore().putBlob(container, blob);
assertEquals(context.getBlobStore().blobMetadata(container, name).getContentMetadata().getContentMD5(), md5); checkMD5(container, name, md5);
} finally { } finally {
returnContainer(container); returnContainer(container);
} }
} }
protected void checkMD5(String container, String name, byte[] md5) {
assertEquals(context.getBlobStore().blobMetadata(container, name).getContentMetadata().getContentMD5(), md5);
}
} }

View File

@ -96,12 +96,16 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest {
assert metadata.getContentMetadata().getContentType().startsWith("text/plain") : metadata.getContentMetadata().getContentType(); assert metadata.getContentMetadata().getContentType().startsWith("text/plain") : metadata.getContentMetadata().getContentType();
assertEquals(metadata.getContentMetadata().getContentLength(), new Long(TEST_STRING.length())); assertEquals(metadata.getContentMetadata().getContentLength(), new Long(TEST_STRING.length()));
assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff"); assertEquals(metadata.getUserMetadata().get("adrian"), "powderpuff");
assertEquals(metadata.getContentMetadata().getContentMD5(), CryptoStreams.md5(InputSuppliers.of(TEST_STRING))); checkMD5(metadata);
} finally { } finally {
returnContainer(containerName); returnContainer(containerName);
} }
} }
protected void checkMD5(BlobMetadata metadata) throws IOException {
assertEquals(metadata.getContentMetadata().getContentMD5(), CryptoStreams.md5(InputSuppliers.of(TEST_STRING)));
}
@Test(groups = { "integration", "live" }) @Test(groups = { "integration", "live" })
public void testClearWhenContentsUnderPath() throws InterruptedException { public void testClearWhenContentsUnderPath() throws InterruptedException {
String containerName = getContainerName(); String containerName = getContainerName();

View File

@ -77,11 +77,13 @@ import com.google.inject.Module;
/** /**
* End to end live test for GoGrid * End to end live test for GoGrid
* <p/>
* Takes too long to execute. Please split into multiple tests
* *
* @author Oleksiy Yarmula * @author Oleksiy Yarmula
*/ */
@Test(groups = "live", testName = "gogrid.GoGridLiveTest") @Test(enabled = false, groups = "live", testName = "gogrid.GoGridLiveTest")
public class GoGridLiveTest { public class GoGridLiveTestDisabled {
private GoGridClient client; private GoGridClient client;

View File

@ -125,6 +125,7 @@ public class CloudServersComputeServiceContextModule extends BaseComputeServiceC
.put(ServerStatus.SHARE_IP, NodeState.PENDING)// .put(ServerStatus.SHARE_IP, NodeState.PENDING)//
.put(ServerStatus.REBOOT, NodeState.PENDING)// .put(ServerStatus.REBOOT, NodeState.PENDING)//
.put(ServerStatus.HARD_REBOOT, NodeState.PENDING)// .put(ServerStatus.HARD_REBOOT, NodeState.PENDING)//
.put(ServerStatus.UNKNOWN, NodeState.UNRECOGNIZED)//
.put(ServerStatus.UNRECOGNIZED, NodeState.UNRECOGNIZED).build(); .put(ServerStatus.UNRECOGNIZED, NodeState.UNRECOGNIZED).build();
@Singleton @Singleton

View File

@ -38,7 +38,7 @@ package org.jclouds.rackspace.cloudservers.domain;
*/ */
public enum ServerStatus { public enum ServerStatus {
ACTIVE, SUSPENDED, DELETED, QUEUE_RESIZE, PREP_RESIZE, RESIZE, VERIFY_RESIZE, QUEUE_MOVE, PREP_MOVE, MOVE, VERIFY_MOVE, RESCUE, ERROR, BUILD, RESTORING, PASSWORD, REBUILD, DELETE_IP, SHARE_IP_NO_CONFIG, SHARE_IP, REBOOT, HARD_REBOOT, UNRECOGNIZED; ACTIVE, SUSPENDED, DELETED, QUEUE_RESIZE, PREP_RESIZE, RESIZE, VERIFY_RESIZE, QUEUE_MOVE, PREP_MOVE, MOVE, VERIFY_MOVE, RESCUE, ERROR, BUILD, RESTORING, PASSWORD, REBUILD, DELETE_IP, SHARE_IP_NO_CONFIG, SHARE_IP, REBOOT, HARD_REBOOT, UNKNOWN, UNRECOGNIZED;
public String value() { public String value() {
return name(); return name();

View File

@ -23,9 +23,11 @@ import static org.jclouds.rest.RestContextFactory.contextSpec;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.rackspace.RackspaceAuthenticationLiveTest.RackspaceAuthClient; import org.jclouds.rackspace.RackspaceAuthAsyncClient.AuthenticationResponse;
import org.jclouds.rackspace.functions.ParseAuthenticationResponseFromHeaders; import org.jclouds.rackspace.functions.ParseAuthenticationResponseFromHeaders;
import org.jclouds.rest.RestClientTest; import org.jclouds.rest.RestClientTest;
import org.jclouds.rest.RestContextFactory.ContextSpec; import org.jclouds.rest.RestContextFactory.ContextSpec;
@ -60,7 +62,7 @@ public class RackspaceAuthAsyncClientTest extends RestClientTest<RackspaceAuthAs
@Override @Override
public ContextSpec<RackspaceAuthClient, RackspaceAuthAsyncClient> createContextSpec() { public ContextSpec<RackspaceAuthClient, RackspaceAuthAsyncClient> createContextSpec() {
return contextSpec("test", "http://localhost:8080", "1", "identity", "credential", RackspaceAuthClient.class, return contextSpec("test", "http://localhost:8080", "1", "identity", "credential", RackspaceAuthClient.class,
RackspaceAuthAsyncClient.class); RackspaceAuthAsyncClient.class);
} }
@Override @Override
@ -73,4 +75,9 @@ public class RackspaceAuthAsyncClientTest extends RestClientTest<RackspaceAuthAs
}; };
} }
@Timeout(duration = 10, timeUnit = TimeUnit.SECONDS)
public interface RackspaceAuthClient {
AuthenticationResponse authenticate(String user, String key);
}
} }

View File

@ -1,104 +0,0 @@
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.rackspace;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.rest.RestContextFactory.contextSpec;
import static org.jclouds.rest.RestContextFactory.createContextBuilder;
import static org.testng.Assert.assertNotNull;
import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.MoreExecutors;
import org.jclouds.concurrent.Timeout;
import org.jclouds.concurrent.config.ExecutorServiceModule;
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rackspace.RackspaceAuthAsyncClient.AuthenticationResponse;
import org.jclouds.rest.AuthorizationException;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory.ContextSpec;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
* Tests behavior of {@code JaxrsAnnotationProcessor}
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "rackspace.RackspaceAuthenticationLiveTest")
public class RackspaceAuthenticationLiveTest {
@Timeout(duration = 10, timeUnit = TimeUnit.SECONDS)
public interface RackspaceAuthClient {
AuthenticationResponse authenticate(String user, String key);
}
private RestContext<RackspaceAuthClient, RackspaceAuthAsyncClient> context;
@Test
public void testAuthentication() throws Exception {
RackspaceAuthClient authentication = context.getApi();
AuthenticationResponse response = authentication.authenticate(identity, credential);
assertNotNull(response);
assertNotNull(response.getStorageUrl());
assertNotNull(response.getCDNManagementUrl());
assertNotNull(response.getServerManagementUrl());
assertNotNull(response.getAuthToken());
}
@Test(expectedExceptions = AuthorizationException.class)
public void testBadAuthentication() throws Exception {
RackspaceAuthAsyncClient authentication = context.getAsyncApi();
authentication.authenticate("foo", "bar").get(10, TimeUnit.SECONDS);
}
protected String provider = "cloudservers";
protected String identity;
protected String credential;
protected String endpoint;
protected String apiversion;
protected void setupCredentials() {
identity = checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity");
credential = checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider
+ ".credential");
endpoint = checkNotNull(System.getProperty("test." + provider + ".endpoint"), "test." + provider + ".endpoint");
apiversion = checkNotNull(System.getProperty("test." + provider + ".apiversion"), "test." + provider
+ ".apiversion");
}
@BeforeGroups(groups = { "live" })
public void setupFactory() {
setupCredentials();
ContextSpec<RackspaceAuthClient, RackspaceAuthAsyncClient> contextSpec = contextSpec(endpoint, endpoint,
apiversion, null, null, RackspaceAuthClient.class, RackspaceAuthAsyncClient.class);
context = createContextBuilder(
contextSpec,
ImmutableSet.<Module> of(new Log4JLoggingModule(), new ExecutorServiceModule(MoreExecutors
.sameThreadExecutor(), MoreExecutors.sameThreadExecutor()))).buildContext();
}
}

View File

@ -73,7 +73,11 @@ public class SliceHandler extends ParseSax.HandlerWithResult<Slice> {
} else if (qName.equalsIgnoreCase("status")) { } else if (qName.equalsIgnoreCase("status")) {
this.status = Slice.Status.fromValue(currentText.toString().trim()); this.status = Slice.Status.fromValue(currentText.toString().trim());
} else if (qName.equalsIgnoreCase("progress")) { } else if (qName.equalsIgnoreCase("progress")) {
progress = Integer.parseInt(currentText.toString().trim()); try {
progress = Integer.parseInt(currentText.toString().trim());
} catch (NumberFormatException e) {
}
} else if (qName.equalsIgnoreCase("bw-in")) { } else if (qName.equalsIgnoreCase("bw-in")) {
bandwidthIn = Float.parseFloat(currentText.toString().trim()); bandwidthIn = Float.parseFloat(currentText.toString().trim());
} else if (qName.equalsIgnoreCase("bw-out")) { } else if (qName.equalsIgnoreCase("bw-out")) {
@ -84,7 +88,7 @@ public class SliceHandler extends ParseSax.HandlerWithResult<Slice> {
this.rootPassword = currentText.toString().trim(); this.rootPassword = currentText.toString().trim();
} else if (qName.equalsIgnoreCase("slice")) { } else if (qName.equalsIgnoreCase("slice")) {
this.slice = new Slice(id, name, flavorId, imageId, backupId, status, progress, bandwidthIn, bandwidthOut, this.slice = new Slice(id, name, flavorId, imageId, backupId, status, progress, bandwidthIn, bandwidthOut,
addresses, rootPassword); addresses, rootPassword);
this.id = -1; this.id = -1;
this.name = null; this.name = null;
this.flavorId = -1; this.flavorId = -1;

View File

@ -49,7 +49,7 @@ public class SlicehostComputeServiceLiveTest extends BaseComputeServiceLiveTest
Template defaultTemplate = client.templateBuilder().build(); Template defaultTemplate = client.templateBuilder().build();
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
assertEquals(defaultTemplate.getLocation().getId(), "DFW"); assertEquals(defaultTemplate.getLocation().getId(), "DFW1");
assertEquals(getCores(defaultTemplate.getHardware()), 0.25d); assertEquals(getCores(defaultTemplate.getHardware()), 0.25d);
} }

View File

@ -24,7 +24,6 @@ import javax.inject.Inject;
import javax.inject.Provider; import javax.inject.Provider;
import javax.inject.Singleton; import javax.inject.Singleton;
import org.jclouds.http.HttpException;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ParseSax;
@ -59,7 +58,7 @@ public class VCloudUtils {
if (VCloudMediaType.ERROR_XML.equals(response.getPayload().getContentMetadata().getContentType())) { if (VCloudMediaType.ERROR_XML.equals(response.getPayload().getContentMetadata().getContentType())) {
try { try {
return (VCloudError) factory.create(errorHandlerProvider.get()).setContext(request).apply(response); return (VCloudError) factory.create(errorHandlerProvider.get()).setContext(request).apply(response);
} catch (HttpException e) { } catch (RuntimeException e) {
logger.warn(e, "error parsing error"); logger.warn(e, "error parsing error");
} }
} }

View File

@ -32,8 +32,8 @@ import org.testng.annotations.Test;
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", sequential = true, testName = "vcloud.TerremarkECloudClientLiveTest") @Test(groups = "live", enabled = false, sequential = true, testName = "vcloud.TerremarkECloudClientLiveTest")
public class TerremarkECloudClientLiveTest extends TerremarkClientLiveTest { public class TerremarkECloudClientLiveTestDisabled extends TerremarkClientLiveTest {
@BeforeClass @BeforeClass
void setProvider() { void setProvider() {
this.provider = "trmk-ecloud"; this.provider = "trmk-ecloud";

View File

@ -38,13 +38,13 @@ import org.jclouds.vcloud.terremark.TerremarkECloudClient;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* * This test is disabled, as it doesn't work while there are too few public ip addresses.
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Test(groups = "live", enabled = true, sequential = true, testName = "terremark.TerremarkVCloudComputeServiceLiveTest") @Test(groups = "live", enabled = false, sequential = true, testName = "terremark.TerremarkVCloudComputeServiceLiveTest")
public class TerremarkECloudComputeServiceLiveTest extends BaseComputeServiceLiveTest { public class TerremarkECloudComputeServiceLiveTestDisabled extends BaseComputeServiceLiveTest {
public TerremarkECloudComputeServiceLiveTest() { public TerremarkECloudComputeServiceLiveTestDisabled() {
provider = "trmk-ecloud"; provider = "trmk-ecloud";
} }

View File

@ -81,7 +81,7 @@ public class TerremarkVCloudExpressComputeServiceLiveTest extends BaseComputeSer
@Override @Override
protected void checkOsMatchesTemplate(NodeMetadata node) { protected void checkOsMatchesTemplate(NodeMetadata node) {
if (node.getOperatingSystem() != null) if (node.getOperatingSystem() != null)
assertEquals(node.getOperatingSystem().getFamily(), OsFamily.UNRECOGNIZED); assertEquals(node.getOperatingSystem().getFamily(), null);
} }
@Override @Override