From c3d767e4637cfef1716cbb35981feb76c95282d2 Mon Sep 17 00:00:00 2001 From: Juergen Hoetzel Date: Wed, 1 Jun 2011 17:00:00 +0200 Subject: [PATCH 01/40] added AWS Security Group Clojure wrapper --- .../org/jclouds/ec2/security_group2.clj | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 apis/ec2/src/main/clojure/org/jclouds/ec2/security_group2.clj diff --git a/apis/ec2/src/main/clojure/org/jclouds/ec2/security_group2.clj b/apis/ec2/src/main/clojure/org/jclouds/ec2/security_group2.clj new file mode 100644 index 0000000000..b1303e172e --- /dev/null +++ b/apis/ec2/src/main/clojure/org/jclouds/ec2/security_group2.clj @@ -0,0 +1,101 @@ +; +; +; Copyright (C) 2011 Cloud Conscious, LLC. +; +; ==================================================================== +; 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. +; ==================================================================== +; + +(ns + #^{:author "Juegen Hoetzel, juergen@archlinux.org" + :doc "A clojure binding for the jclouds AWS security group interface."} + org.jclouds.ec2.security-group2 + (:require (org.jclouds [compute2 :as compute]) + [org.jclouds.ec2.ebs :as ebs]) + (:import org.jclouds.ec2.domain.IpProtocol + org.jclouds.ec2.domain.SecurityGroup + org.jclouds.ec2.services.SecurityGroupClient)) + +(defn #^SecurityGroupClient + sg-service + "Returns the SecurityGroup Client associated with the specified compute service." + [compute] + (-> compute .getContext .getProviderSpecificContext .getApi .getSecurityGroupServices)) + +(defn create-group + "Creates a new security group. + + e.g. (create-group compute \"Database Server\" \"Description for group\" :region :us-west-1)" + [compute name & {:keys [description region]}] + (.createSecurityGroupInRegion (sg-service compute) (ebs/get-region region) name (or description name))) + +(defn delete-group + "Deletes a security group. + + e.g. (delete-group compute \"Database Server\" :region :us-west-1)" + [compute name & {:keys [region]}] + (.deleteSecurityGroupInRegion (sg-service compute) (ebs/get-region region) name)) + +(defn groups + "Returns a map of GroupName -> org.jclouds.ec2.domain.SecurityGroup instances. + + e.g. (groups compute :region :us-east-1)" + [compute & {:keys [region]}] + (into {} (for [#^SecurityGroup group (.describeSecurityGroupsInRegion (sg-service compute) + (ebs/get-region region) + (into-array String '()))] + [(.getName group) group]))) + +(defn get-protocol [v] + "Coerce argument to a IP Protocol." + (cond + (instance? IpProtocol v) v + (keyword? v) (if-let [p (get {:tcp IpProtocol/TCP + :udp IpProtocol/UDP + :icmp IpProtocol/ICMP} + v)] + p + (throw (IllegalArgumentException. + (str "Can't obtain IP protocol from " v " (valid :tcp, :udp and :icmp)")))) + (nil? v) IpProtocol/TCP + :else (throw (IllegalArgumentException. + (str "Can't obtain IP protocol from argument of type " (type v)))))) + +(defn authorize + "Adds permissions to a security group. + + e.g. (authorize compute \"jclouds#webserver#us-east-1\" 80 :ip-range \"0.0.0.0/0\") + (authorize compute \"jclouds#webserver#us-east-1\" [1000,2000] :protocol :udp)" + + [compute group-name port & {:keys [protocol ip-range region]}] + (let [group ((groups compute :region region) group-name) + [from-port to-port] (if (number? port) [port port] port)] + (if group + (.authorizeSecurityGroupIngressInRegion + (sg-service compute) (ebs/get-region region) (.getName group) (get-protocol protocol) from-port to-port (or ip-range "0.0.0.0/0")) + (throw (IllegalArgumentException. + (str "Can't find security group for name " group-name)))))) + +(defn revoke + "Revokes permissions from a security group. + + e.g. (revoke compute 80 \"jclouds#webserver#us-east-1\" :protocol :tcp 80 80 :ip-range \"0.0.0.0/0\")" + [compute group-name port & {:keys [protocol ip-range region]}] + (let [group ((groups compute :region region) group-name) + [from-port to-port] (if (number? port) [port port] port)] + (if group + (.revokeSecurityGroupIngressInRegion + (sg-service compute) (ebs/get-region region) (.getName group) (get-protocol protocol) from-port to-port (or ip-range "0.0.0.0/0")) + (throw (IllegalArgumentException. + (str "Can't find security group for name " group-name)))))) \ No newline at end of file From 140dd8711c3f2189db74aca5479c8314d550391c Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 11:52:56 -0700 Subject: [PATCH 02/40] Issue 574: work around bad date format --- .../org/jclouds/date/internal/DateUtils.java | 52 +++++++++++++++++++ .../internal/SimpleDateFormatDateService.java | 43 +++------------ .../org/jclouds/date/DateServiceTest.java | 34 +++++++----- .../jclouds/date/joda/JodaDateService.java | 33 +++--------- 4 files changed, 89 insertions(+), 73 deletions(-) create mode 100644 core/src/main/java/org/jclouds/date/internal/DateUtils.java diff --git a/core/src/main/java/org/jclouds/date/internal/DateUtils.java b/core/src/main/java/org/jclouds/date/internal/DateUtils.java new file mode 100644 index 0000000000..ae7e3f4e21 --- /dev/null +++ b/core/src/main/java/org/jclouds/date/internal/DateUtils.java @@ -0,0 +1,52 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.date.internal; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * @author Adrian Cole + */ +public class DateUtils { + + public static final Pattern NANOS_TO_MILLIS_PATTERN = Pattern.compile(".*[0-9][0-9][0-9][0-9][0-9][0-9]"); + + public static final Pattern TZ_PATTERN = Pattern.compile("(.*)[+-][0-9][0-9]:?[0-9][0-9]Z?"); + + public static String trimNanosToMillis(String toParse) { + if (NANOS_TO_MILLIS_PATTERN.matcher(toParse).matches()) + toParse = toParse.substring(0, toParse.length() - 3) + 'Z'; + return toParse; + } + + public static final Pattern SECOND_PATTERN = Pattern.compile(".*[0-2][0-9]:00"); + + public static String trimTZ(String toParse) { + Matcher matcher = TZ_PATTERN.matcher(toParse); + if (matcher.find()) { + toParse = matcher.group(1) + 'Z'; + } + if (toParse.length() == 25 && SECOND_PATTERN.matcher(toParse).matches()) + toParse = toParse.substring(0, toParse.length() - 6) + 'Z'; + return toParse; + } + +} \ No newline at end of file diff --git a/core/src/main/java/org/jclouds/date/internal/SimpleDateFormatDateService.java b/core/src/main/java/org/jclouds/date/internal/SimpleDateFormatDateService.java index 8a9f8249a3..9dbe5a6686 100755 --- a/core/src/main/java/org/jclouds/date/internal/SimpleDateFormatDateService.java +++ b/core/src/main/java/org/jclouds/date/internal/SimpleDateFormatDateService.java @@ -17,18 +17,16 @@ * ==================================================================== */ package org.jclouds.date.internal; +import static org.jclouds.date.internal.DateUtils.trimNanosToMillis; +import static org.jclouds.date.internal.DateUtils.trimTZ; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.SimpleTimeZone; -import java.util.regex.Pattern; - -import javax.annotation.Resource; import org.jclouds.date.DateService; -import org.jclouds.logging.Logger; /** * @@ -39,8 +37,6 @@ import org.jclouds.logging.Logger; */ public class SimpleDateFormatDateService implements DateService { - @Resource - protected Logger logger = Logger.NULL; /* * Use default Java Date/SimpleDateFormat classes for date manipulation, but be *very* careful to * guard against the lack of thread safety. @@ -50,16 +46,16 @@ public class SimpleDateFormatDateService implements DateService { "yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US); // @GuardedBy("this") - private static final SimpleDateFormat iso8601SimpleDateFormat = new SimpleDateFormat( - "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US); + private static final SimpleDateFormat iso8601SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", + Locale.US); // @GuardedBy("this") - private static final SimpleDateFormat rfc822SimpleDateFormat = new SimpleDateFormat( - "EEE, dd MMM yyyy HH:mm:ss z", Locale.US); + private static final SimpleDateFormat rfc822SimpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", + Locale.US); // @GuardedBy("this") - private static final SimpleDateFormat cSimpleDateFormat = new SimpleDateFormat( - "EEE MMM dd HH:mm:ss '+0000' yyyy", Locale.US); + private static final SimpleDateFormat cSimpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss '+0000' yyyy", + Locale.US); static { iso8601SimpleDateFormat.setTimeZone(new SimpleTimeZone(0, "GMT")); @@ -138,29 +134,6 @@ public class SimpleDateFormatDateService implements DateService { } } - public static final Pattern NANOS_TO_MILLIS_PATTERN = Pattern - .compile(".*[0-9][0-9][0-9][0-9][0-9][0-9]"); - - public static final Pattern TZ_PATTERN = Pattern.compile(".*[+-][0-9][0-9]:?[0-9][0-9]"); - - private String trimNanosToMillis(String toParse) { - if (NANOS_TO_MILLIS_PATTERN.matcher(toParse).matches()) - toParse = toParse.substring(0, toParse.length() - 3) + 'Z'; - return toParse; - } - - public static final Pattern SECOND_PATTERN = Pattern.compile(".*[0-2][0-9]:00"); - - private String trimTZ(String toParse) { - if (TZ_PATTERN.matcher(toParse).matches()) { - logger.trace("trimming tz from %s", toParse); - toParse = toParse.substring(0, toParse.length() - 6) + 'Z'; - } - if (toParse.length() == 25 && SECOND_PATTERN.matcher(toParse).matches()) - toParse = toParse.substring(0, toParse.length() - 6) + 'Z'; - return toParse; - } - public final Date iso8601SecondsDateParse(String toParse) { toParse = trimTZ(toParse); synchronized (iso8601SecondsSimpleDateFormat) { diff --git a/core/src/test/java/org/jclouds/date/DateServiceTest.java b/core/src/test/java/org/jclouds/date/DateServiceTest.java index 37aaba1ace..f93eb01c18 100755 --- a/core/src/test/java/org/jclouds/date/DateServiceTest.java +++ b/core/src/test/java/org/jclouds/date/DateServiceTest.java @@ -68,7 +68,7 @@ public class DateServiceTest extends PerformanceTest { public final Date date; TestData(String iso8601, String iso8601DateStringTz, String iso8601Seconds, String rfc822, String cDateString, - Date dateTime) { + Date dateTime) { this.iso8601DateString = iso8601; this.iso8601DateStringTz = iso8601DateStringTz; this.iso8601SecondsDateString = iso8601Seconds; @@ -81,18 +81,18 @@ public class DateServiceTest extends PerformanceTest { public DateServiceTest() { // Constant time test values, each TestData item must contain matching times! testData = new TestData[] { - new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07-04:00", "2009-03-12T02:00:07Z", - "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), - new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07+04:00", "2009-03-12T02:00:07Z", - "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), - new TestData("2009-03-14T04:00:07.000Z", "2009-03-14T04:00:07Z+04:00", "2009-03-14T04:00:07Z", - "Sat, 14 Mar 2009 04:00:07 GMT", "Thu Mar 14 04:00:07 +0000 2009", new Date(1237003207000l)), - new TestData("2009-03-16T06:00:07.000Z", "2009-03-16T06:00:07Z+04:00", "2009-03-16T06:00:07Z", - "Mon, 16 Mar 2009 06:00:07 GMT", "Thu Mar 16 06:00:07 +0000 2009", new Date(1237183207000l)), - new TestData("2009-03-18T08:00:07.000Z", "2009-03-18T08:00:07Z+04:00", "2009-03-18T08:00:07Z", - "Wed, 18 Mar 2009 08:00:07 GMT", "Thu Mar 18 08:00:07 +0000 2009", new Date(1237363207000l)), - new TestData("2009-03-20T10:00:07.000Z", "2009-03-20T10:00:07Z+04:00", "2009-03-20T10:00:07Z", - "Fri, 20 Mar 2009 10:00:07 GMT", "Thu Mar 20 10:00:07 +0000 2009", new Date(1237543207000l)) }; + new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07-04:00", "2009-03-12T02:00:07Z", + "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), + new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07+04:00", "2009-03-12T02:00:07Z", + "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), + new TestData("2009-03-14T04:00:07.000Z", "2009-03-14T04:00:07Z+04:00", "2009-03-14T04:00:07Z", + "Sat, 14 Mar 2009 04:00:07 GMT", "Thu Mar 14 04:00:07 +0000 2009", new Date(1237003207000l)), + new TestData("2009-03-16T06:00:07.000Z", "2009-03-16T06:00:07Z+04:00", "2009-03-16T06:00:07Z", + "Mon, 16 Mar 2009 06:00:07 GMT", "Thu Mar 16 06:00:07 +0000 2009", new Date(1237183207000l)), + new TestData("2009-03-18T08:00:07.000Z", "2009-03-18T08:00:07Z+04:00", "2009-03-18T08:00:07Z", + "Wed, 18 Mar 2009 08:00:07 GMT", "Thu Mar 18 08:00:07 +0000 2009", new Date(1237363207000l)), + new TestData("2009-03-20T10:00:07.000Z", "2009-03-20T10:00:07Z+04:00", "2009-03-20T10:00:07Z", + "Fri, 20 Mar 2009 10:00:07 GMT", "Thu Mar 20 10:00:07 +0000 2009", new Date(1237543207000l)) }; } @Test @@ -162,6 +162,14 @@ public class DateServiceTest extends PerformanceTest { assertEquals(dateService.rfc822DateFormat(date), "Sat, 26 Sep 2009 23:37:05 GMT"); } + @Test + void testTzWithExtraZ() throws ExecutionException, InterruptedException { + assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T06:14:13-04:00").toString(), + "Wed May 25 23:14:13 PDT 2011"); + assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T06:14:13-04:00Z").toString(), + "Wed May 25 23:14:13 PDT 2011"); + } + @Test void testRfc822DateFormatResponseTime() throws ExecutionException, InterruptedException { for (int i = 0; i < LOOP_COUNT; i++) diff --git a/drivers/joda/src/main/java/org/jclouds/date/joda/JodaDateService.java b/drivers/joda/src/main/java/org/jclouds/date/joda/JodaDateService.java index 86f72bc5a7..337c018235 100755 --- a/drivers/joda/src/main/java/org/jclouds/date/joda/JodaDateService.java +++ b/drivers/joda/src/main/java/org/jclouds/date/joda/JodaDateService.java @@ -18,9 +18,11 @@ */ package org.jclouds.date.joda; +import static org.jclouds.date.internal.DateUtils.trimNanosToMillis; +import static org.jclouds.date.internal.DateUtils.trimTZ; + import java.util.Date; import java.util.Locale; -import java.util.regex.Pattern; import javax.inject.Singleton; @@ -39,19 +41,16 @@ import org.joda.time.format.DateTimeFormatter; public class JodaDateService implements DateService { private static final DateTimeFormatter rfc822DateFormatter = DateTimeFormat.forPattern( - "EEE, dd MMM yyyy HH:mm:ss 'GMT'").withLocale(Locale.US).withZone( - DateTimeZone.forID("GMT")); + "EEE, dd MMM yyyy HH:mm:ss 'GMT'").withLocale(Locale.US).withZone(DateTimeZone.forID("GMT")); - private static final DateTimeFormatter cDateFormatter = DateTimeFormat.forPattern( - "EEE MMM dd HH:mm:ss '+0000' yyyy").withLocale(Locale.US).withZone( - DateTimeZone.forID("GMT")); + private static final DateTimeFormatter cDateFormatter = DateTimeFormat + .forPattern("EEE MMM dd HH:mm:ss '+0000' yyyy").withLocale(Locale.US).withZone(DateTimeZone.forID("GMT")); private static final DateTimeFormatter iso8601SecondsDateFormatter = DateTimeFormat.forPattern( "yyyy-MM-dd'T'HH:mm:ss'Z'").withLocale(Locale.US).withZone(DateTimeZone.forID("GMT")); private static final DateTimeFormatter iso8601DateFormatter = DateTimeFormat.forPattern( - "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").withLocale(Locale.US).withZone( - DateTimeZone.forID("GMT")); + "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").withLocale(Locale.US).withZone(DateTimeZone.forID("GMT")); public final Date fromSeconds(long seconds) { return new Date(seconds * 1000); @@ -98,27 +97,11 @@ public class JodaDateService implements DateService { } public final Date iso8601DateParse(String toParse) { + toParse = trimTZ(toParse); toParse = trimNanosToMillis(toParse); return iso8601DateFormatter.parseDateTime(toParse).toDate(); } - public static final Pattern NANOS_TO_MILLIS_PATTERN = Pattern - .compile(".*[0-9][0-9][0-9][0-9][0-9][0-9]"); - - private String trimNanosToMillis(String toParse) { - if (NANOS_TO_MILLIS_PATTERN.matcher(toParse).matches()) - toParse = toParse.substring(0, toParse.length() - 3) + 'Z'; - return toParse; - } - - public static final Pattern SECOND_PATTERN = Pattern.compile(".*[0-2][0-9]:00"); - - private String trimTZ(String toParse) { - if (toParse.length() == 25 && SECOND_PATTERN.matcher(toParse).matches()) - toParse = toParse.substring(0, toParse.length() - 6) + 'Z'; - return toParse; - } - public final Date iso8601SecondsDateParse(String toParse) { toParse = trimTZ(toParse); return iso8601SecondsDateFormatter.parseDateTime(toParse).toDate(); From ac698c33ec59feff64b85fa2ddf5162b28984e24 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 12:00:22 -0700 Subject: [PATCH 03/40] Issue 586:retry ssh on channel failures --- .../org/jclouds/ssh/jsch/JschSshClient.java | 342 ++++++++++++------ 1 file changed, 231 insertions(+), 111 deletions(-) diff --git a/drivers/jsch/src/main/java/org/jclouds/ssh/jsch/JschSshClient.java b/drivers/jsch/src/main/java/org/jclouds/ssh/jsch/JschSshClient.java index 4dea7af4e2..f46dec95d3 100644 --- a/drivers/jsch/src/main/java/org/jclouds/ssh/jsch/JschSshClient.java +++ b/drivers/jsch/src/main/java/org/jclouds/ssh/jsch/JschSshClient.java @@ -58,9 +58,7 @@ import com.google.inject.Inject; import com.jcraft.jsch.ChannelExec; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSch; -import com.jcraft.jsch.JSchException; import com.jcraft.jsch.Session; -import com.jcraft.jsch.SftpException; /** * This class needs refactoring. It is not thread safe. @@ -99,7 +97,7 @@ public class JschSshClient implements SshClient { @Inject(optional = true) @Named("jclouds.ssh.retryable_messages") @VisibleForTesting - String retryableMessages = "invalid data,End of IO Stream Read,Connection reset,connection is closed by foreign host,socket is not established"; + String retryableMessages = "failed to send channel request,channel is not opened,invalid data,End of IO Stream Read,Connection reset,connection is closed by foreign host,socket is not established"; @Inject(optional = true) @Named("jclouds.ssh.retry_predicate") @@ -128,81 +126,182 @@ public class JschSshClient implements SshClient { this.privateKey = privateKey; } - public Payload get(String path) { - checkNotNull(path, "path"); - - ChannelSftp sftp = getSftp(); - try { - return Payloads.newInputStreamPayload(new CloseFtpChannelOnCloseInputStream(sftp.get(path), sftp)); - } catch (SftpException e) { - throw new SshException(String.format("%s@%s:%d: Error getting path: %s", username, host, port, path), e); - } - } - - @Override - public void put(String path, Payload contents) { - checkNotNull(path, "path"); - checkNotNull(contents, "contents"); - ChannelSftp sftp = getSftp(); - try { - sftp.put(contents.getInput(), path); - } catch (SftpException e) { - throw new SshException(String.format("%s@%s:%d: Error putting path: %s", username, host, port, path), e); - } finally { - Closeables.closeQuietly(contents); - } - } - @Override public void put(String path, String contents) { put(path, Payloads.newStringPayload(checkNotNull(contents, "contents"))); } - private ChannelSftp getSftp() { - checkConnected(); - logger.debug("%s@%s:%d: Opening sftp Channel.", username, host, port); - ChannelSftp sftp = null; - try { - sftp = (ChannelSftp) session.openChannel("sftp"); - sftp.connect(); - } catch (JSchException e) { - throw new SshException(String.format("%s@%s:%d: Error connecting to sftp.", username, host, port), e); - } - return sftp; + private void checkConnected() { + checkState(session != null && session.isConnected(), String.format("(%s) Session not connected!", toString())); } - private void checkConnected() { - checkState(session != null && session.isConnected(), String.format("%s@%s:%d: SFTP not connected!", username, - host, port)); + public static interface Connection { + void clear(); + + T create() throws Exception; + } + + Connection sessionConnection = new Connection() { + + @Override + public void clear() { + if (session != null && session.isConnected()) { + session.disconnect(); + session = null; + } + } + + @Override + public Session create() throws Exception { + JSch jsch = new JSch(); + session = jsch.getSession(username, host, port); + if (timeout != 0) + session.setTimeout(timeout); + if (password != null) { + session.setPassword(password); + } else { + // jsch wipes out your private key + jsch.addIdentity(username, Arrays.copyOf(privateKey, privateKey.length), null, emptyPassPhrase); + } + java.util.Properties config = new java.util.Properties(); + config.put("StrictHostKeyChecking", "no"); + session.setConfig(config); + session.connect(); + return session; + } + + @Override + public String toString() { + return String.format("Session(%s)", JschSshClient.this.toString()); + } + }; + + protected > T acquire(C connection) { + connection.clear(); + Exception e = null; + String errorMessage = String.format("(%s) error acquiring %s", toString(), connection); + for (int i = 0; i < sshRetries; i++) { + try { + logger.debug(">> (%s) acquiring %s", toString(), connection); + T returnVal = connection.create(); + logger.debug("<< (%s) acquired %s", toString(), returnVal); + return returnVal; + } catch (Exception from) { + e = from; + connection.clear(); + + if (i == sshRetries) + throw propagate(from, errorMessage); + + if (shouldRetry(from)) { + logger.warn("<< " + errorMessage + ": " + from.getMessage()); + backoffForAttempt(i + 1, errorMessage + ": " + from.getMessage()); + continue; + } + throw propagate(from, errorMessage); + } + } + if (e != null) + throw propagate(e, errorMessage); + return null; } @PostConstruct public void connect() { - disconnect(); - Exception e = null; - RETRY_LOOP: for (int i = 0; i < sshRetries; i++) { - try { - newSession(); - e = null; - break RETRY_LOOP; - } catch (Exception from) { - e = from; - disconnect(); + acquire(sessionConnection); + } - if (i == sshRetries) - throw propagate(from); + Connection sftpConnection = new Connection() { - if (shouldRetry(from)) { - backoffForAttempt(i + 1, String.format("%s@%s:%d: connection error: %s", username, host, port, from - .getMessage())); - continue; - } + private ChannelSftp sftp; - throw propagate(from); - } + @Override + public void clear() { + if (sftp != null) + sftp.disconnect(); } - if (e != null) - throw propagate(e); + + @Override + public ChannelSftp create() throws Exception { + checkConnected(); + sftp = (ChannelSftp) session.openChannel("sftp"); + sftp.connect(); + return sftp; + } + + @Override + public String toString() { + return "ChannelSftp(" + JschSshClient.this.toString() + ")"; + } + }; + + class GetConnection implements Connection { + private final String path; + private ChannelSftp sftp; + + GetConnection(String path) { + this.path = checkNotNull(path, "path"); + } + + @Override + public void clear() { + if (sftp != null) + sftp.disconnect(); + } + + @Override + public Payload create() throws Exception { + sftp = acquire(sftpConnection); + return Payloads.newInputStreamPayload(new CloseFtpChannelOnCloseInputStream(sftp.get(path), sftp)); + } + + @Override + public String toString() { + return "Payload(" + JschSshClient.this.toString() + ")[" + path + "]"; + } + }; + + public Payload get(String path) { + return acquire(new GetConnection(path)); + } + + class PutConnection implements Connection { + private final String path; + private final Payload contents; + private ChannelSftp sftp; + + PutConnection(String path, Payload contents) { + this.path = checkNotNull(path, "path"); + this.contents = checkNotNull(contents, "contents"); + } + + @Override + public void clear() { + if (sftp != null) + sftp.disconnect(); + } + + @Override + public Void create() throws Exception { + sftp = acquire(sftpConnection); + try { + sftp.put(contents.getInput(), path); + } finally { + Closeables.closeQuietly(contents); + clear(); + } + return null; + } + + @Override + public String toString() { + return "Put(" + JschSshClient.this.toString() + ")[" + path + "]"; + } + }; + + @Override + public void put(String path, Payload contents) { + acquire(new PutConnection(path, contents)); } @VisibleForTesting @@ -223,52 +322,64 @@ public class JschSshClient implements SshClient { backoffLimitedRetryHandler.imposeBackoffExponentialDelay(200L, 2, retryAttempt, sshRetries, message); } - private void newSession() throws JSchException { - JSch jsch = new JSch(); - session = null; - try { - session = jsch.getSession(username, host, port); - if (timeout != 0) - session.setTimeout(timeout); - logger.debug("%s@%s:%d: Session created.", username, host, port); - if (password != null) { - session.setPassword(password); - } else { - // jsch wipes out your private key - jsch.addIdentity(username, Arrays.copyOf(privateKey, privateKey.length), null, emptyPassPhrase); - } - } catch (JSchException e) { - throw new SshException(String.format("%s@%s:%d: Error creating session.", username, host, port), e); - } - java.util.Properties config = new java.util.Properties(); - config.put("StrictHostKeyChecking", "no"); - session.setConfig(config); - session.connect(); - logger.debug("%s@%s:%d: Session connected.", username, host, port); + private SshException propagate(Exception e, String message) { + message += ": " + e.getMessage(); + logger.error(e, "<< " + message); + throw new SshException(message, e); } - private SshException propagate(Exception e) { - throw new SshException(String.format("%s@%s:%d: Error connecting to session.", username, host, port), e); + @Override + public String toString() { + return String.format("%s@%s:%d", username, host, port); } @PreDestroy public void disconnect() { - if (session != null && session.isConnected()) { - session.disconnect(); - session = null; - } + sessionConnection.clear(); } - public ExecResponse exec(String command) { - checkConnected(); - ChannelExec executor = null; - try { - try { - executor = (ChannelExec) session.openChannel("exec"); - executor.setPty(true); - } catch (JSchException e) { - throw new SshException(String.format("%s@%s:%d: Error connecting to exec.", username, host, port), e); - } + Connection execConnection = new Connection() { + + private ChannelExec executor = null; + + @Override + public void clear() { + if (executor != null) + executor.disconnect(); + } + + @Override + public ChannelExec create() throws Exception { + checkConnected(); + executor = (ChannelExec) session.openChannel("exec"); + executor.setPty(true); + return executor; + } + + @Override + public String toString() { + return "ChannelExec(" + JschSshClient.this.toString() + ")"; + } + + }; + + class ExecConnection implements Connection { + private final String command; + private ChannelExec executor; + + ExecConnection(String command) { + this.command = checkNotNull(command, "command"); + } + + @Override + public void clear() { + if (executor != null) + executor.disconnect(); + } + + @Override + public ExecResponse create() throws Exception { + executor = acquire(execConnection); executor.setCommand(command); ByteArrayOutputStream error = new ByteArrayOutputStream(); executor.setErrStream(error); @@ -278,20 +389,29 @@ public class JschSshClient implements SshClient { String errorString = error.toString(); int errorStatus = executor.getExitStatus(); int i = 0; - while ((errorStatus = executor.getExitStatus()) == -1 && i < this.sshRetries) - backoffForAttempt(++i, String.format("%s@%s:%d: bad status: -1", username, host, port)); + String message = String.format("bad status -1 %s", toString()); + while ((errorStatus = executor.getExitStatus()) == -1 && i < JschSshClient.this.sshRetries) { + logger.warn("<< " + message); + backoffForAttempt(++i, message); + } if (errorStatus == -1) - throw new SshException(String.format("%s@%s:%d: received exit status %d executing %s", username, host, - port, executor.getExitStatus(), command)); + throw new SshException(message); return new ExecResponse(outputString, errorString, errorStatus); - } catch (Exception e) { - throw new SshException(String - .format("%s@%s:%d: Error executing command: %s", username, host, port, command), e); + } finally { + if (executor != null) + executor.disconnect(); } - } finally { - if (executor != null) - executor.disconnect(); } + + @Override + public String toString() { + return "ExecResponse(" + JschSshClient.this.toString() + ")[" + command + "]"; + } + + }; + + public ExecResponse exec(String command) { + return acquire(new ExecConnection(command)); } @Override From e1b8110b1298b76ebed4b45775baa68193205a02 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 12:03:19 -0700 Subject: [PATCH 04/40] Issue 587:workaround clouds who do not have sftp enabled --- .../RunScriptOnNodeAsInitScriptUsingSsh.java | 21 ++++++++++++++++++- .../TerremarkECloudPropertiesBuilder.java | 7 +++++-- .../scriptbuilder/domain/AppendFile.java | 15 +++++++++---- .../scriptbuilder/domain/Statements.java | 4 ++++ 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java index 588f53570f..e4cefc4b50 100644 --- a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java +++ b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java @@ -32,13 +32,17 @@ import org.jclouds.compute.options.RunScriptOptions; import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.logging.Logger; import org.jclouds.scriptbuilder.InitBuilder; +import org.jclouds.scriptbuilder.domain.AppendFile; import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.scriptbuilder.domain.Statement; +import org.jclouds.scriptbuilder.domain.Statements; import org.jclouds.ssh.SshClient; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Objects; +import com.google.common.base.Splitter; +import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.AssistedInject; @@ -47,6 +51,7 @@ import com.google.inject.assistedinject.AssistedInject; * @author Adrian Cole */ public class RunScriptOnNodeAsInitScriptUsingSsh implements RunScriptOnNode { + public static final String PROPERTY_PUSH_INIT_SCRIPT_VIA_SFTP = "jclouds.compute.push-init-script-via-sftp"; @Resource @Named(ComputeServiceConstants.COMPUTE_LOGGER) protected Logger logger = Logger.NULL; @@ -59,6 +64,14 @@ public class RunScriptOnNodeAsInitScriptUsingSsh implements RunScriptOnNode { protected SshClient ssh; + /** + * true to use sftp, false to use ssh. If there's a problem with the sftp configuration, setting + * this to false will help. + */ + @Inject(optional = true) + @Named(PROPERTY_PUSH_INIT_SCRIPT_VIA_SFTP) + private boolean pushInitViaSftp = true; + @AssistedInject public RunScriptOnNodeAsInitScriptUsingSsh(Function sshFactory, @Assisted NodeMetadata node, @Assisted Statement script, @Assisted RunScriptOptions options) { @@ -104,7 +117,13 @@ public class RunScriptOnNodeAsInitScriptUsingSsh implements RunScriptOnNode { * ssh client is initialized through this call. */ protected ExecResponse doCall() { - ssh.put(name, init.render(OsFamily.UNIX)); + if (pushInitViaSftp) { + ssh.put(name, init.render(OsFamily.UNIX)); + } else { + ssh.exec("rm " + name); + ssh.exec(Statements.appendFile(name, Splitter.on('\n').split(init.render(OsFamily.UNIX)), + AppendFile.MARKER + "_" + name).render(OsFamily.UNIX)); + } ssh.exec("chmod 755 " + name); runAction("init"); return runAction("start"); diff --git a/providers/trmk-ecloud/src/main/java/org/jclouds/vcloud/terremark/TerremarkECloudPropertiesBuilder.java b/providers/trmk-ecloud/src/main/java/org/jclouds/vcloud/terremark/TerremarkECloudPropertiesBuilder.java index 5d26bb51c0..f5c256d726 100644 --- a/providers/trmk-ecloud/src/main/java/org/jclouds/vcloud/terremark/TerremarkECloudPropertiesBuilder.java +++ b/providers/trmk-ecloud/src/main/java/org/jclouds/vcloud/terremark/TerremarkECloudPropertiesBuilder.java @@ -21,6 +21,7 @@ package org.jclouds.vcloud.terremark; import static org.jclouds.Constants.PROPERTY_API_VERSION; import static org.jclouds.Constants.PROPERTY_ENDPOINT; import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; +import static org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSsh.PROPERTY_PUSH_INIT_SCRIPT_VIA_SFTP; import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_TIMEOUT_TASK_COMPLETED; import static org.jclouds.vcloud.terremark.reference.TerremarkConstants.PROPERTY_TERREMARK_EXTENSION_NAME; import static org.jclouds.vcloud.terremark.reference.TerremarkConstants.PROPERTY_TERREMARK_EXTENSION_VERSION; @@ -41,8 +42,10 @@ public class TerremarkECloudPropertiesBuilder extends TerremarkVCloudPropertiesB properties.setProperty(PROPERTY_ENDPOINT, "https://services.enterprisecloud.terremark.com/api"); properties.setProperty(PROPERTY_TERREMARK_EXTENSION_NAME, "eCloudExtensions"); properties.setProperty(PROPERTY_TERREMARK_EXTENSION_VERSION, "2.7"); - // for some reason the centos template is very slow to deploy - properties.setProperty(PROPERTY_VCLOUD_TIMEOUT_TASK_COMPLETED, 720l * 1000l + ""); + // default for ubuntu + properties.setProperty(PROPERTY_VCLOUD_TIMEOUT_TASK_COMPLETED, 360l * 1000l + ""); + // ubuntu image has a problem with sftp + properties.setProperty(PROPERTY_PUSH_INIT_SCRIPT_VIA_SFTP, "false"); return properties; } diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java index bb73a17b06..f6aefbf45a 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/AppendFile.java @@ -39,13 +39,20 @@ import com.google.common.collect.Maps; * @author Adrian Cole */ public class AppendFile implements Statement { - public final static String MARKER = "END_OF_FILE"; + public static final String MARKER = "END_OF_FILE"; + final String path; final Iterable lines; + final String marker; - public AppendFile(String path, Iterable lines) {// TODO: convert so + public AppendFile(String path, Iterable lines) { + this(path, lines, MARKER); + } + + public AppendFile(String path, Iterable lines, String marker) { this.path = checkNotNull(path, "path"); this.lines = checkNotNull(lines, "lines"); + this.marker = checkNotNull(marker, "marker"); checkState(Iterables.size(lines) > 0, "you must pass something to execute"); } @@ -84,11 +91,11 @@ public class AppendFile implements Statement { } private void hereFile(String path, StringBuilder builder) { - builder.append("cat >> ").append(path).append(" <<'").append(MARKER).append("'\n"); + builder.append("cat >> ").append(path).append(" <<'").append(marker).append("'\n"); for (String line : lines) { builder.append(line).append("\n"); } - builder.append(MARKER).append("\n"); + builder.append(marker).append("\n"); } private Statement appendToFile(String line, String path, OsFamily family) { diff --git a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java index 792b27c3d5..bcac021f98 100644 --- a/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java +++ b/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/domain/Statements.java @@ -67,6 +67,10 @@ public class Statements { return new AppendFile(path, lines); } + public static Statement appendFile(String path, Iterable lines, String marker) { + return new AppendFile(path, lines, marker); + } + public static Statement createRunScript(String instanceName, Iterable exports, String pwd, Iterable statements) {// TODO: convert so // that From b84a0e57fcbe12d1fff350483a018989597ac804 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 12:04:28 -0700 Subject: [PATCH 05/40] Issue 586: updated retryable messages to include channel failure --- .../main/java/org/jclouds/aws/ec2/AWSEC2PropertiesBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2PropertiesBuilder.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2PropertiesBuilder.java index b0ec4d771e..6cc2d1a91d 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2PropertiesBuilder.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2PropertiesBuilder.java @@ -44,7 +44,7 @@ public class AWSEC2PropertiesBuilder extends org.jclouds.ec2.EC2PropertiesBuilde // authorized key executes after ssh has started properties.setProperty("jclouds.ssh.max_retries", "7"); properties.setProperty("jclouds.ssh.retryable_messages", - "Auth fail,invalid data,End of IO Stream Read,Connection reset,socket is not established,connection is closed by foreign host,socket is not established"); + "Auth fail,failed to send channel request,channel is not opened,invalid data,End of IO Stream Read,Connection reset,socket is not established,connection is closed by foreign host,socket is not established"); properties.setProperty(PROPERTY_ENDPOINT, "https://ec2.us-east-1.amazonaws.com"); properties.putAll(Region.regionProperties()); // amazon, alestic, canonical, and rightscale From 0396126a8fbc17e11b23195485b8f2ccc039465e Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 12:05:42 -0700 Subject: [PATCH 06/40] cleaned up slicehost test --- .../SlicehostComputeServiceLiveTest.java | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostComputeServiceLiveTest.java b/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostComputeServiceLiveTest.java index fc8c04d84b..ec18651adf 100644 --- a/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostComputeServiceLiveTest.java +++ b/providers/slicehost/src/test/java/org/jclouds/slicehost/compute/SlicehostComputeServiceLiveTest.java @@ -18,16 +18,7 @@ */ package org.jclouds.slicehost.compute; -import static org.jclouds.compute.util.ComputeServiceUtils.getCores; -import static org.testng.Assert.assertEquals; - import org.jclouds.compute.BaseComputeServiceLiveTest; -import org.jclouds.compute.ComputeServiceContextFactory; -import org.jclouds.compute.domain.OsFamily; -import org.jclouds.compute.domain.Template; -import org.jclouds.rest.RestContext; -import org.jclouds.slicehost.SlicehostAsyncClient; -import org.jclouds.slicehost.SlicehostClient; import org.jclouds.ssh.jsch.config.JschSshClientModule; import org.testng.annotations.Test; @@ -43,27 +34,11 @@ public class SlicehostComputeServiceLiveTest extends BaseComputeServiceLiveTest provider = "slicehost"; } - @Test - public void testTemplateBuilder() { - Template defaultTemplate = client.templateBuilder().build(); - assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); - assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "10.04"); - assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); - assertEquals(defaultTemplate.getLocation().getId(), "slicehost"); - assertEquals(getCores(defaultTemplate.getHardware()), 0.25d); - } - @Override protected JschSshClientModule getSshModule() { return new JschSshClientModule(); } - public void testAssignability() throws Exception { - @SuppressWarnings("unused") - RestContext tmContext = new ComputeServiceContextFactory().createContext( - provider, identity, credential).getProviderSpecificContext(); - } - @Test(expectedExceptions = UnsupportedOperationException.class) public void testSuspendResume() throws Exception { super.testSuspendResume(); From 69a1b7a6aafdf0ba42429774f8791063f549d7bc Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 12:06:02 -0700 Subject: [PATCH 07/40] added usage statement to select all nodes --- compute/src/main/clojure/org/jclouds/compute2.clj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compute/src/main/clojure/org/jclouds/compute2.clj b/compute/src/main/clojure/org/jclouds/compute2.clj index e9b839ef8e..00d3ef2ed3 100644 --- a/compute/src/main/clojure/org/jclouds/compute2.clj +++ b/compute/src/main/clojure/org/jclouds/compute2.clj @@ -225,7 +225,11 @@ Here's an example of creating and running a small linux node in the group webser (defn destroy-nodes-matching "Destroy all the nodes in the fn pred. - pred should be a fn of one argument that takes a ComputeMetadata and returns true or false." + pred should be a fn of one argument that takes a ComputeMetadata and returns true or false. + + ;; destroy all nodes + (destroy-nodes-matching compute (constantly true)) + " ([#^ComputeService compute pred] (.destroyNodesMatching compute (to-predicate pred)))) From 281109dfc4d2c11dc24f390542e8297f3999acdb Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 12:07:27 -0700 Subject: [PATCH 08/40] added message to NPE when vdc isn't found --- .../compute/TerremarkVCloudComputeClient.java | 66 +++++++++---------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/common/trmk/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java b/common/trmk/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java index 3fdded8cba..9b2db963b2 100644 --- a/common/trmk/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java +++ b/common/trmk/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java @@ -18,15 +18,16 @@ */ package org.jclouds.vcloud.terremark.compute; +import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.Iterables.filter; import static com.google.common.collect.Iterables.getLast; import static org.jclouds.vcloud.terremark.options.AddInternetServiceOptions.Builder.withDescription; import java.net.URI; import java.util.Map; -import java.util.Map.Entry; import java.util.NoSuchElementException; import java.util.Set; +import java.util.Map.Entry; import javax.annotation.Nullable; import javax.inject.Inject; @@ -71,10 +72,10 @@ public class TerremarkVCloudComputeClient extends VCloudExpressComputeClientImpl @Inject protected TerremarkVCloudComputeClient(TerremarkVCloudClient client, - PopulateDefaultLoginCredentialsForImageStrategy credentialsProvider, - @Named("PASSWORD") Provider passwordGenerator, Predicate successTester, - Map vAppStatusToNodeState, Map credentialStore, - InternetServiceAndPublicIpAddressSupplier internetServiceAndPublicIpAddressSupplier) { + PopulateDefaultLoginCredentialsForImageStrategy credentialsProvider, + @Named("PASSWORD") Provider passwordGenerator, Predicate successTester, + Map vAppStatusToNodeState, Map credentialStore, + InternetServiceAndPublicIpAddressSupplier internetServiceAndPublicIpAddressSupplier) { super(client, successTester, vAppStatusToNodeState); this.client = client; this.credentialsProvider = credentialsProvider; @@ -85,7 +86,7 @@ public class TerremarkVCloudComputeClient extends VCloudExpressComputeClientImpl @Override public VCloudExpressVApp start(@Nullable URI VDC, URI templateId, String name, - InstantiateVAppTemplateOptions options, int... portsToOpen) { + InstantiateVAppTemplateOptions options, int... portsToOpen) { if (options.getDiskSizeKilobytes() != null) { logger.warn("trmk does not support resizing the primary disk; unsetting disk size"); } @@ -95,7 +96,7 @@ public class TerremarkVCloudComputeClient extends VCloudExpressComputeClientImpl String password = null; VCloudExpressVAppTemplate template = client.getVAppTemplate(templateId); if (template.getDescription().indexOf("Windows") != -1 - && options instanceof TerremarkInstantiateVAppTemplateOptions) { + && options instanceof TerremarkInstantiateVAppTemplateOptions) { password = passwordGenerator.get(); TerremarkInstantiateVAppTemplateOptions.class.cast(options).getProperties().put("password", password); } @@ -104,7 +105,7 @@ public class TerremarkVCloudComputeClient extends VCloudExpressComputeClientImpl VCloudExpressVApp vAppResponse = super.start(VDC, templateId, name, options, portsToOpen); if (password != null) { credentialStore.put("node#" + vAppResponse.getHref().toASCIIString(), new Credentials( - defaultCredentials.identity, password)); + defaultCredentials.identity, password)); } if (portsToOpen.length > 0) createPublicAddressMappedToPorts(vAppResponse.getHref(), portsToOpen); @@ -119,41 +120,37 @@ public class TerremarkVCloudComputeClient extends VCloudExpressComputeClientImpl InternetService is = null; Protocol protocol; switch (port) { - case 22: - protocol = Protocol.TCP; - break; - case 80: - case 8080: - protocol = Protocol.HTTP; - break; - case 443: - protocol = Protocol.HTTPS; - break; - default: - protocol = Protocol.HTTP; - break; + case 22: + protocol = Protocol.TCP; + break; + case 80: + case 8080: + protocol = Protocol.HTTP; + break; + case 443: + protocol = Protocol.HTTPS; + break; + default: + protocol = Protocol.HTTP; + break; } if (ip == null) { Entry entry = internetServiceAndPublicIpAddressSupplier - .getNewInternetServiceAndIp(vApp, port, protocol); + .getNewInternetServiceAndIp(vApp, port, protocol); is = entry.getKey(); ip = entry.getValue(); } else { logger.debug(">> adding InternetService %s:%s:%d", ip.getAddress(), protocol, port); - is = client.addInternetServiceToExistingIp( - ip.getId(), - vApp.getName() + "-" + port, - protocol, - port, - withDescription(String.format("port %d access to serverId: %s name: %s", port, vApp.getName(), - vApp.getName()))); + is = client.addInternetServiceToExistingIp(ip.getId(), vApp.getName() + "-" + port, protocol, port, + withDescription(String.format("port %d access to serverId: %s name: %s", port, vApp.getName(), + vApp.getName()))); } - logger.debug("<< created InternetService(%s) %s:%s:%d", is.getName(), is.getPublicIpAddress().getAddress(), - is.getProtocol(), is.getPort()); + logger.debug("<< created InternetService(%s) %s:%s:%d", is.getName(), is.getPublicIpAddress().getAddress(), is + .getProtocol(), is.getPort()); logger.debug(">> adding Node %s:%d -> %s:%d", is.getPublicIpAddress().getAddress(), is.getPort(), - privateAddress, port); + privateAddress, port); Node node = client.addNode(is.getId(), privateAddress, vApp.getName() + "-" + port, port); logger.debug("<< added Node(%s)", node.getName()); } @@ -161,19 +158,20 @@ public class TerremarkVCloudComputeClient extends VCloudExpressComputeClientImpl } private Set deleteInternetServicesAndNodesAssociatedWithVApp(VCloudExpressVApp vApp) { + checkNotNull(vApp.getVDC(), "VDC reference missing for vApp(%s)", vApp.getName()); Set ipAddresses = Sets.newHashSet(); SERVICE: for (InternetService service : client.getAllInternetServicesInVDC(vApp.getVDC().getHref())) { for (Node node : client.getNodes(service.getId())) { if (vApp.getNetworkToAddresses().containsValue(node.getIpAddress())) { ipAddresses.add(service.getPublicIpAddress()); logger.debug(">> deleting Node(%s) %s:%d -> %s:%d", node.getName(), service.getPublicIpAddress() - .getAddress(), service.getPort(), node.getIpAddress(), node.getPort()); + .getAddress(), service.getPort(), node.getIpAddress(), node.getPort()); client.deleteNode(node.getId()); logger.debug("<< deleted Node(%s)", node.getName()); Set nodes = client.getNodes(service.getId()); if (nodes.size() == 0) { logger.debug(">> deleting InternetService(%s) %s:%d", service.getName(), service.getPublicIpAddress() - .getAddress(), service.getPort()); + .getAddress(), service.getPort()); client.deleteInternetService(service.getId()); logger.debug("<< deleted InternetService(%s)", service.getName()); continue SERVICE; From f9dbfda92dd0801201fd94bc715b7d14daa00e5d Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 12:07:58 -0700 Subject: [PATCH 09/40] updated ecloud live test to use ubuntu 10.04 --- .../terremark/TerremarkClientLiveTest.java | 26 ++++++++++--------- .../TerremarkECloudClientLiveTest.java | 6 ++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/common/trmk/src/test/java/org/jclouds/vcloud/terremark/TerremarkClientLiveTest.java b/common/trmk/src/test/java/org/jclouds/vcloud/terremark/TerremarkClientLiveTest.java index 4f8d365a21..8fbdcf132a 100644 --- a/common/trmk/src/test/java/org/jclouds/vcloud/terremark/TerremarkClientLiveTest.java +++ b/common/trmk/src/test/java/org/jclouds/vcloud/terremark/TerremarkClientLiveTest.java @@ -88,14 +88,16 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes protected TerremarkVCloudClient tmClient; protected Factory sshFactory; - private String publicIp; - private InternetService is; - private Node node; - private VCloudExpressVApp vApp; - private RetryablePredicate socketTester; - private RetryablePredicate successTester; - private VCloudExpressVApp clone; - private VDC vdc; + protected String publicIp; + protected InternetService is; + protected Node node; + protected VCloudExpressVApp vApp; + protected RetryablePredicate socketTester; + protected RetryablePredicate successTester; + protected Injector injector; + + protected VCloudExpressVApp clone; + protected VDC vdc; public static final String PREFIX = System.getProperty("user.name") + "-terremark"; @Test @@ -281,7 +283,7 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes loopAndCheckPass(); } - private void loopAndCheckPass() throws IOException { + protected void loopAndCheckPass() throws IOException { for (int i = 0; i < 5; i++) {// retry loop TODO replace with predicate. try { doCheckPass(publicIp); @@ -373,7 +375,7 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes loopAndCheckPass(); } - private void verifyConfigurationOfVApp(VCloudExpressVApp vApp, String serverName, String expectedOs, + protected void verifyConfigurationOfVApp(VCloudExpressVApp vApp, String serverName, String expectedOs, int processorCount, long memory, long hardDisk) { assertEquals(vApp.getName(), serverName); assertEquals(vApp.getOperatingSystemDescription(), expectedOs); @@ -387,7 +389,7 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes CIMPredicates.resourceTypeIn(ResourceType.DISK_DRIVE)).getVirtualQuantity().longValue()); } - private void doCheckPass(String address) throws IOException { + protected void doCheckPass(String address) throws IOException { IPSocket socket = new IPSocket(address, 22); System.out.printf("%d: %s awaiting ssh service to start%n", System.currentTimeMillis(), socket); @@ -466,7 +468,7 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes setupCredentials(); Properties overrides = setupProperties(); - Injector injector = new RestContextFactory().createContextBuilder(provider, + injector = new RestContextFactory().createContextBuilder(provider, ImmutableSet. of(new Log4JLoggingModule(), new JschSshClientModule()), overrides) .buildInjector(); diff --git a/providers/trmk-ecloud/src/test/java/org/jclouds/vcloud/terremark/TerremarkECloudClientLiveTest.java b/providers/trmk-ecloud/src/test/java/org/jclouds/vcloud/terremark/TerremarkECloudClientLiveTest.java index 7be2afcaeb..df53e98da6 100644 --- a/providers/trmk-ecloud/src/test/java/org/jclouds/vcloud/terremark/TerremarkECloudClientLiveTest.java +++ b/providers/trmk-ecloud/src/test/java/org/jclouds/vcloud/terremark/TerremarkECloudClientLiveTest.java @@ -44,8 +44,8 @@ public class TerremarkECloudClientLiveTest extends TerremarkClientLiveTest { @BeforeClass void setProvider() { this.provider = "trmk-ecloud"; - this.itemName = "Ubuntu 8.04 LTS (x86)"; - expectedOs = "Ubuntu Linux (32-bit)"; + this.itemName = "Ubuntu Server 10.04 x64"; + expectedOs = "Ubuntu Linux (64-bit)"; } @Override @@ -55,7 +55,7 @@ public class TerremarkECloudClientLiveTest extends TerremarkClientLiveTest { @Override protected SshClient getConnectionFor(IPSocket socket) { - return sshFactory.create(socket, new Credentials("ecloud", "$Ep455l0ud!2")); + return sshFactory.create(socket, new Credentials("ecloud", "TmrkCl0ud1s#1!")); } @Override From 20b32e77a9a39b210ef2366b871d0d921c0d1fbb Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 1 Jun 2011 21:16:33 +0200 Subject: [PATCH 10/40] Added instructions to generate Twitter consumer keys and access tokens to READMEs --- .../gae-tweetstore-spring/README.txt | 20 +++++++++------- .../gae-tweetstore/README.txt | 20 +++++++++------- .../runatcloud-tweetstore/README.txt | 24 +++++++++++-------- 3 files changed, 38 insertions(+), 26 deletions(-) rename demos/{ => tweetstore}/gae-tweetstore-spring/README.txt (63%) rename demos/{ => tweetstore}/gae-tweetstore/README.txt (58%) mode change 100755 => 100644 rename demos/{ => tweetstore}/runatcloud-tweetstore/README.txt (50%) diff --git a/demos/gae-tweetstore-spring/README.txt b/demos/tweetstore/gae-tweetstore-spring/README.txt similarity index 63% rename from demos/gae-tweetstore-spring/README.txt rename to demos/tweetstore/gae-tweetstore-spring/README.txt index dc9b56bbdb..58a8144f56 100644 --- a/demos/gae-tweetstore-spring/README.txt +++ b/demos/tweetstore/gae-tweetstore-spring/README.txt @@ -25,6 +25,8 @@ It should not be regarded as a sample of how to write a web application using Sp however! The original jclouds-demo-gae-tweetstore has been modified in as few places as possible; it has not been rewritten in the style of a Spring MVC application. +A guide to generating Twitter consumer keys and access tokens is at http://tinyurl.com/2fhebgb + This sample uses the Google App Engine for Java SDK located at http://code.google.com/p/googleappengine/downloads/list @@ -48,13 +50,15 @@ attempting to run 'mvn -Plive install' true - YOUR_ACCESS_KEY_ID - YOUR_SECRET_KEY - YOUR_USER - YOUR_HEX_KEY - YOUR_ACCOUNT - YOUR_BASE64_ENCODED_KEY - YOUR_TWITTER_USERNAME - YOUR_TWITTER_PASSWORD + YOUR_ACCESS_KEY_ID + YOUR_SECRET_KEY + YOUR_USER + YOUR_HEX_KEY + YOUR_ACCOUNT + YOUR_BASE64_ENCODED_KEY + YOUR_TWITTER_CONSUMER_KEY + YOUR_TWITTER_CONSUMER_SECRET + YOUR_TWITTER_ACCESSTOKEN + YOUR_TWITTER_ACCESSTOKEN_SECRET \ No newline at end of file diff --git a/demos/gae-tweetstore/README.txt b/demos/tweetstore/gae-tweetstore/README.txt old mode 100755 new mode 100644 similarity index 58% rename from demos/gae-tweetstore/README.txt rename to demos/tweetstore/gae-tweetstore/README.txt index 7d9623f978..e093de0f76 --- a/demos/gae-tweetstore/README.txt +++ b/demos/tweetstore/gae-tweetstore/README.txt @@ -17,6 +17,8 @@ ==================================================================== ==== +A guide to generating Twitter consumer keys and access tokens is at http://tinyurl.com/2fhebgb + This sample uses the Google App Engine for Java SDK located at http://code.google.com/p/googleappengine/downloads/list @@ -40,13 +42,15 @@ attempting to run 'mvn -Plive install' true - YOUR_ACCESS_KEY_ID - YOUR_SECRET_KEY - YOUR_USER - YOUR_HEX_KEY - YOUR_ACCOUNT - YOUR_BASE64_ENCODED_KEY - YOUR_TWITTER_USERNAME - YOUR_TWITTER_PASSWORD + YOUR_ACCESS_KEY_ID + YOUR_SECRET_KEY + YOUR_USER + YOUR_HEX_KEY + YOUR_ACCOUNT + YOUR_BASE64_ENCODED_KEY + YOUR_TWITTER_CONSUMER_KEY + YOUR_TWITTER_CONSUMER_SECRET + YOUR_TWITTER_ACCESSTOKEN + YOUR_TWITTER_ACCESSTOKEN_SECRET \ No newline at end of file diff --git a/demos/runatcloud-tweetstore/README.txt b/demos/tweetstore/runatcloud-tweetstore/README.txt similarity index 50% rename from demos/runatcloud-tweetstore/README.txt rename to demos/tweetstore/runatcloud-tweetstore/README.txt index f789b19e44..11b9884f0f 100644 --- a/demos/runatcloud-tweetstore/README.txt +++ b/demos/tweetstore/runatcloud-tweetstore/README.txt @@ -17,6 +17,8 @@ ==================================================================== ==== +A guide to generating Twitter consumer keys and access tokens is at http://tinyurl.com/2fhebgb + Please modify your maven settings.xml like below before attempting to run 'mvn -Plive install' @@ -25,8 +27,8 @@ Please modify your maven settings.xml like below before attempting to run 'mvn - true - yourappid - yourenv + yourapikey + yoursecret @@ -36,13 +38,15 @@ Please modify your maven settings.xml like below before attempting to run 'mvn - true - YOUR_ACCESS_KEY_ID - YOUR_SECRET_KEY - YOUR_USER - YOUR_HEX_KEY - YOUR_ACCOUNT - YOUR_BASE64_ENCODED_KEY - YOUR_TWITTER_USERNAME - YOUR_TWITTER_PASSWORD + YOUR_ACCESS_KEY_ID + YOUR_SECRET_KEY + YOUR_USER + YOUR_HEX_KEY + YOUR_ACCOUNT + YOUR_BASE64_ENCODED_KEY + YOUR_TWITTER_CONSUMER_KEY + YOUR_TWITTER_CONSUMER_SECRET + YOUR_TWITTER_ACCESSTOKEN + YOUR_TWITTER_ACCESSTOKEN_SECRET \ No newline at end of file From c29765d1d059ee890c3fd4fb9577d4e21a12fc3d Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 1 Jun 2011 21:32:08 +0200 Subject: [PATCH 11/40] Created a TweetStore parent project, updated twitter4j to 2.2 and switched to OAuth --- demos/gae-tweetstore/pom.xml | 313 ------------------ demos/pom.xml | 3 - .../gae-tweetstore-spring/pom.xml | 104 +----- .../demo/tweetstore/config/LoggingConfig.java | 76 ++--- .../config/SpringServletConfig.java | 1 - .../controller/AddTweetsController.java | 0 .../controller/StoreTweetsController.java | 0 .../tweetstore/domain/StoredTweetStatus.java | 0 .../functions/KeyToStoredTweetStatus.java | 0 .../ServiceToStoredTweetStatuses.java | 0 .../reference/TweetStoreConstants.java | 0 .../src/main/platform}/appengine-web.xml | 0 .../src/main/platform}/logging.properties | 0 .../webapp/WEB-INF/dispatcher-servlet.xml | 74 ++--- .../src/main/webapp/WEB-INF/queue.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/index.jsp | 0 .../src/main/webapp/tweets.jsp | 0 .../controller/AddTweetsControllerTest.java | 0 .../controller/StoreTweetsControllerTest.java | 0 .../functions/KeyToStoredTweetStatusTest.java | 0 .../ServiceToStoredTweetStatusesTest.java | 0 .../integration/GoogleDevServer.java | 0 .../integration/TweetStoreLiveTest.java | 54 ++- .../src/test/resources/log4j.xml | 0 demos/tweetstore/gae-tweetstore/pom.xml | 236 +++++++++++++ .../tweetstore/config/GuiceServletConfig.java | 0 .../controller/AddTweetsController.java | 0 .../controller/StoreTweetsController.java | 0 .../tweetstore/domain/StoredTweetStatus.java | 0 .../functions/KeyToStoredTweetStatus.java | 0 .../ServiceToStoredTweetStatuses.java | 0 .../reference/TweetStoreConstants.java | 0 .../src/main/platform}/appengine-web.xml | 0 .../src/main/platform}/logging.properties | 0 .../src/main/webapp/WEB-INF/queue.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../gae-tweetstore/src/main/webapp/index.jsp | 0 .../gae-tweetstore/src/main/webapp/tweets.jsp | 0 .../controller/AddTweetsControllerTest.java | 0 .../controller/StoreTweetsControllerTest.java | 0 .../functions/KeyToStoredTweetStatusTest.java | 0 .../ServiceToStoredTweetStatusesTest.java | 0 .../integration/GoogleDevServer.java | 0 .../integration/TweetStoreLiveTest.java | 58 ++-- .../src/test/resources/log4j.xml | 0 demos/tweetstore/pom.xml | 137 ++++++++ .../runatcloud-tweetstore/pom.xml | 119 ++----- .../tweetstore/config/GuiceServletConfig.java | 0 .../config/utils/HttpRequestTask.java | 0 .../config/utils/ImmutableHttpCommand.java | 0 .../tweetstore/config/utils/ObjectFields.java | 0 .../tweetstore/config/utils/TaskQueue.java | 0 .../controller/AddTweetsController.java | 0 .../controller/StoreTweetsController.java | 0 .../tweetstore/domain/StoredTweetStatus.java | 0 .../functions/KeyToStoredTweetStatus.java | 0 .../ServiceToStoredTweetStatuses.java | 0 .../reference/TweetStoreConstants.java | 0 .../src/main/platform}/cloudbees-web.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/index.jsp | 0 .../src/main/webapp/tweets.jsp | 0 .../controller/AddTweetsControllerTest.java | 0 .../controller/StoreTweetsControllerTest.java | 0 .../functions/KeyToStoredTweetStatusTest.java | 0 .../ServiceToStoredTweetStatusesTest.java | 0 .../integration/RunAtCloudServer.java | 0 .../integration/StaxSdkAppServer2.java | 0 .../integration/TweetStoreLiveTest.java | 55 ++- .../src/test/resources/log4j.xml | 0 71 files changed, 603 insertions(+), 627 deletions(-) delete mode 100644 demos/gae-tweetstore/pom.xml rename demos/{ => tweetstore}/gae-tweetstore-spring/pom.xml (73%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/LoggingConfig.java (97%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java (99%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java (100%) rename demos/{gae-tweetstore-spring/src/main/appengine => tweetstore/gae-tweetstore-spring/src/main/platform}/appengine-web.xml (100%) rename demos/{gae-tweetstore-spring/src/main/appengine => tweetstore/gae-tweetstore-spring/src/main/platform}/logging.properties (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/webapp/WEB-INF/dispatcher-servlet.xml (98%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/webapp/WEB-INF/queue.xml (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/webapp/WEB-INF/web.xml (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/webapp/index.jsp (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/main/webapp/tweets.jsp (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java (100%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java (77%) rename demos/{ => tweetstore}/gae-tweetstore-spring/src/test/resources/log4j.xml (100%) create mode 100644 demos/tweetstore/gae-tweetstore/pom.xml rename demos/{ => tweetstore}/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java (100%) rename demos/{gae-tweetstore/src/main/appengine => tweetstore/gae-tweetstore/src/main/platform}/appengine-web.xml (100%) mode change 100755 => 100644 rename demos/{gae-tweetstore/src/main/appengine => tweetstore/gae-tweetstore/src/main/platform}/logging.properties (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/main/webapp/WEB-INF/queue.xml (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/main/webapp/WEB-INF/web.xml (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/main/webapp/index.jsp (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/main/webapp/tweets.jsp (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java (100%) rename demos/{ => tweetstore}/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java (100%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java (80%) mode change 100755 => 100644 rename demos/{ => tweetstore}/gae-tweetstore/src/test/resources/log4j.xml (100%) mode change 100755 => 100644 create mode 100644 demos/tweetstore/pom.xml rename demos/{ => tweetstore}/runatcloud-tweetstore/pom.xml (72%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/HttpRequestTask.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ImmutableHttpCommand.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ObjectFields.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/TaskQueue.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java (100%) rename demos/{runatcloud-tweetstore/src/main/webapp/WEB-INF => tweetstore/runatcloud-tweetstore/src/main/platform}/cloudbees-web.xml (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/webapp/WEB-INF/web.xml (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/webapp/index.jsp (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/main/webapp/tweets.jsp (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/RunAtCloudServer.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/StaxSdkAppServer2.java (100%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java (79%) rename demos/{ => tweetstore}/runatcloud-tweetstore/src/test/resources/log4j.xml (100%) diff --git a/demos/gae-tweetstore/pom.xml b/demos/gae-tweetstore/pom.xml deleted file mode 100644 index 44e81fa938..0000000000 --- a/demos/gae-tweetstore/pom.xml +++ /dev/null @@ -1,313 +0,0 @@ - - - - 4.0.0 - - org.jclouds - jclouds-demos-project - 1.0-SNAPSHOT - - jclouds-demo-gae-tweetstore - war - JClouds TweetStore for Google App Engine - JClouds TweetStore for Google App Engine using Guice for Dependency Injection - - - - jclouds-tweetstore - 1.4.2 - localhost - 8088 - cloudfiles-us,aws-s3,azureblob - jclouds-tweetstore - - - - - ${project.groupId} - jclouds-blobstore - ${project.version} - - - org.twitter4j - twitter4j-core - [2.1,) - - - ${project.groupId} - jclouds-blobstore - ${project.version} - test-jar - test - - - org.jclouds.provider - aws-s3 - ${project.version} - runtime - - - org.jclouds.provider - cloudfiles-us - ${project.version} - runtime - - - org.jclouds.provider - azureblob - ${project.version} - runtime - - - org.jclouds.driver - jclouds-gae - ${project.version} - - - com.google.inject.extensions - guice-servlet - 3.0 - - - displaytag - displaytag - 1.2 - runtime - - - org.slf4j - slf4j-log4j12 - - - - - org.slf4j - slf4j-jdk14 - 1.5.6 - runtime - - - jstl - javax.servlet - 1.1.2 - runtime - - - standard - taglibs - 1.1.2 - runtime - - - javax.servlet - servlet-api - 2.5 - provided - - - - - com.google.appengine - appengine-api-1.0-sdk - ${appengine.sdk.version} - - - com.google.appengine - appengine-tools-sdk - ${appengine.sdk.version} - test - - - - - - - - - ${project.artifactId} - - - maven-war-plugin - - - - src/main/appengine - WEB-INF/ - true - - - - - - maven-surefire-plugin - - - integration - integration-test - - test - - - - - appengine.sdk.root - ${appengine.sdk.root} - - - devappserver.address - ${devappserver.address} - - - devappserver.port - ${devappserver.port} - - - warfile - ${project.build.directory}/${project.artifactId} - - - - - - - - - - - - live - - - - maven-surefire-plugin - - - integration - integration-test - - test - - - - - test.twitter.identity - ${test.twitter.identity} - - - test.twitter.credential - ${test.twitter.credential} - - - test.azureblob.identity - ${test.azureblob.identity} - - - test.azureblob.credential - ${test.azureblob.credential} - - - test.cloudfiles-us.identity - ${test.cloudfiles-us.identity} - - - test.cloudfiles-us.credential - ${test.cloudfiles-us.credential} - - - test.aws-s3.identity - ${test.aws-s3.identity} - - - test.aws-s3.credential - ${test.aws-s3.credential} - - - appengine.sdk.root - ${appengine.sdk.root} - - - devappserver.address - ${devappserver.address} - - - devappserver.port - ${devappserver.port} - - - jclouds.tweetstore.blobstores - ${jclouds.tweetstore.blobstores} - - - jclouds.tweetstore.container - ${jclouds.tweetstore.container} - - - warfile - ${project.build.directory}/${project.artifactId} - - - - - - - - - - - diff --git a/demos/pom.xml b/demos/pom.xml index 50209cbeae..d1b0d379ec 100644 --- a/demos/pom.xml +++ b/demos/pom.xml @@ -32,12 +32,9 @@ pom jclouds demos project - gae-tweetstore - gae-tweetstore-spring getpath googleappengine perftest - runatcloud-tweetstore speedtest-azurequeue speedtest-sqs simpledb diff --git a/demos/gae-tweetstore-spring/pom.xml b/demos/tweetstore/gae-tweetstore-spring/pom.xml similarity index 73% rename from demos/gae-tweetstore-spring/pom.xml rename to demos/tweetstore/gae-tweetstore-spring/pom.xml index 5be9f733b2..5f4e9deb31 100644 --- a/demos/gae-tweetstore-spring/pom.xml +++ b/demos/tweetstore/gae-tweetstore-spring/pom.xml @@ -24,7 +24,7 @@ 4.0.0 org.jclouds - jclouds-demos-project + jclouds-demos-tweetstore-project 1.0-SNAPSHOT jclouds-demo-gae-tweetstore-spring @@ -41,46 +41,10 @@ 1.4.2 localhost 8088 - cloudfiles-us,aws-s3,azureblob jclouds-tweetstore-spring - - ${project.groupId} - jclouds-blobstore - ${project.version} - - - org.twitter4j - twitter4j-core - [2.1,) - - - ${project.groupId} - jclouds-blobstore - ${project.version} - test-jar - test - - - org.jclouds.provider - aws-s3 - ${project.version} - runtime - - - org.jclouds.provider - cloudfiles-us - ${project.version} - runtime - - - org.jclouds.provider - azureblob - ${project.version} - runtime - org.jclouds.driver jclouds-gae @@ -102,42 +66,6 @@ 2.2 runtime - - displaytag - displaytag - 1.2 - runtime - - - org.slf4j - slf4j-log4j12 - - - - - org.slf4j - slf4j-jdk14 - 1.5.6 - runtime - - - standard - taglibs - 1.1.2 - runtime - - - jstl - javax.servlet - 1.1.2 - runtime - - - javax.servlet - servlet-api - 2.5 - provided - @@ -152,21 +80,9 @@ test + - ${project.artifactId} - - maven-war-plugin - - - - src/main/appengine - WEB-INF/ - true - - - - maven-surefire-plugin @@ -219,12 +135,20 @@ - test.twitter.identity - ${test.twitter.identity} + test.twitter.consumer.identity + ${test.twitter.gae-tweetstore-spring.consumer.identity} - test.twitter.credential - ${test.twitter.credential} + test.twitter.consumer.credential + ${test.twitter.gae-tweetstore-spring.consumer.credential} + + + test.twitter.access.identity + ${test.twitter.gae-tweetstore-spring.access.identity} + + + test.twitter.access.credential + ${test.twitter.gae-tweetstore-spring.access.credential} test.azureblob.identity diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/LoggingConfig.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/LoggingConfig.java similarity index 97% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/LoggingConfig.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/LoggingConfig.java index 3983f34aae..f136619933 100644 --- a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/LoggingConfig.java +++ b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/LoggingConfig.java @@ -1,38 +1,38 @@ -/** - * - * Copyright (C) 2011 Cloud Conscious, LLC. - * - * ==================================================================== - * 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.demo.tweetstore.config; - -import org.jclouds.logging.Logger; -import org.jclouds.logging.Logger.LoggerFactory; -import org.jclouds.logging.jdk.JDKLogger; - -/** - * Spring config that provides a logger. - * - * @author Andrew Phillips - */ -abstract class LoggingConfig { - private static final LoggerFactory FACTORY = new JDKLogger.JDKLoggerFactory(); - protected final Logger logger; - - protected LoggingConfig() { - logger = FACTORY.getLogger(this.getClass().getName()); - } - -} +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.demo.tweetstore.config; + +import org.jclouds.logging.Logger; +import org.jclouds.logging.Logger.LoggerFactory; +import org.jclouds.logging.jdk.JDKLogger; + +/** + * Spring config that provides a logger. + * + * @author Andrew Phillips + */ +abstract class LoggingConfig { + private static final LoggerFactory FACTORY = new JDKLogger.JDKLoggerFactory(); + protected final Logger logger; + + protected LoggingConfig() { + logger = FACTORY.getLogger(this.getClass().getName()); + } + +} diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java similarity index 99% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java index 9cb71791c5..5b458d32e0 100644 --- a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java +++ b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java @@ -55,7 +55,6 @@ import twitter4j.conf.ConfigurationBuilder; import com.google.appengine.api.taskqueue.Queue; import com.google.appengine.api.taskqueue.QueueFactory; -import com.google.appengine.api.taskqueue.TaskOptions.Builder; import com.google.appengine.api.taskqueue.TaskOptions.Method; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableSet; diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java similarity index 100% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java similarity index 100% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java similarity index 100% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java similarity index 100% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java similarity index 100% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java similarity index 100% rename from demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java rename to demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java diff --git a/demos/gae-tweetstore-spring/src/main/appengine/appengine-web.xml b/demos/tweetstore/gae-tweetstore-spring/src/main/platform/appengine-web.xml similarity index 100% rename from demos/gae-tweetstore-spring/src/main/appengine/appengine-web.xml rename to demos/tweetstore/gae-tweetstore-spring/src/main/platform/appengine-web.xml diff --git a/demos/gae-tweetstore-spring/src/main/appengine/logging.properties b/demos/tweetstore/gae-tweetstore-spring/src/main/platform/logging.properties similarity index 100% rename from demos/gae-tweetstore-spring/src/main/appengine/logging.properties rename to demos/tweetstore/gae-tweetstore-spring/src/main/platform/logging.properties diff --git a/demos/gae-tweetstore-spring/src/main/webapp/WEB-INF/dispatcher-servlet.xml b/demos/tweetstore/gae-tweetstore-spring/src/main/webapp/WEB-INF/dispatcher-servlet.xml similarity index 98% rename from demos/gae-tweetstore-spring/src/main/webapp/WEB-INF/dispatcher-servlet.xml rename to demos/tweetstore/gae-tweetstore-spring/src/main/webapp/WEB-INF/dispatcher-servlet.xml index fd82460f9e..6b65ce8a8c 100644 --- a/demos/gae-tweetstore-spring/src/main/webapp/WEB-INF/dispatcher-servlet.xml +++ b/demos/tweetstore/gae-tweetstore-spring/src/main/webapp/WEB-INF/dispatcher-servlet.xml @@ -1,38 +1,38 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/demos/gae-tweetstore-spring/src/main/webapp/WEB-INF/queue.xml b/demos/tweetstore/gae-tweetstore-spring/src/main/webapp/WEB-INF/queue.xml similarity index 100% rename from demos/gae-tweetstore-spring/src/main/webapp/WEB-INF/queue.xml rename to demos/tweetstore/gae-tweetstore-spring/src/main/webapp/WEB-INF/queue.xml diff --git a/demos/gae-tweetstore-spring/src/main/webapp/WEB-INF/web.xml b/demos/tweetstore/gae-tweetstore-spring/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from demos/gae-tweetstore-spring/src/main/webapp/WEB-INF/web.xml rename to demos/tweetstore/gae-tweetstore-spring/src/main/webapp/WEB-INF/web.xml diff --git a/demos/gae-tweetstore-spring/src/main/webapp/index.jsp b/demos/tweetstore/gae-tweetstore-spring/src/main/webapp/index.jsp similarity index 100% rename from demos/gae-tweetstore-spring/src/main/webapp/index.jsp rename to demos/tweetstore/gae-tweetstore-spring/src/main/webapp/index.jsp diff --git a/demos/gae-tweetstore-spring/src/main/webapp/tweets.jsp b/demos/tweetstore/gae-tweetstore-spring/src/main/webapp/tweets.jsp similarity index 100% rename from demos/gae-tweetstore-spring/src/main/webapp/tweets.jsp rename to demos/tweetstore/gae-tweetstore-spring/src/main/webapp/tweets.jsp diff --git a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java similarity index 100% rename from demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java rename to demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java diff --git a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java similarity index 100% rename from demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java rename to demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java diff --git a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java similarity index 100% rename from demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java rename to demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java diff --git a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java similarity index 100% rename from demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java rename to demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java diff --git a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java similarity index 100% rename from demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java rename to demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java diff --git a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java similarity index 77% rename from demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java rename to demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index a76f004412..6463f73d13 100644 --- a/demos/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -78,7 +78,7 @@ public class TweetStoreLiveTest { @BeforeTest void clearAndCreateContainers() throws InterruptedException, ExecutionException, TimeoutException, IOException, TwitterException { - container = checkNotNull(System.getProperty(PROPERTY_TWEETSTORE_CONTAINER), PROPERTY_TWEETSTORE_CONTAINER); + container = getRequiredSystemProperty(PROPERTY_TWEETSTORE_CONTAINER); props.setProperty(PROPERTY_TWEETSTORE_CONTAINER, container); props.setProperty(SpringServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, Joiner.on(',').join(blobstores)); @@ -98,10 +98,13 @@ public class TweetStoreLiveTest { contexts.put(provider, factory.createContext(provider, wiring, props)); } - Configuration twitterConf = new ConfigurationBuilder() - .setUser(props.getProperty("twitter.identity")) - .setPassword(props.getProperty("twitter.credential")).build(); - Twitter client = new TwitterFactory(twitterConf).getInstance(); + Configuration conf = new ConfigurationBuilder() + .setOAuthConsumerKey(props.getProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY)) + .setOAuthConsumerSecret(props.getProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET)) + .setOAuthAccessToken(props.getProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN)) + .setOAuthAccessTokenSecret(props.getProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET)) + .build(); + Twitter client = new TwitterFactory(conf).getInstance(); StoreTweetsController controller = new StoreTweetsController(contexts, container, client); ResponseList statuses = client.getMentions(); @@ -135,21 +138,29 @@ public class TweetStoreLiveTest { } } + private static String getRequiredSystemProperty(String key) { + return checkNotNull(System.getProperty(key), key); + } + private void addConfigurationForTwitter(Properties props) { - props.setProperty("twitter.identity", - checkNotNull(System.getProperty("test.twitter.identity"), "test.twitter.identity")); - props.setProperty("twitter.credential", - checkNotNull(System.getProperty("test.twitter.credential"), "test.twitter.credential")); - } + props.setProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET)); + } - private void addCredentialsForBlobStores(Properties props) { - for (String provider : blobstores) { - props.setProperty(provider + ".identity", - checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity")); - props.setProperty(provider + ".credential", - checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider + ".credential")); - } - } + private void addCredentialsForBlobStores(Properties props) { + for (String provider : blobstores) { + props.setProperty(provider + ".identity", + getRequiredSystemProperty("test." + provider + ".identity")); + props.setProperty(provider + ".credential", + getRequiredSystemProperty("test." + provider + ".credential")); + } + } @BeforeTest @Parameters({ "warfile", "devappserver.address", "devappserver.port" }) @@ -208,4 +219,11 @@ public class TweetStoreLiveTest { String string = Strings2.toStringAndClose(i); assert string.indexOf("Tweets in Clouds") >= 0 : string; } + + private static interface TwitterConstants { + static final String PROPERTY_TWITTER_CONSUMER_KEY = "twitter.consumer.identity"; + static final String PROPERTY_TWITTER_CONSUMER_SECRET = "twitter.consumer.credential"; + static final String PROPERTY_TWITTER_ACCESSTOKEN = "twitter.access.identity"; + static final String PROPERTY_TWITTER_ACCESSTOKEN_SECRET = "twitter.access.credential"; + } } diff --git a/demos/gae-tweetstore-spring/src/test/resources/log4j.xml b/demos/tweetstore/gae-tweetstore-spring/src/test/resources/log4j.xml similarity index 100% rename from demos/gae-tweetstore-spring/src/test/resources/log4j.xml rename to demos/tweetstore/gae-tweetstore-spring/src/test/resources/log4j.xml diff --git a/demos/tweetstore/gae-tweetstore/pom.xml b/demos/tweetstore/gae-tweetstore/pom.xml new file mode 100644 index 0000000000..8c1d45baf2 --- /dev/null +++ b/demos/tweetstore/gae-tweetstore/pom.xml @@ -0,0 +1,236 @@ + + + + 4.0.0 + + org.jclouds + jclouds-demos-tweetstore-project + 1.0-SNAPSHOT + + jclouds-demo-gae-tweetstore + war + JClouds TweetStore for Google App Engine + JClouds TweetStore for Google App Engine using Guice for Dependency Injection + + + + jclouds-tweetstore + 1.4.2 + localhost + 8088 + jclouds-tweetstore + + + + + org.jclouds.driver + jclouds-gae + ${project.version} + + + com.google.inject.extensions + guice-servlet + 3.0 + + + + + com.google.appengine + appengine-api-1.0-sdk + ${appengine.sdk.version} + + + com.google.appengine + appengine-tools-sdk + ${appengine.sdk.version} + test + + + + + + + + + + + maven-surefire-plugin + + + integration + integration-test + + test + + + + + appengine.sdk.root + ${appengine.sdk.root} + + + devappserver.address + ${devappserver.address} + + + devappserver.port + ${devappserver.port} + + + warfile + ${project.build.directory}/${project.artifactId} + + + + + + + + + + + + live + + + + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.twitter.consumer.identity + ${test.twitter.gae-tweetstore.consumer.identity} + + + test.twitter.consumer.credential + ${test.twitter.gae-tweetstore.consumer.credential} + + + test.twitter.access.identity + ${test.twitter.gae-tweetstore.access.identity} + + + test.twitter.access.credential + ${test.twitter.gae-tweetstore.access.credential} + + + test.azureblob.identity + ${test.azureblob.identity} + + + test.azureblob.credential + ${test.azureblob.credential} + + + test.cloudfiles-us.identity + ${test.cloudfiles-us.identity} + + + test.cloudfiles-us.credential + ${test.cloudfiles-us.credential} + + + test.aws-s3.identity + ${test.aws-s3.identity} + + + test.aws-s3.credential + ${test.aws-s3.credential} + + + appengine.sdk.root + ${appengine.sdk.root} + + + devappserver.address + ${devappserver.address} + + + devappserver.port + ${devappserver.port} + + + jclouds.tweetstore.blobstores + ${jclouds.tweetstore.blobstores} + + + jclouds.tweetstore.container + ${jclouds.tweetstore.container} + + + warfile + ${project.build.directory}/${project.artifactId} + + + + + + + + + + + diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java rename to demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java rename to demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java similarity index 100% rename from demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java rename to demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java rename to demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java similarity index 100% rename from demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java rename to demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java rename to demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java similarity index 100% rename from demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java rename to demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java diff --git a/demos/gae-tweetstore/src/main/appengine/appengine-web.xml b/demos/tweetstore/gae-tweetstore/src/main/platform/appengine-web.xml old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/appengine/appengine-web.xml rename to demos/tweetstore/gae-tweetstore/src/main/platform/appengine-web.xml diff --git a/demos/gae-tweetstore/src/main/appengine/logging.properties b/demos/tweetstore/gae-tweetstore/src/main/platform/logging.properties similarity index 100% rename from demos/gae-tweetstore/src/main/appengine/logging.properties rename to demos/tweetstore/gae-tweetstore/src/main/platform/logging.properties diff --git a/demos/gae-tweetstore/src/main/webapp/WEB-INF/queue.xml b/demos/tweetstore/gae-tweetstore/src/main/webapp/WEB-INF/queue.xml similarity index 100% rename from demos/gae-tweetstore/src/main/webapp/WEB-INF/queue.xml rename to demos/tweetstore/gae-tweetstore/src/main/webapp/WEB-INF/queue.xml diff --git a/demos/gae-tweetstore/src/main/webapp/WEB-INF/web.xml b/demos/tweetstore/gae-tweetstore/src/main/webapp/WEB-INF/web.xml old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/webapp/WEB-INF/web.xml rename to demos/tweetstore/gae-tweetstore/src/main/webapp/WEB-INF/web.xml diff --git a/demos/gae-tweetstore/src/main/webapp/index.jsp b/demos/tweetstore/gae-tweetstore/src/main/webapp/index.jsp old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/webapp/index.jsp rename to demos/tweetstore/gae-tweetstore/src/main/webapp/index.jsp diff --git a/demos/gae-tweetstore/src/main/webapp/tweets.jsp b/demos/tweetstore/gae-tweetstore/src/main/webapp/tweets.jsp old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/main/webapp/tweets.jsp rename to demos/tweetstore/gae-tweetstore/src/main/webapp/tweets.jsp diff --git a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java similarity index 100% rename from demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java rename to demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java diff --git a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java similarity index 100% rename from demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java rename to demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java diff --git a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java similarity index 100% rename from demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java rename to demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java diff --git a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java similarity index 100% rename from demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java rename to demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java diff --git a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java rename to demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/GoogleDevServer.java diff --git a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java old mode 100755 new mode 100644 similarity index 80% rename from demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java rename to demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index 772d891934..ac96008c49 --- a/demos/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -77,8 +77,7 @@ public class TweetStoreLiveTest { @BeforeTest void clearAndCreateContainers() throws InterruptedException, ExecutionException, TimeoutException, IOException, TwitterException { - container = checkNotNull(System.getProperty(PROPERTY_TWEETSTORE_CONTAINER), - PROPERTY_TWEETSTORE_CONTAINER); + container = getRequiredSystemProperty(PROPERTY_TWEETSTORE_CONTAINER); props.setProperty(PROPERTY_TWEETSTORE_CONTAINER, container); props.setProperty(GuiceServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, Joiner.on(',').join(blobstores)); @@ -99,8 +98,11 @@ public class TweetStoreLiveTest { } Configuration conf = new ConfigurationBuilder() - .setUser(props.getProperty("twitter.identity")) - .setPassword(props.getProperty("twitter.credential")).build(); + .setOAuthConsumerKey(props.getProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY)) + .setOAuthConsumerSecret(props.getProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET)) + .setOAuthAccessToken(props.getProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN)) + .setOAuthAccessTokenSecret(props.getProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET)) + .build(); Twitter client = new TwitterFactory(conf).getInstance(); StoreTweetsController controller = new StoreTweetsController(contexts, container, client); @@ -140,6 +142,30 @@ public class TweetStoreLiveTest { } } + private static String getRequiredSystemProperty(String key) { + return checkNotNull(System.getProperty(key), key); + } + + private void addConfigurationForTwitter(Properties props) { + props.setProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET)); + } + + private void addCredentialsForBlobStores(Properties props) { + for (String provider : blobstores) { + props.setProperty(provider + ".identity", + getRequiredSystemProperty("test." + provider + ".identity")); + props.setProperty(provider + ".credential", + getRequiredSystemProperty("test." + provider + ".credential")); + } + } + @BeforeTest(dependsOnMethods = "clearAndCreateContainers") @Parameters({ "warfile", "devappserver.address", "devappserver.port" }) public void startDevAppServer(final String warfile, final String address, final String port) throws Exception { @@ -148,22 +174,7 @@ public class TweetStoreLiveTest { server = new GoogleDevServer(); server.writePropertiesAndStartServer(address, port, warfile, props); } - - private void addConfigurationForTwitter(Properties props) { - props.setProperty("twitter.identity", checkNotNull(System.getProperty("test.twitter.identity"), "test.twitter.identity")); - props.setProperty("twitter.credential", - checkNotNull(System.getProperty("test.twitter.credential"), "test.twitter.credential")); - } - - private void addCredentialsForBlobStores(Properties props) { - for (String provider : blobstores) { - props.setProperty(provider + ".identity", - checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity")); - props.setProperty(provider + ".credential", - checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider + ".credential")); - } - } - + @Test public void shouldPass() throws InterruptedException, IOException { InputStream i = url.openStream(); @@ -213,4 +224,11 @@ public class TweetStoreLiveTest { String string = Strings2.toStringAndClose(i); assert string.indexOf("Tweets in Clouds") >= 0 : string; } + + private static interface TwitterConstants { + static final String PROPERTY_TWITTER_CONSUMER_KEY = "twitter.consumer.identity"; + static final String PROPERTY_TWITTER_CONSUMER_SECRET = "twitter.consumer.credential"; + static final String PROPERTY_TWITTER_ACCESSTOKEN = "twitter.access.identity"; + static final String PROPERTY_TWITTER_ACCESSTOKEN_SECRET = "twitter.access.credential"; + } } diff --git a/demos/gae-tweetstore/src/test/resources/log4j.xml b/demos/tweetstore/gae-tweetstore/src/test/resources/log4j.xml old mode 100755 new mode 100644 similarity index 100% rename from demos/gae-tweetstore/src/test/resources/log4j.xml rename to demos/tweetstore/gae-tweetstore/src/test/resources/log4j.xml diff --git a/demos/tweetstore/pom.xml b/demos/tweetstore/pom.xml new file mode 100644 index 0000000000..25940bb504 --- /dev/null +++ b/demos/tweetstore/pom.xml @@ -0,0 +1,137 @@ + + + + + + jclouds-demos-project + org.jclouds + 1.0-SNAPSHOT + + 4.0.0 + jclouds-demos-tweetstore-project + pom + jclouds TweetStore demos project + + gae-tweetstore + gae-tweetstore-spring + runatcloud-tweetstore + + + + cloudfiles-us,aws-s3,azureblob + + + + + ${project.groupId} + jclouds-blobstore + ${project.version} + + + org.twitter4j + twitter4j-core + [2.2,) + + + ${project.groupId} + jclouds-blobstore + ${project.version} + test-jar + test + + + org.jclouds.provider + aws-s3 + ${project.version} + runtime + + + org.jclouds.provider + cloudfiles-us + ${project.version} + runtime + + + org.jclouds.provider + azureblob + ${project.version} + runtime + + + displaytag + displaytag + 1.2 + runtime + + + org.slf4j + slf4j-log4j12 + + + + + org.slf4j + slf4j-jdk14 + 1.5.6 + runtime + + + jstl + javax.servlet + 1.1.2 + runtime + + + standard + taglibs + 1.1.2 + runtime + + + javax.servlet + servlet-api + 2.5 + provided + + + + + ${project.artifactId} + + + maven-war-plugin + 2.1.1 + + + WEB-INF/web.xml + + + src/main/platform + WEB-INF + true + + + + + + + diff --git a/demos/runatcloud-tweetstore/pom.xml b/demos/tweetstore/runatcloud-tweetstore/pom.xml similarity index 72% rename from demos/runatcloud-tweetstore/pom.xml rename to demos/tweetstore/runatcloud-tweetstore/pom.xml index 657073af65..5b0b0fce46 100644 --- a/demos/runatcloud-tweetstore/pom.xml +++ b/demos/tweetstore/runatcloud-tweetstore/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.jclouds - jclouds-demos-project + jclouds-demos-tweetstore-project 1.0-SNAPSHOT jclouds-demo-runatcloud-tweetstore @@ -31,91 +31,19 @@ jclouds TweetStore for CloudBees' RUN@cloud using Guice for Dependency Injection - tweetstore - run - localhost - 8088 - cloudfiles-us,aws-s3,azureblob - jclouds-tweetstore-runatcloud + jclouds/tweetstore + run + localhost + 8088 + jclouds-tweetstore-runatcloud - - ${project.groupId} - jclouds-blobstore - ${project.version} - - - org.twitter4j - twitter4j-core - [2.1,) - - - ${project.groupId} - jclouds-blobstore - ${project.version} - test-jar - test - - - org.jclouds.provider - aws-s3 - ${project.version} - runtime - - - org.jclouds.provider - cloudfiles-us - ${project.version} - runtime - - - org.jclouds.provider - azureblob - ${project.version} - runtime - com.google.inject.extensions guice-servlet 3.0 - - displaytag - displaytag - 1.2 - runtime - - - org.slf4j - slf4j-log4j12 - - - - - org.slf4j - slf4j-jdk14 - 1.5.6 - runtime - - - jstl - javax.servlet - 1.1.2 - runtime - - - standard - taglibs - 1.1.2 - runtime - - - javax.servlet - servlet-api - 2.5 - provided - @@ -140,7 +68,6 @@ - ${project.artifactId} maven-surefire-plugin @@ -178,13 +105,19 @@ - - com.cloudbees - bees-maven-plugin - 1.0-SNAPSHOT - + + com.cloudbees + bees-maven-plugin + 1.0-SNAPSHOT + + ${bees.appid} + ${bees.environment} + ${bees.apikey} + ${bees.secret} + + - + @@ -203,12 +136,20 @@ - test.twitter.identity - ${test.twitter.identity} + test.twitter.consumer.identity + ${test.twitter.runatcloud-tweetstore.consumer.identity} - test.twitter.credential - ${test.twitter.credential} + test.twitter.consumer.credential + ${test.twitter.runatcloud-tweetstore.consumer.credential} + + + test.twitter.access.identity + ${test.twitter.runatcloud-tweetstore.access.identity} + + + test.twitter.access.credential + ${test.twitter.runatcloud-tweetstore.access.credential} test.azureblob.identity diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/GuiceServletConfig.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/HttpRequestTask.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/HttpRequestTask.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/HttpRequestTask.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/HttpRequestTask.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ImmutableHttpCommand.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ImmutableHttpCommand.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ImmutableHttpCommand.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ImmutableHttpCommand.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ObjectFields.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ObjectFields.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ObjectFields.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/ObjectFields.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/TaskQueue.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/TaskQueue.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/TaskQueue.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/config/utils/TaskQueue.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/StoreTweetsController.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/domain/StoredTweetStatus.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatus.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatuses.java diff --git a/demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java similarity index 100% rename from demos/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java rename to demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java diff --git a/demos/runatcloud-tweetstore/src/main/webapp/WEB-INF/cloudbees-web.xml b/demos/tweetstore/runatcloud-tweetstore/src/main/platform/cloudbees-web.xml similarity index 100% rename from demos/runatcloud-tweetstore/src/main/webapp/WEB-INF/cloudbees-web.xml rename to demos/tweetstore/runatcloud-tweetstore/src/main/platform/cloudbees-web.xml diff --git a/demos/runatcloud-tweetstore/src/main/webapp/WEB-INF/web.xml b/demos/tweetstore/runatcloud-tweetstore/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from demos/runatcloud-tweetstore/src/main/webapp/WEB-INF/web.xml rename to demos/tweetstore/runatcloud-tweetstore/src/main/webapp/WEB-INF/web.xml diff --git a/demos/runatcloud-tweetstore/src/main/webapp/index.jsp b/demos/tweetstore/runatcloud-tweetstore/src/main/webapp/index.jsp similarity index 100% rename from demos/runatcloud-tweetstore/src/main/webapp/index.jsp rename to demos/tweetstore/runatcloud-tweetstore/src/main/webapp/index.jsp diff --git a/demos/runatcloud-tweetstore/src/main/webapp/tweets.jsp b/demos/tweetstore/runatcloud-tweetstore/src/main/webapp/tweets.jsp similarity index 100% rename from demos/runatcloud-tweetstore/src/main/webapp/tweets.jsp rename to demos/tweetstore/runatcloud-tweetstore/src/main/webapp/tweets.jsp diff --git a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java similarity index 100% rename from demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java rename to demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/AddTweetsControllerTest.java diff --git a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java similarity index 100% rename from demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java rename to demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/controller/StoreTweetsControllerTest.java diff --git a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java similarity index 100% rename from demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java rename to demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/KeyToStoredTweetStatusTest.java diff --git a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java similarity index 100% rename from demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java rename to demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/functions/ServiceToStoredTweetStatusesTest.java diff --git a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/RunAtCloudServer.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/RunAtCloudServer.java similarity index 100% rename from demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/RunAtCloudServer.java rename to demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/RunAtCloudServer.java diff --git a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/StaxSdkAppServer2.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/StaxSdkAppServer2.java similarity index 100% rename from demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/StaxSdkAppServer2.java rename to demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/StaxSdkAppServer2.java diff --git a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java similarity index 79% rename from demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java rename to demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index 7ab92ebce2..d3830df2a2 100644 --- a/demos/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -78,7 +78,7 @@ public class TweetStoreLiveTest { @BeforeTest void clearAndCreateContainers() throws InterruptedException, ExecutionException, TimeoutException, IOException, TwitterException { - container = checkNotNull(System.getProperty(PROPERTY_TWEETSTORE_CONTAINER), PROPERTY_TWEETSTORE_CONTAINER); + container = getRequiredSystemProperty(PROPERTY_TWEETSTORE_CONTAINER); props.setProperty(PROPERTY_TWEETSTORE_CONTAINER, container); props.setProperty(GuiceServletConfig.PROPERTY_BLOBSTORE_CONTEXTS, Joiner.on(',').join(blobstores)); @@ -99,8 +99,11 @@ public class TweetStoreLiveTest { } Configuration conf = new ConfigurationBuilder() - .setUser(props.getProperty("twitter.identity")) - .setPassword(props.getProperty("twitter.credential")).build(); + .setOAuthConsumerKey(props.getProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY)) + .setOAuthConsumerSecret(props.getProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET)) + .setOAuthAccessToken(props.getProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN)) + .setOAuthAccessTokenSecret(props.getProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET)) + .build(); Twitter client = new TwitterFactory(conf).getInstance(); StoreTweetsController controller = new StoreTweetsController(contexts, container, client); @@ -140,6 +143,30 @@ public class TweetStoreLiveTest { } } + private static String getRequiredSystemProperty(String key) { + return checkNotNull(System.getProperty(key), key); + } + + private void addConfigurationForTwitter(Properties props) { + props.setProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_CONSUMER_KEY)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_CONSUMER_SECRET)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN)); + props.setProperty(TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET, + getRequiredSystemProperty("test." + TwitterConstants.PROPERTY_TWITTER_ACCESSTOKEN_SECRET)); + } + + private void addCredentialsForBlobStores(Properties props) { + for (String provider : blobstores) { + props.setProperty(provider + ".identity", + getRequiredSystemProperty("test." + provider + ".identity")); + props.setProperty(provider + ".credential", + getRequiredSystemProperty("test." + provider + ".credential")); + } + } + @BeforeTest(dependsOnMethods = "clearAndCreateContainers") @Parameters({ "warfile", "bees.address", "bees.port", "bees.environment", "bees.basedir" }) public void startDevAppServer(final String warfile, final String address, final String port, @@ -151,21 +178,6 @@ public class TweetStoreLiveTest { serverBaseDirectory, props); } - private void addConfigurationForTwitter(Properties props) { - props.setProperty("twitter.identity", checkNotNull(System.getProperty("test.twitter.identity"), "test.twitter.identity")); - props.setProperty("twitter.credential", - checkNotNull(System.getProperty("test.twitter.credential"), "test.twitter.credential")); - } - - private void addCredentialsForBlobStores(Properties props) { - for (String provider : blobstores) { - props.setProperty(provider + ".identity", - checkNotNull(System.getProperty("test." + provider + ".identity"), "test." + provider + ".identity")); - props.setProperty(provider + ".credential", - checkNotNull(System.getProperty("test." + provider + ".credential"), "test." + provider + ".credential")); - } - } - @Test public void shouldPass() throws InterruptedException, IOException { InputStream i = url.openStream(); @@ -215,4 +227,11 @@ public class TweetStoreLiveTest { String string = Strings2.toStringAndClose(i); assert string.indexOf("Tweets in Clouds") >= 0 : string; } + + private static interface TwitterConstants { + static final String PROPERTY_TWITTER_CONSUMER_KEY = "twitter.consumer.identity"; + static final String PROPERTY_TWITTER_CONSUMER_SECRET = "twitter.consumer.credential"; + static final String PROPERTY_TWITTER_ACCESSTOKEN = "twitter.access.identity"; + static final String PROPERTY_TWITTER_ACCESSTOKEN_SECRET = "twitter.access.credential"; + } } diff --git a/demos/runatcloud-tweetstore/src/test/resources/log4j.xml b/demos/tweetstore/runatcloud-tweetstore/src/test/resources/log4j.xml similarity index 100% rename from demos/runatcloud-tweetstore/src/test/resources/log4j.xml rename to demos/tweetstore/runatcloud-tweetstore/src/test/resources/log4j.xml From 57e1bcd2098a7ef8030a79bb79eb1c330e98605a Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 1 Jun 2011 21:35:03 +0200 Subject: [PATCH 12/40] Added the new TweetStore aggregator project to demos --- demos/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/pom.xml b/demos/pom.xml index d1b0d379ec..2051a2c1dc 100644 --- a/demos/pom.xml +++ b/demos/pom.xml @@ -38,6 +38,7 @@ speedtest-azurequeue speedtest-sqs simpledb + tweetstore From d2c269626a9d57158fcca893bb48baa88f46cc32 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 1 Jun 2011 21:38:12 +0200 Subject: [PATCH 13/40] Removed unused deps --- demos/tweetstore/gae-tweetstore/pom.xml | 40 ------------------------- 1 file changed, 40 deletions(-) diff --git a/demos/tweetstore/gae-tweetstore/pom.xml b/demos/tweetstore/gae-tweetstore/pom.xml index 8c1d45baf2..bd621e8377 100644 --- a/demos/tweetstore/gae-tweetstore/pom.xml +++ b/demos/tweetstore/gae-tweetstore/pom.xml @@ -66,46 +66,6 @@ ${appengine.sdk.version} test - - - - - From 98ff7b16feed9b30f996eb1935d1f19b041076a3 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 1 Jun 2011 21:54:47 +0200 Subject: [PATCH 14/40] 'appid' value in cloudbees-web.xml value is sufficient, no need for it in the bees plugin configt need the bees.appid value in the plugin config as it's already set --- demos/tweetstore/runatcloud-tweetstore/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/demos/tweetstore/runatcloud-tweetstore/pom.xml b/demos/tweetstore/runatcloud-tweetstore/pom.xml index 5b0b0fce46..b7f66e4abe 100644 --- a/demos/tweetstore/runatcloud-tweetstore/pom.xml +++ b/demos/tweetstore/runatcloud-tweetstore/pom.xml @@ -110,7 +110,6 @@ bees-maven-plugin 1.0-SNAPSHOT - ${bees.appid} ${bees.environment} ${bees.apikey} ${bees.secret} From 3fea56253eff3d74abec0dd38083c249b1def6ba Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 13:03:04 -0700 Subject: [PATCH 15/40] Issue 574: don't make build dependent on tz --- .../org/jclouds/date/DateServiceTest.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/core/src/test/java/org/jclouds/date/DateServiceTest.java b/core/src/test/java/org/jclouds/date/DateServiceTest.java index f93eb01c18..720832c949 100755 --- a/core/src/test/java/org/jclouds/date/DateServiceTest.java +++ b/core/src/test/java/org/jclouds/date/DateServiceTest.java @@ -68,7 +68,7 @@ public class DateServiceTest extends PerformanceTest { public final Date date; TestData(String iso8601, String iso8601DateStringTz, String iso8601Seconds, String rfc822, String cDateString, - Date dateTime) { + Date dateTime) { this.iso8601DateString = iso8601; this.iso8601DateStringTz = iso8601DateStringTz; this.iso8601SecondsDateString = iso8601Seconds; @@ -79,20 +79,21 @@ public class DateServiceTest extends PerformanceTest { } public DateServiceTest() { - // Constant time test values, each TestData item must contain matching times! + // Constant time test values, each TestData item must contain matching + // times! testData = new TestData[] { - new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07-04:00", "2009-03-12T02:00:07Z", - "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), - new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07+04:00", "2009-03-12T02:00:07Z", - "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), - new TestData("2009-03-14T04:00:07.000Z", "2009-03-14T04:00:07Z+04:00", "2009-03-14T04:00:07Z", - "Sat, 14 Mar 2009 04:00:07 GMT", "Thu Mar 14 04:00:07 +0000 2009", new Date(1237003207000l)), - new TestData("2009-03-16T06:00:07.000Z", "2009-03-16T06:00:07Z+04:00", "2009-03-16T06:00:07Z", - "Mon, 16 Mar 2009 06:00:07 GMT", "Thu Mar 16 06:00:07 +0000 2009", new Date(1237183207000l)), - new TestData("2009-03-18T08:00:07.000Z", "2009-03-18T08:00:07Z+04:00", "2009-03-18T08:00:07Z", - "Wed, 18 Mar 2009 08:00:07 GMT", "Thu Mar 18 08:00:07 +0000 2009", new Date(1237363207000l)), - new TestData("2009-03-20T10:00:07.000Z", "2009-03-20T10:00:07Z+04:00", "2009-03-20T10:00:07Z", - "Fri, 20 Mar 2009 10:00:07 GMT", "Thu Mar 20 10:00:07 +0000 2009", new Date(1237543207000l)) }; + new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07-04:00", "2009-03-12T02:00:07Z", + "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), + new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T02:00:07+04:00", "2009-03-12T02:00:07Z", + "Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)), + new TestData("2009-03-14T04:00:07.000Z", "2009-03-14T04:00:07Z+04:00", "2009-03-14T04:00:07Z", + "Sat, 14 Mar 2009 04:00:07 GMT", "Thu Mar 14 04:00:07 +0000 2009", new Date(1237003207000l)), + new TestData("2009-03-16T06:00:07.000Z", "2009-03-16T06:00:07Z+04:00", "2009-03-16T06:00:07Z", + "Mon, 16 Mar 2009 06:00:07 GMT", "Thu Mar 16 06:00:07 +0000 2009", new Date(1237183207000l)), + new TestData("2009-03-18T08:00:07.000Z", "2009-03-18T08:00:07Z+04:00", "2009-03-18T08:00:07Z", + "Wed, 18 Mar 2009 08:00:07 GMT", "Thu Mar 18 08:00:07 +0000 2009", new Date(1237363207000l)), + new TestData("2009-03-20T10:00:07.000Z", "2009-03-20T10:00:07Z+04:00", "2009-03-20T10:00:07Z", + "Fri, 20 Mar 2009 10:00:07 GMT", "Thu Mar 20 10:00:07 +0000 2009", new Date(1237543207000l)) }; } @Test @@ -164,10 +165,8 @@ public class DateServiceTest extends PerformanceTest { @Test void testTzWithExtraZ() throws ExecutionException, InterruptedException { - assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T06:14:13-04:00").toString(), - "Wed May 25 23:14:13 PDT 2011"); - assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T06:14:13-04:00Z").toString(), - "Wed May 25 23:14:13 PDT 2011"); + assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T06:14:13-04:00").getTime(), 1306390453000l); + assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T06:14:13-04:00Z").getTime(), 1306390453000l); } @Test From 1858f77451141ed307dd282c64ed334247f1f604 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 16:18:24 -0700 Subject: [PATCH 16/40] fixed regressions on ec2 --- .../ec2/compute/EC2ComputeServiceLiveTest.java | 14 ++++++++------ .../ec2/options/RequestSpotInstancesOptions.java | 4 ++-- .../ec2/compute/AWSEC2ComputeServiceLiveTest.java | 2 +- .../options/RequestSpotInstancesOptionsTest.java | 8 ++++---- .../ec2/services/SpotInstanceAsyncClientTest.java | 2 +- .../ec2/services/SpotInstanceClientLiveTest.java | 10 ++++++---- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2ComputeServiceLiveTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2ComputeServiceLiveTest.java index e26a487b67..3c2d3819ab 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2ComputeServiceLiveTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2ComputeServiceLiveTest.java @@ -26,6 +26,7 @@ import java.util.Set; import org.jclouds.compute.BaseComputeServiceLiveTest; import org.jclouds.compute.domain.NodeMetadata; +import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.Template; import org.jclouds.compute.options.TemplateOptions; import org.jclouds.compute.predicates.NodePredicates; @@ -159,12 +160,16 @@ public class EC2ComputeServiceLiveTest extends BaseComputeServiceLiveTest { String group = this.group + "e"; int volumeSize = 8; + + final Template template = context.getComputeService().templateBuilder().hardwareId(InstanceType.M1_SMALL) + .osFamily(OsFamily.UBUNTU).osVersionMatches("10.04").imageDescriptionMatches(".*ebs.*").build(); Location zone = Iterables.find(context.getComputeService().listAssignableLocations(), new Predicate() { @Override public boolean apply(Location arg0) { - return arg0.getScope() == LocationScope.ZONE; + return arg0.getScope() == LocationScope.ZONE + && arg0.getParent().getId().equals(template.getLocation().getId()); } }); @@ -174,9 +179,6 @@ public class EC2ComputeServiceLiveTest extends BaseComputeServiceLiveTest { Snapshot snapshot = ebsClient.createSnapshotInRegion(volume.getRegion(), volume.getId()); ebsClient.deleteVolumeInRegion(volume.getRegion(), volume.getId()); - Template template = context.getComputeService().templateBuilder().locationId(volume.getRegion()).hardwareId( - InstanceType.M1_SMALL).imageDescriptionMatches(".*ebs.*").build(); - template.getOptions().as(EC2TemplateOptions.class)// // .unmapDeviceNamed("/dev/foo) .mapEphemeralDeviceToDeviceName("/dev/sdm", "ephemeral0")// @@ -223,8 +225,8 @@ public class EC2ComputeServiceLiveTest extends BaseComputeServiceLiveTest { return instance; } - protected void cleanupExtendedStuff(SecurityGroupClient securityGroupClient, KeyPairClient keyPairClient, String group) - throws InterruptedException { + protected void cleanupExtendedStuff(SecurityGroupClient securityGroupClient, KeyPairClient keyPairClient, + String group) throws InterruptedException { try { for (SecurityGroup secgroup : securityGroupClient.describeSecurityGroupsInRegion(null)) if (secgroup.getName().startsWith("jclouds#" + group) || secgroup.getName().equals(group)) { diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptions.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptions.java index 5ef9dc6e4f..1e9864e0b4 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptions.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptions.java @@ -56,7 +56,7 @@ public class RequestSpotInstancesOptions extends BaseEC2RequestOptions { * time and remains active until it expires or is canceled. */ public RequestSpotInstancesOptions validFrom(Date start) { - formParameters.put("ValidFrom", service.iso8601DateFormat(checkNotNull(start, "start"))); + formParameters.put("ValidFrom", service.iso8601SecondsDateFormat(checkNotNull(start, "start"))); return this; } @@ -66,7 +66,7 @@ public class RequestSpotInstancesOptions extends BaseEC2RequestOptions { * persistent, it remains active until it is canceled or this date and time is reached. */ public RequestSpotInstancesOptions validUntil(Date end) { - formParameters.put("ValidUntil", service.iso8601DateFormat(checkNotNull(end, "end"))); + formParameters.put("ValidUntil", service.iso8601SecondsDateFormat(checkNotNull(end, "end"))); return this; } diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java index 26c7c4891b..feccab95e5 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java @@ -46,7 +46,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ -@Test(groups = "live", sequential = true, testName = "AWSEC2ComputeServiceLiveTest") +@Test(groups = "live", singleThreaded = true, testName = "AWSEC2ComputeServiceLiveTest") public class AWSEC2ComputeServiceLiveTest extends EC2ComputeServiceLiveTest { public AWSEC2ComputeServiceLiveTest() { diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptionsTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptionsTest.java index 18df559718..14d18b6024 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptionsTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/options/RequestSpotInstancesOptionsTest.java @@ -104,7 +104,7 @@ public class RequestSpotInstancesOptionsTest { RequestSpotInstancesOptions options = new RequestSpotInstancesOptions(); options.validFrom(test); assertEquals(options.buildFormParameters().get("ValidFrom"), - Collections.singletonList("1970-05-23T21:21:18.910Z")); + Collections.singletonList("1970-05-23T21:21:18Z")); } Date test = new Date(12345678910l); @@ -113,7 +113,7 @@ public class RequestSpotInstancesOptionsTest { public void testFromStatic() { RequestSpotInstancesOptions options = validFrom(test); assertEquals(options.buildFormParameters().get("ValidFrom"), - Collections.singletonList("1970-05-23T21:21:18.910Z")); + Collections.singletonList("1970-05-23T21:21:18Z")); } @Test(expectedExceptions = NullPointerException.class) @@ -126,14 +126,14 @@ public class RequestSpotInstancesOptionsTest { RequestSpotInstancesOptions options = new RequestSpotInstancesOptions(); options.validUntil(test); assertEquals(options.buildFormParameters().get("ValidUntil"), - Collections.singletonList("1970-05-23T21:21:18.910Z")); + Collections.singletonList("1970-05-23T21:21:18Z")); } @Test public void testToStatic() { RequestSpotInstancesOptions options = validUntil(test); assertEquals(options.buildFormParameters().get("ValidUntil"), - Collections.singletonList("1970-05-23T21:21:18.910Z")); + Collections.singletonList("1970-05-23T21:21:18Z")); } @Test(expectedExceptions = NullPointerException.class) diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceAsyncClientTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceAsyncClientTest.java index bed776701b..8ec1e62822 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceAsyncClientTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/SpotInstanceAsyncClientTest.java @@ -77,7 +77,7 @@ public class SpotInstanceAsyncClientTest extends BaseAWSEC2AsyncClientTest Date: Thu, 2 Jun 2011 02:13:57 +0200 Subject: [PATCH 17/40] Extracted a PROPERTY_TWEETSTORE_BLOBSTORES constant --- .../tweetstore/reference/TweetStoreConstants.java | 13 +++++++------ .../tweetstore/integration/TweetStoreLiveTest.java | 3 ++- .../tweetstore/reference/TweetStoreConstants.java | 5 +++-- .../tweetstore/integration/TweetStoreLiveTest.java | 3 ++- .../tweetstore/reference/TweetStoreConstants.java | 13 +++++++------ .../tweetstore/integration/TweetStoreLiveTest.java | 3 ++- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java index 4e75d5a7fa..8cdceeb27d 100644 --- a/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java +++ b/demos/tweetstore/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java @@ -24,10 +24,11 @@ package org.jclouds.demo.tweetstore.reference; * @author Adrian Cole */ public interface TweetStoreConstants { - public static final String PROPERTY_TWEETSTORE_CONTAINER = "jclouds.tweetstore.container"; - /** - * Note that this has to conform to restrictions of all blobstores. for example, azure doesn't - * support periods. - */ - public static final String SENDER_NAME = "sendername"; + static final String PROPERTY_TWEETSTORE_BLOBSTORES = "jclouds.tweetstore.blobstores"; + static final String PROPERTY_TWEETSTORE_CONTAINER = "jclouds.tweetstore.container"; + /** + * Note that this has to conform to restrictions of all blobstores. for + * example, azure doesn't support periods. + */ + static final String SENDER_NAME = "sendername"; } diff --git a/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index 6463f73d13..3565071db8 100644 --- a/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/tweetstore/gae-tweetstore-spring/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -19,6 +19,7 @@ package org.jclouds.demo.tweetstore.integration; import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_BLOBSTORES; import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER; import java.io.IOException; @@ -71,7 +72,7 @@ public class TweetStoreLiveTest { private String container; private static final Iterable blobstores = - Splitter.on(',').split(System.getProperty("jclouds.tweetstore.blobstores", + Splitter.on(',').split(System.getProperty(PROPERTY_TWEETSTORE_BLOBSTORES, "cloudfiles-us,aws-s3,azureblob")); private static final Properties props = new Properties(); diff --git a/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java index 4e75d5a7fa..4d2eb6b410 100644 --- a/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java +++ b/demos/tweetstore/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java @@ -24,10 +24,11 @@ package org.jclouds.demo.tweetstore.reference; * @author Adrian Cole */ public interface TweetStoreConstants { - public static final String PROPERTY_TWEETSTORE_CONTAINER = "jclouds.tweetstore.container"; + static final String PROPERTY_TWEETSTORE_BLOBSTORES = "jclouds.tweetstore.blobstores"; + static final String PROPERTY_TWEETSTORE_CONTAINER = "jclouds.tweetstore.container"; /** * Note that this has to conform to restrictions of all blobstores. for example, azure doesn't * support periods. */ - public static final String SENDER_NAME = "sendername"; + static final String SENDER_NAME = "sendername"; } diff --git a/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index ac96008c49..a2d982a7ae 100644 --- a/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/tweetstore/gae-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -19,6 +19,7 @@ package org.jclouds.demo.tweetstore.integration; import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_BLOBSTORES; import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER; import java.io.IOException; @@ -70,7 +71,7 @@ public class TweetStoreLiveTest { private Map contexts; private String container; private static final Iterable blobstores = - Splitter.on(',').split(System.getProperty("jclouds.tweetstore.blobstores", + Splitter.on(',').split(System.getProperty(PROPERTY_TWEETSTORE_BLOBSTORES, "cloudfiles-us,aws-s3,azureblob")); private static final Properties props = new Properties(); diff --git a/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java index 4e75d5a7fa..8cdceeb27d 100644 --- a/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java +++ b/demos/tweetstore/runatcloud-tweetstore/src/main/java/org/jclouds/demo/tweetstore/reference/TweetStoreConstants.java @@ -24,10 +24,11 @@ package org.jclouds.demo.tweetstore.reference; * @author Adrian Cole */ public interface TweetStoreConstants { - public static final String PROPERTY_TWEETSTORE_CONTAINER = "jclouds.tweetstore.container"; - /** - * Note that this has to conform to restrictions of all blobstores. for example, azure doesn't - * support periods. - */ - public static final String SENDER_NAME = "sendername"; + static final String PROPERTY_TWEETSTORE_BLOBSTORES = "jclouds.tweetstore.blobstores"; + static final String PROPERTY_TWEETSTORE_CONTAINER = "jclouds.tweetstore.container"; + /** + * Note that this has to conform to restrictions of all blobstores. for + * example, azure doesn't support periods. + */ + static final String SENDER_NAME = "sendername"; } diff --git a/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java index d3830df2a2..f0a837be91 100644 --- a/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java +++ b/demos/tweetstore/runatcloud-tweetstore/src/test/java/org/jclouds/demo/tweetstore/integration/TweetStoreLiveTest.java @@ -19,6 +19,7 @@ package org.jclouds.demo.tweetstore.integration; import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_BLOBSTORES; import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER; import java.io.IOException; @@ -71,7 +72,7 @@ public class TweetStoreLiveTest { private Map contexts; private String container; private static final Iterable blobstores = - Splitter.on(',').split(System.getProperty("jclouds.tweetstore.blobstores", + Splitter.on(',').split(System.getProperty(PROPERTY_TWEETSTORE_BLOBSTORES, "cloudfiles-us,aws-s3,azureblob")); private static final Properties props = new Properties(); From a089151981e3b3d70c618608d0513e0e597a3348 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Thu, 2 Jun 2011 02:15:05 +0200 Subject: [PATCH 18/40] Added a 'deploy' profile that fetches and includes a private jclouds.properties file, and now copying META-INF resources into /META-INF rather than /WEB-INF/META-INF --- demos/tweetstore/pom.xml | 70 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/demos/tweetstore/pom.xml b/demos/tweetstore/pom.xml index 25940bb504..404c2441a6 100644 --- a/demos/tweetstore/pom.xml +++ b/demos/tweetstore/pom.xml @@ -37,6 +37,7 @@ + target/maven-shared-archive-resources cloudfiles-us,aws-s3,azureblob @@ -117,6 +118,14 @@ ${project.artifactId} + + maven-remote-resources-plugin + 1.2 + + + false + + maven-war-plugin 2.1.1 @@ -129,9 +138,70 @@ WEB-INF true + + ${remoteResourcesDirectory}/META-INF + META-INF + + + + + deploy + + + + maven-remote-resources-plugin + 1.2 + + + false + + + + include-jclouds-properties + + process + + + + org.jclouds:jclouds-properties:${project.version} + + + + + + + maven-war-plugin + + + WEB-INF/web.xml + + + src/main/platform + WEB-INF + true + + + ${remoteResourcesDirectory}/META-INF + META-INF + + + ${remoteResourcesDirectory} + WEB-INF + true + + jclouds.properties + + + + + + + + + From b1fb4f686a7229e0fc84037d487b82d91fad8b4a Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Thu, 2 Jun 2011 02:17:25 +0200 Subject: [PATCH 19/40] Added 'deploy' profiles for each TweetStore instance --- .../tweetstore/gae-tweetstore-spring/pom.xml | 17 ++++++ demos/tweetstore/gae-tweetstore/pom.xml | 17 ++++++ .../tweetstore/runatcloud-tweetstore/pom.xml | 53 +++++++++++-------- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/demos/tweetstore/gae-tweetstore-spring/pom.xml b/demos/tweetstore/gae-tweetstore-spring/pom.xml index 5f4e9deb31..229e937bcc 100644 --- a/demos/tweetstore/gae-tweetstore-spring/pom.xml +++ b/demos/tweetstore/gae-tweetstore-spring/pom.xml @@ -206,5 +206,22 @@ + + + deploy + + + + net.kindleit + maven-gae-plugin + 0.8.4 + + google-appengine + ${appengine.sdk.root} + + + + + diff --git a/demos/tweetstore/gae-tweetstore/pom.xml b/demos/tweetstore/gae-tweetstore/pom.xml index bd621e8377..77042cfd5a 100644 --- a/demos/tweetstore/gae-tweetstore/pom.xml +++ b/demos/tweetstore/gae-tweetstore/pom.xml @@ -192,5 +192,22 @@ + + + deploy + + + + net.kindleit + maven-gae-plugin + 0.8.4 + + google-appengine + ${appengine.sdk.root} + + + + + diff --git a/demos/tweetstore/runatcloud-tweetstore/pom.xml b/demos/tweetstore/runatcloud-tweetstore/pom.xml index b7f66e4abe..913462f58e 100644 --- a/demos/tweetstore/runatcloud-tweetstore/pom.xml +++ b/demos/tweetstore/runatcloud-tweetstore/pom.xml @@ -54,19 +54,6 @@ - - - bees-plugins-snapshots - http://repository-cloudbees.forge.cloudbees.com/public-snapshot/ - - false - - - true - - - - @@ -105,16 +92,6 @@ - - com.cloudbees - bees-maven-plugin - 1.0-SNAPSHOT - - ${bees.environment} - ${bees.apikey} - ${bees.secret} - - @@ -210,5 +187,35 @@ + + + deploy + + + bees-plugins-snapshots + http://repository-cloudbees.forge.cloudbees.com/public-snapshot + + false + + + true + + + + + + + com.cloudbees + bees-maven-plugin + 1.0-SNAPSHOT + + ${bees.environment} + ${bees.apikey} + ${bees.secret} + + + + + From 7e00e064c0beb0347fddb3dcf5bd89c6348c7147 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 18:34:29 -0700 Subject: [PATCH 20/40] Issue 429: switched swift to Storage-User and Storage-Pass auth --- .../swift/config/SwiftRestClientModule.java | 34 ++++++++++++ .../openstack/OpenStackAuthAsyncClient.java | 6 +++ .../config/OpenStackAuthenticationModule.java | 52 +++++++++++++------ .../openstack/reference/AuthHeaders.java | 2 + .../OpenStackAuthAsyncClientTest.java | 14 +++++ 5 files changed, 92 insertions(+), 16 deletions(-) diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/config/SwiftRestClientModule.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/config/SwiftRestClientModule.java index 6d01a46e4f..b855e817ed 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/config/SwiftRestClientModule.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/config/SwiftRestClientModule.java @@ -18,13 +18,23 @@ */ package org.jclouds.openstack.swift.config; +import java.net.URI; +import java.util.concurrent.Future; + +import javax.inject.Inject; +import javax.inject.Named; import javax.inject.Singleton; +import org.jclouds.Constants; import org.jclouds.http.RequiresHttp; +import org.jclouds.openstack.OpenStackAuthAsyncClient.AuthenticationResponse; +import org.jclouds.openstack.config.OpenStackAuthenticationModule.GetAuthenticationResponse; +import org.jclouds.openstack.reference.AuthHeaders; import org.jclouds.openstack.swift.CommonSwiftAsyncClient; import org.jclouds.openstack.swift.CommonSwiftClient; import org.jclouds.openstack.swift.SwiftAsyncClient; import org.jclouds.openstack.swift.SwiftClient; +import org.jclouds.rest.AsyncClientFactory; import org.jclouds.rest.ConfiguresRestClient; import com.google.inject.Provides; @@ -52,4 +62,28 @@ public class SwiftRestClientModule extends BaseSwiftRestClientModule authenticate() { + return client.authenticateStorage(user, key); + } + + } + + protected URI provideStorageUrl(AuthenticationResponse response) { + return response.getServices().get(AuthHeaders.STORAGE_URL); + } + + @Override + protected void configure() { + bind(GetAuthenticationResponse.class).to(GetAuthenticationResponseForStorage.class); + super.configure(); + } } diff --git a/common/openstack/src/main/java/org/jclouds/openstack/OpenStackAuthAsyncClient.java b/common/openstack/src/main/java/org/jclouds/openstack/OpenStackAuthAsyncClient.java index 5e92e86369..c712e36e0f 100755 --- a/common/openstack/src/main/java/org/jclouds/openstack/OpenStackAuthAsyncClient.java +++ b/common/openstack/src/main/java/org/jclouds/openstack/OpenStackAuthAsyncClient.java @@ -93,4 +93,10 @@ public interface OpenStackAuthAsyncClient { @ResponseParser(ParseAuthenticationResponseFromHeaders.class) ListenableFuture authenticate(@HeaderParam(AuthHeaders.AUTH_USER) String user, @HeaderParam(AuthHeaders.AUTH_KEY) String key); + + + @GET + @ResponseParser(ParseAuthenticationResponseFromHeaders.class) + ListenableFuture authenticateStorage(@HeaderParam(AuthHeaders.STORAGE_USER) String user, + @HeaderParam(AuthHeaders.STORAGE_PASS) String key); } diff --git a/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java b/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java index c0dc3621e7..135afcec83 100755 --- a/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java +++ b/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java @@ -24,6 +24,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; @@ -69,25 +70,44 @@ public class OpenStackAuthenticationModule extends AbstractModule { }; } + @Singleton + public static class GetAuthenticationResponse implements Supplier { + protected final OpenStackAuthAsyncClient client; + protected final String user; + protected final String key; + + @Inject + public GetAuthenticationResponse(AsyncClientFactory factory, @Named(Constants.PROPERTY_IDENTITY) String user, + @Named(Constants.PROPERTY_CREDENTIAL) String key) { + this.client = factory.create(OpenStackAuthAsyncClient.class); + this.user = user; + this.key = key; + } + + @Override + public AuthenticationResponse get() { + try { + Future response = authenticate(); + return response.get(30, TimeUnit.SECONDS); + } catch (Exception e) { + Throwables.propagate(e); + assert false : e; + return null; + } + } + + protected Future authenticate() { + return client.authenticate(user, key); + } + + } + @Provides @Singleton - Supplier provideAuthenticationResponseCache(final AsyncClientFactory factory, - @Named(Constants.PROPERTY_IDENTITY) final String user, - @Named(Constants.PROPERTY_CREDENTIAL) final String key) { + Supplier provideAuthenticationResponseCache( + final GetAuthenticationResponse getAuthenticationResponse) { return Suppliers.memoizeWithExpiration(new RetryOnTimeOutExceptionSupplier( - new Supplier() { - public AuthenticationResponse get() { - try { - Future response = factory.create(OpenStackAuthAsyncClient.class) - .authenticate(user, key); - return response.get(30, TimeUnit.SECONDS); - } catch (Exception e) { - Throwables.propagate(e); - assert false : e; - return null; - } - } - }), 23, TimeUnit.HOURS); + getAuthenticationResponse), 23, TimeUnit.HOURS); } @Provides diff --git a/common/openstack/src/main/java/org/jclouds/openstack/reference/AuthHeaders.java b/common/openstack/src/main/java/org/jclouds/openstack/reference/AuthHeaders.java index 722c1d6187..858b2058c0 100644 --- a/common/openstack/src/main/java/org/jclouds/openstack/reference/AuthHeaders.java +++ b/common/openstack/src/main/java/org/jclouds/openstack/reference/AuthHeaders.java @@ -29,6 +29,8 @@ public interface AuthHeaders { public static final String AUTH_USER = "X-Auth-User"; public static final String AUTH_KEY = "X-Auth-Key"; + public static final String STORAGE_USER = "X-Storage-User"; + public static final String STORAGE_PASS = "X-Storage-Pass"; public static final String AUTH_TOKEN = "X-Auth-Token"; public static final String URL_SUFFIX = "-Url"; diff --git a/common/openstack/src/test/java/org/jclouds/openstack/OpenStackAuthAsyncClientTest.java b/common/openstack/src/test/java/org/jclouds/openstack/OpenStackAuthAsyncClientTest.java index 68c5251c7b..f0c5d2390f 100755 --- a/common/openstack/src/test/java/org/jclouds/openstack/OpenStackAuthAsyncClientTest.java +++ b/common/openstack/src/test/java/org/jclouds/openstack/OpenStackAuthAsyncClientTest.java @@ -60,6 +60,20 @@ public class OpenStackAuthAsyncClientTest extends RestClientTest createContextSpec() { return contextSpec("test", "http://localhost:8080", "1.0", "", "identity", "credential", From ccb9709d0556eecd4f65bb152bdb4d1983574bfb Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 20:26:10 -0700 Subject: [PATCH 21/40] Issue 550: metadata for slicehost --- providers/slicehost/pom.xml | 2 + .../slicehost/SlicehostProviderMetadata.java | 116 ++++++++++++++++++ .../org.jclouds.providers.ProviderMetadata | 1 + ...esTest.java => SlicehostProviderTest.java} | 25 ++-- 4 files changed, 126 insertions(+), 18 deletions(-) create mode 100644 providers/slicehost/src/main/java/org/jclouds/slicehost/SlicehostProviderMetadata.java create mode 100644 providers/slicehost/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata rename providers/slicehost/src/test/java/org/jclouds/slicehost/{ProvidersInPropertiesTest.java => SlicehostProviderTest.java} (59%) diff --git a/providers/slicehost/pom.xml b/providers/slicehost/pom.xml index eb2b07edb7..4965c905ad 100644 --- a/providers/slicehost/pom.xml +++ b/providers/slicehost/pom.xml @@ -102,6 +102,8 @@ test + + 1 test.slicehost.endpoint diff --git a/providers/slicehost/src/main/java/org/jclouds/slicehost/SlicehostProviderMetadata.java b/providers/slicehost/src/main/java/org/jclouds/slicehost/SlicehostProviderMetadata.java new file mode 100644 index 0000000000..e83853ca37 --- /dev/null +++ b/providers/slicehost/src/main/java/org/jclouds/slicehost/SlicehostProviderMetadata.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.slicehost; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; +import org.jclouds.providers.ProviderMetadata; + +import com.google.common.collect.ImmutableSet; + +/** + * Implementation of {@link org.jclouds.types.ProviderMetadata} for Slicehost + * + * @author Adrian Cole + */ +public class SlicehostProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "slicehost"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return ProviderMetadata.COMPUTE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "Slicehost"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "API password"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.slicehost.com"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://manage.slicehost.com/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://articles.slicehost.com/api"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getLinkedServices() { + return ImmutableSet.of("slicehost"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US-IL", "US-TX", "US-MO"); + } + +} \ No newline at end of file diff --git a/providers/slicehost/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/slicehost/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..78e0e800bc --- /dev/null +++ b/providers/slicehost/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.slicehost.SlicehostProviderMetadata diff --git a/providers/slicehost/src/test/java/org/jclouds/slicehost/ProvidersInPropertiesTest.java b/providers/slicehost/src/test/java/org/jclouds/slicehost/SlicehostProviderTest.java similarity index 59% rename from providers/slicehost/src/test/java/org/jclouds/slicehost/ProvidersInPropertiesTest.java rename to providers/slicehost/src/test/java/org/jclouds/slicehost/SlicehostProviderTest.java index a308276784..e564fc333f 100644 --- a/providers/slicehost/src/test/java/org/jclouds/slicehost/ProvidersInPropertiesTest.java +++ b/providers/slicehost/src/test/java/org/jclouds/slicehost/SlicehostProviderTest.java @@ -18,29 +18,18 @@ */ package org.jclouds.slicehost; -import org.jclouds.compute.util.ComputeServiceUtils; -import org.jclouds.rest.Providers; +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; import org.testng.annotations.Test; -import com.google.common.collect.Iterables; - /** * * @author Adrian Cole - * */ -@Test(groups = "unit") -public class ProvidersInPropertiesTest { +@Test(groups = "unit", testName = "SlicehostProviderTest") +public class SlicehostProviderTest extends BaseProviderMetadataTest { - @Test - public void testSupportedComputeServiceProviders() { - Iterable providers = ComputeServiceUtils.getSupportedProviders(); - assert Iterables.contains(providers, "slicehost") : providers; + public SlicehostProviderTest() { + super(new SlicehostProviderMetadata(), ProviderMetadata.COMPUTE_TYPE); } - - @Test - public void testSupportedProviders() { - Iterable providers = Providers.getSupportedProviders(); - assert Iterables.contains(providers, "slicehost") : providers; - } -} +} \ No newline at end of file From 86129df416049c3808e647e48353aa34fa1e80e3 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 20:30:30 -0700 Subject: [PATCH 22/40] stabilized bluelock --- .../strategy/VCloudDestroyNodeStrategy.java | 53 +++++++++---------- .../features/VAppTemplateClientLiveTest.java | 21 ++++---- .../vcloud/features/VmClientLiveTest.java | 2 +- .../ParseVCloudErrorFromHttpResponse.java | 5 +- .../ParseVCloudErrorFromHttpResponseTest.java | 26 ++++++--- .../compute/BaseComputeServiceLiveTest.java | 8 +-- .../http/BaseHttpErrorHandlerTest.java | 12 +++-- ...kVCloudDirectorComputeServiceLiveTest.java | 2 +- 8 files changed, 71 insertions(+), 58 deletions(-) diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudDestroyNodeStrategy.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudDestroyNodeStrategy.java index a11e4b0052..119af79829 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudDestroyNodeStrategy.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudDestroyNodeStrategy.java @@ -67,50 +67,47 @@ public class VCloudDestroyNodeStrategy implements DestroyNodeStrategy { VApp vApp = client.getVAppClient().getVApp(vappId); if (vApp == null) return null; - vApp = powerOffVAppIfDeployed(vApp); + + waitForPendingTasksToComplete(vApp); + vApp = undeployVAppIfDeployed(vApp); - deleteVApp(vappId); + deleteVApp(vApp); try { return getNode.getNode(id); } catch (AuthorizationException e) { + // vcloud bug will sometimes throw an exception getting the vapp right after deleting it. logger.trace("authorization error getting %s after deletion: %s", id, e.getMessage()); return null; } } - void deleteVApp(URI vappId) { - logger.debug(">> deleting vApp(%s)", vappId); - Task task = client.getVAppClient().deleteVApp(vappId); + void waitForPendingTasksToComplete(VApp vApp) { + for (Task task : vApp.getTasks()) + waitForTask(task, vApp); + } + + public void waitForTask(Task task, VApp vAppResponse) { if (!successTester.apply(task.getHref())) { - throw new RuntimeException(String.format("failed to %s %s: %s", "delete", vappId, task)); + throw new RuntimeException(String.format("failed to %s %s: %s", task.getName(), vAppResponse.getName(), task)); } - logger.debug("<< deleted vApp(%s)", vappId); + } + + void deleteVApp(VApp vApp) { + logger.debug(">> deleting vApp(%s)", vApp.getHref()); + waitForTask(client.getVAppClient().deleteVApp(vApp.getHref()), vApp); + logger.debug("<< deleted vApp(%s)", vApp.getHref()); } VApp undeployVAppIfDeployed(VApp vApp) { - if (vApp.getStatus().compareTo(Status.RESOLVED) > 0) { + if (vApp.getStatus() != Status.OFF) { logger.debug(">> undeploying vApp(%s), current status: %s", vApp.getName(), vApp.getStatus()); - Task task = client.getVAppClient().undeployVApp(vApp.getHref()); - if (!successTester.apply(task.getHref())) { - // TODO timeout - throw new RuntimeException(String.format("failed to %s %s: %s", "undeploy", vApp.getName(), task)); + try { + waitForTask(client.getVAppClient().undeployVApp(vApp.getHref()), vApp); + vApp = client.getVAppClient().getVApp(vApp.getHref()); + logger.debug("<< %s vApp(%s)", vApp.getStatus(), vApp.getName()); + } catch (IllegalStateException e) { + logger.warn(e, "<< %s vApp(%s)", vApp.getStatus(), vApp.getName()); } - vApp = client.getVAppClient().getVApp(vApp.getHref()); - logger.debug("<< %s vApp(%s)", vApp.getStatus(), vApp.getName()); - } - return vApp; - } - - VApp powerOffVAppIfDeployed(VApp vApp) { - if (vApp.getStatus().compareTo(Status.OFF) > 0) { - logger.debug(">> powering off vApp(%s), current status: %s", vApp.getName(), vApp.getStatus()); - Task task = client.getVAppClient().powerOffVApp(vApp.getHref()); - if (!successTester.apply(task.getHref())) { - // TODO timeout - throw new RuntimeException(String.format("failed to %s %s: %s", "powerOff", vApp.getName(), task)); - } - vApp = client.getVAppClient().getVApp(vApp.getHref()); - logger.debug("<< %s vApp(%s)", vApp.getStatus(), vApp.getName()); } return vApp; } diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateClientLiveTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateClientLiveTest.java index 8ba9754b1b..14f9fed1c9 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateClientLiveTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateClientLiveTest.java @@ -34,7 +34,9 @@ import org.jclouds.vcloud.domain.Catalog; import org.jclouds.vcloud.domain.CatalogItem; import org.jclouds.vcloud.domain.Org; import org.jclouds.vcloud.domain.ReferenceType; +import org.jclouds.vcloud.domain.Status; import org.jclouds.vcloud.domain.Task; +import org.jclouds.vcloud.domain.VApp; import org.jclouds.vcloud.domain.VAppTemplate; import org.jclouds.vcloud.options.CatalogItemOptions; import org.jclouds.vcloud.predicates.TaskSuccess; @@ -125,20 +127,17 @@ public class VAppTemplateClientLiveTest extends BaseVCloudClientLiveTest { Predicate taskTester = new RetryablePredicate(new TaskSuccess(getVCloudApi()), 600, 5, TimeUnit.SECONDS); - // I have to powerOff first - Task task = getVCloudApi().getVAppClient().powerOffVApp(URI.create(node.getId())); - - // wait up to ten minutes per above - assert taskTester.apply(task.getHref()) : node; - - // having a problem where the api is returning an error telling us to stop! - // I have to undeploy first - task = getVCloudApi().getVAppClient().undeployVApp(URI.create(node.getId())); + Task task = getVCloudApi().getVAppClient().undeployVApp(URI.create(node.getId())); // wait up to ten minutes per above assert taskTester.apply(task.getHref()) : node; + VApp vApp = getVCloudApi().getVAppClient().getVApp(URI.create(node.getId())); + + // wait up to ten minutes per above + assertEquals(vApp.getStatus(), Status.OFF); + // vdc is equiv to the node's location // vapp uri is the same as the node's id vappTemplate = getVCloudApi().getVAppTemplateClient().captureVAppAsTemplateInVDC(URI.create(node.getId()), @@ -155,11 +154,11 @@ public class VAppTemplateClientLiveTest extends BaseVCloudClientLiveTest { vappTemplate.getHref(), getVCloudApi().getCatalogClient().findCatalogInOrgNamed(null, null).getHref(), "fooname", CatalogItemOptions.Builder.description("description").properties(ImmutableMap.of("foo", "bar"))); - + assertEquals(item.getName(), "fooname"); assertEquals(item.getDescription(), "description"); assertEquals(item.getProperties(), ImmutableMap.of("foo", "bar")); - assertEquals(item.getEntity().getName(), vappTemplate.getName()); + assertEquals(item.getEntity().getName(), "fooname"); assertEquals(item.getEntity().getHref(), vappTemplate.getHref()); assertEquals(item.getEntity().getType(), vappTemplate.getType()); diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmClientLiveTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmClientLiveTest.java index 9153afab70..4c52b8b9b0 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmClientLiveTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmClientLiveTest.java @@ -161,9 +161,9 @@ public class VmClientLiveTest extends BaseVCloudClientLiveTest { } protected void checkVmOutput(String fooTxtContentsMadeByVMwareTools, String decodedVMwareToolsOutput) { + assertEquals(decodedVMwareToolsOutput, script); // note that vmwaretools throws in \r characters when executing scripts assertEquals(fooTxtContentsMadeByVMwareTools, iLoveAscii + "\r\n"); - assertEquals(decodedVMwareToolsOutput, script); } protected IPSocket getSocket(NodeMetadata node) { diff --git a/common/vcloud/src/main/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponse.java b/common/vcloud/src/main/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponse.java index 59f35a2787..5082bcc342 100644 --- a/common/vcloud/src/main/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponse.java +++ b/common/vcloud/src/main/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponse.java @@ -88,8 +88,9 @@ public class ParseVCloudErrorFromHttpResponse implements HttpErrorHandler { switch (response.getStatusCode()) { case 400: - if (error != null && error.getMinorErrorCode() != null - && error.getMinorErrorCode() == MinorCode.BUSY_ENTITY) + if (error != null + && (error.getMinorErrorCode() != null && error.getMinorErrorCode() == MinorCode.BUSY_ENTITY) + || (error.getMessage() != null && error.getMessage().indexOf("is not running") != -1)) exception = new IllegalStateException(message, exception); else exception = new IllegalArgumentException(message, exception); diff --git a/common/vcloud/src/test/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponseTest.java b/common/vcloud/src/test/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponseTest.java index 210dc7e0c3..2aab97e85a 100644 --- a/common/vcloud/src/test/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponseTest.java +++ b/common/vcloud/src/test/java/org/jclouds/vcloud/handlers/ParseVCloudErrorFromHttpResponseTest.java @@ -25,6 +25,7 @@ import org.jclouds.http.HttpErrorHandler; import org.jclouds.http.HttpResponseException; import org.jclouds.rest.AuthorizationException; import org.jclouds.rest.ResourceNotFoundException; +import org.jclouds.vcloud.VCloudMediaType; import org.testng.annotations.Test; /** @@ -36,23 +37,32 @@ public class ParseVCloudErrorFromHttpResponseTest extends BaseHttpErrorHandlerTe @Test public void testGet404SetsResourceNotFoundException() { - assertCodeMakes("GET", URI - .create("https://services.vcloudexpress.terremark.com/api/v0.8a-ext1.6/vdc/32"), - 404, "", "", ResourceNotFoundException.class); + assertCodeMakes("GET", URI.create("https://services.vcloudexpress.terremark.com/api/v0.8a-ext1.6/vdc/32"), 404, + "", "", ResourceNotFoundException.class); } @Test public void testDelete404SetsHttpResponseException() { - assertCodeMakes("DELETE", URI - .create("https://services.vcloudexpress.terremark.com/api/v0.8a-ext1.6/vdc/32"), + assertCodeMakes("DELETE", URI.create("https://services.vcloudexpress.terremark.com/api/v0.8a-ext1.6/vdc/32"), 404, "", "", HttpResponseException.class); } + @Test + public void testPOSTNotRunningSetsIllegalStateException() { + assertCodeMakes( + "POST", + URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vapp-138351019/action/undeploy"), + 400, + "HTTP/1.1 400 Bad Request", + VCloudMediaType.ERROR_XML, + "\n", + IllegalStateException.class); + } + @Test public void test401SetsAuthorizationException() { - assertCodeMakes("GET", URI - .create("https://services.vcloudexpress.terremark.com/api/v0.8a-ext1.6/vdc/32"), - 401, "", "", AuthorizationException.class); + assertCodeMakes("GET", URI.create("https://services.vcloudexpress.terremark.com/api/v0.8a-ext1.6/vdc/32"), 401, + "", "", AuthorizationException.class); } @Override diff --git a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java index 277bbd0a25..c65d49e8bf 100755 --- a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java @@ -561,7 +561,7 @@ public abstract class BaseComputeServiceLiveTest { } } - protected int nonBlockDuration = 30 * 1000; + protected int nonBlockDurationSeconds = 30; public void testOptionToNotBlock() throws Exception { String group = this.group + "block"; @@ -577,9 +577,9 @@ public abstract class BaseComputeServiceLiveTest { Set nodes = client.createNodesInGroup(group, 1, options); NodeMetadata node = getOnlyElement(nodes); assert node.getState() != NodeState.RUNNING; - long duration = System.currentTimeMillis() - time; - assert duration < nonBlockDuration : String.format("duration(%d) longer than expected(%d) seconds! ", - duration / 1000, nonBlockDuration); + long duration = (System.currentTimeMillis() - time) / 1000; + assert duration < nonBlockDurationSeconds : String.format("duration(%d) longer than expected(%d) seconds! ", + duration, nonBlockDurationSeconds); } finally { client.destroyNodesMatching(inGroup(group)); } diff --git a/core/src/test/java/org/jclouds/http/BaseHttpErrorHandlerTest.java b/core/src/test/java/org/jclouds/http/BaseHttpErrorHandlerTest.java index 20940e9a01..d1fc7c578e 100644 --- a/core/src/test/java/org/jclouds/http/BaseHttpErrorHandlerTest.java +++ b/core/src/test/java/org/jclouds/http/BaseHttpErrorHandlerTest.java @@ -59,15 +59,21 @@ public abstract class BaseHttpErrorHandlerTest { protected abstract Class getHandlerClass(); - protected void assertCodeMakes(String method, URI uri, int statusCode, String message, + protected void assertCodeMakes(String method, URI uri, int statusCode, String message, String content, + Class expected) { + assertCodeMakes(method, uri, statusCode, message, null, content, expected); + } + + protected void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType, String content, Class expected) { - HttpErrorHandler function = Guice.createInjector(new SaxParserModule()).getInstance( - getHandlerClass()); + HttpErrorHandler function = Guice.createInjector(new SaxParserModule()).getInstance(getHandlerClass()); HttpCommand command = createMock(HttpCommand.class); HttpRequest request = new HttpRequest(method, uri); HttpResponse response = new HttpResponse(statusCode, message, Payloads.newStringPayload(content)); + if (contentType != null) + response.getPayload().getContentMetadata().setContentType(contentType); expect(command.getCurrentRequest()).andReturn(request).atLeastOnce(); command.setException(classEq(expected)); diff --git a/providers/bluelock-vcdirector/src/test/java/org/jclouds/vcloud/bluelock/compute/BluelockVCloudDirectorComputeServiceLiveTest.java b/providers/bluelock-vcdirector/src/test/java/org/jclouds/vcloud/bluelock/compute/BluelockVCloudDirectorComputeServiceLiveTest.java index 0cf76f581c..00dc577a1a 100644 --- a/providers/bluelock-vcdirector/src/test/java/org/jclouds/vcloud/bluelock/compute/BluelockVCloudDirectorComputeServiceLiveTest.java +++ b/providers/bluelock-vcdirector/src/test/java/org/jclouds/vcloud/bluelock/compute/BluelockVCloudDirectorComputeServiceLiveTest.java @@ -39,7 +39,7 @@ public class BluelockVCloudDirectorComputeServiceLiveTest extends VCloudComputeS public BluelockVCloudDirectorComputeServiceLiveTest() { provider = "bluelock-vcdirector"; // vcloud requires instantiate before deploy, which takes longer than 30 seconds - nonBlockDuration = 300; + nonBlockDurationSeconds = 300; } @Override From 3989b13fcb84390718de3f6f89fb3b9bd32e321a Mon Sep 17 00:00:00 2001 From: Jeremy Whitlock Date: Wed, 1 Jun 2011 22:41:58 -0600 Subject: [PATCH 23/40] Issue 550: Added ProviderMetadata for CloudOne Storage. [in providers/cloudonestorage/src] * main/java/org/jclouds/cloudonestorage/CloudOneStorageProviderMetadata.java, main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata, test/java/org/jclouds/cloudonestorage/CloudOneStorageProviderTest.java: Added. --- .../CloudOneStorageProviderMetadata.java | 108 ++++++++++++++++++ .../org.jclouds.providers.ProviderMetadata | 1 + .../CloudOneStorageProviderTest.java | 37 ++++++ 3 files changed, 146 insertions(+) create mode 100644 providers/cloudonestorage/src/main/java/org/jclouds/cloudonestorage/CloudOneStorageProviderMetadata.java create mode 100644 providers/cloudonestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/CloudOneStorageProviderTest.java diff --git a/providers/cloudonestorage/src/main/java/org/jclouds/cloudonestorage/CloudOneStorageProviderMetadata.java b/providers/cloudonestorage/src/main/java/org/jclouds/cloudonestorage/CloudOneStorageProviderMetadata.java new file mode 100644 index 0000000000..5c0300b989 --- /dev/null +++ b/providers/cloudonestorage/src/main/java/org/jclouds/cloudonestorage/CloudOneStorageProviderMetadata.java @@ -0,0 +1,108 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.cloudonestorage; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; + +/** + * Implementation of {@ link org.jclouds.types.ProviderMetadata} for PEER1's + * CloudOne Storage provider. + * + * @author Jeremy Whitlock + */ +public class CloudOneStorageProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "cloudonestorage"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return BLOBSTORE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "PEER1 CloudOne Storage"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "Subtenant ID"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Shared Secret"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.peer1.com/hosting/cloudone-storage.php"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://mypeer1.com/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://www.peer1.com/sites/default/files/pdf/Atmos_System_Management_API_Guide_1.3.0A.pdf"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US-GA", "US-TX"); + } + +} diff --git a/providers/cloudonestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/cloudonestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..1e01a982a5 --- /dev/null +++ b/providers/cloudonestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.cloudonestorage.CloudOneStorageProviderMetadata diff --git a/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/CloudOneStorageProviderTest.java b/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/CloudOneStorageProviderTest.java new file mode 100644 index 0000000000..f6c1231378 --- /dev/null +++ b/providers/cloudonestorage/src/test/java/org/jclouds/cloudonestorage/CloudOneStorageProviderTest.java @@ -0,0 +1,37 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.cloudonestorage; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * The CloudOneStorageProviderTest tests the {@link CloudOneStorageProviderMetadata} class. + * + * @author Jeremy Whitlock + */ +@Test(groups = "unit", testName = "CloudOneStorageProviderTest") +public class CloudOneStorageProviderTest extends BaseProviderMetadataTest { + + public CloudOneStorageProviderTest() { + super(new CloudOneStorageProviderMetadata(), ProviderMetadata.BLOBSTORE_TYPE); + } + +} \ No newline at end of file From acffe37459e83ab3d93b713ec6a56766087ead0d Mon Sep 17 00:00:00 2001 From: Jeremy Whitlock Date: Wed, 1 Jun 2011 23:37:39 -0600 Subject: [PATCH 24/40] Issue 550: Added ProviderMetadata for Google Storage. [in providers/googlestorage/src] * main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java, main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata, test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java: Added. --- .../GoogleStorageProviderMetadata.java | 108 ++++++++++++++++++ .../org.jclouds.providers.ProviderMetadata | 1 + .../GoogleStorageProviderTest.java | 37 ++++++ 3 files changed, 146 insertions(+) create mode 100644 providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java create mode 100644 providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java diff --git a/providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java b/providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java new file mode 100644 index 0000000000..65ab1e30a0 --- /dev/null +++ b/providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java @@ -0,0 +1,108 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.googlestorage; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; + +/** + * Implementation of {@ link org.jclouds.types.ProviderMetadata} for Google's + * Storage provider. + * + * @author Jeremy Whitlock + */ +public class GoogleStorageProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "googlestorage"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return BLOBSTORE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "Google Storage"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "Access Key"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Secret Key"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://code.google.com/apis/storage/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://code.google.com/apis/console#:storage:access"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://code.google.com/apis/storage/docs/reference-guide.html"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US"); + } + +} diff --git a/providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..01a8afea14 --- /dev/null +++ b/providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.googlestorage.GoogleStorageProviderMetadata diff --git a/providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java b/providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java new file mode 100644 index 0000000000..1ac07495ce --- /dev/null +++ b/providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java @@ -0,0 +1,37 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.googlestorage; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * The GoogleStorageProviderTest tests the {@link GoogleStorageProviderMetadata} class. + * + * @author Jeremy Whitlock + */ +@Test(groups = "unit", testName = "GoogleStorageProviderTest") +public class GoogleStorageProviderTest extends BaseProviderMetadataTest { + + public GoogleStorageProviderTest() { + super(new GoogleStorageProviderMetadata(), ProviderMetadata.BLOBSTORE_TYPE); + } + +} \ No newline at end of file From e6b246a986f1b7c9395f0269059030798c34f76e Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 22:54:59 -0700 Subject: [PATCH 25/40] corrected typo in atmos --- .../src/main/java/org/jclouds/atmos/AtmosAsyncClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java index 1cde6a4214..3338d46e23 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java @@ -42,6 +42,7 @@ import org.jclouds.atmos.functions.AtmosObjectName; import org.jclouds.atmos.functions.ParseDirectoryListFromContentAndHeaders; import org.jclouds.atmos.functions.ParseObjectFromHeadersAndHttpContent; import org.jclouds.atmos.functions.ParseSystemMetadataFromHeaders; +import org.jclouds.atmos.functions.ParseUserMetadataFromHeaders; import org.jclouds.atmos.functions.ReturnEndpointIfAlreadyExists; import org.jclouds.atmos.options.ListOptions; import org.jclouds.blobstore.functions.ThrowContainerNotFoundOn404; @@ -164,7 +165,7 @@ public interface AtmosAsyncClient { * @see AtmosClient#getUserMetadata */ @HEAD - @ResponseParser(ParseSystemMetadataFromHeaders.class) + @ResponseParser(ParseUserMetadataFromHeaders.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class) @Path("/{path}") @QueryParams(keys = "metadata/user") From 89cee3a55fe4b082bbee2feb60742a50db49f4e6 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 22:55:25 -0700 Subject: [PATCH 26/40] made network matching more lenient --- .../vcloud/config/CommonVCloudRestClientModule.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/vcloud/src/main/java/org/jclouds/vcloud/config/CommonVCloudRestClientModule.java b/common/vcloud/src/main/java/org/jclouds/vcloud/config/CommonVCloudRestClientModule.java index 984e7e6486..58e587eae8 100644 --- a/common/vcloud/src/main/java/org/jclouds/vcloud/config/CommonVCloudRestClientModule.java +++ b/common/vcloud/src/main/java/org/jclouds/vcloud/config/CommonVCloudRestClientModule.java @@ -87,6 +87,7 @@ import org.jclouds.vcloud.predicates.TaskSuccess; import com.google.common.base.Function; import com.google.common.base.Predicate; +import com.google.common.base.Predicates; import com.google.common.base.Supplier; import com.google.common.collect.Iterables; import com.google.inject.ConfigurationException; @@ -451,12 +452,14 @@ public class CommonVCloudRestClientModule 0, "No networks present in vDC: " + vDC.getName()); if (networks.size() == 1) return Iterables.getLast(networks.values()).getHref(); + String networkName = null; try { - String networkName = injector.getInstance(Key.get(String.class, Names - .named(PROPERTY_VCLOUD_DEFAULT_NETWORK))); - ReferenceType network = networks.get(networkName); - checkState(network != null, String.format("network named %s not in %s", networkName, networks.keySet())); + networkName = injector.getInstance(Key.get(String.class, Names.named(PROPERTY_VCLOUD_DEFAULT_NETWORK))); + ReferenceType network = networks.get(Iterables.find(networks.keySet(), Predicates + .containsPattern(networkName))); return network.getHref(); + } catch (NoSuchElementException e) { + throw new IllegalStateException(String.format("network matching [%s] not in %s", networkName, networks.keySet())); } catch (ConfigurationException e) { return findDefaultNetworkForVDC(vDC, networks, injector); } From 5655e197b2685a3a87adc0dd0ffed05bcc46f113 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 1 Jun 2011 22:56:21 -0700 Subject: [PATCH 27/40] Issue 589:deprecate bluelock-vcdirector for bluelock-vcloud-vcenterprise; add bluelock-vcloud-zone01 --- README.txt | 3 +- allcompute/pom.xml | 10 + .../src/main/clojure/org/jclouds/compute2.clj | 17 +- core/src/main/resources/rest.properties | 9 + .../BluelockVCloudDirectorContextBuilder.java | 1 + ...uelockVCloudDirectorPropertiesBuilder.java | 3 + ...luelockVCloudDirectorProviderMetadata.java | 5 +- ...luelockVCloudDirectorRestClientModule.java | 1 + .../bluelock-vcloud-vcenterprise/pom.xml | 164 +++++++++++ ...luelockVCloudEnterpriseContextBuilder.java | 61 ++++ ...ockVCloudEnterpriseContextBuilder.java.new | 0 ...lockVCloudEnterprisePropertiesBuilder.java | 47 ++++ ...elockVCloudEnterpriseProviderMetadata.java | 116 ++++++++ ...elockVCloudEnterpriseRestClientModule.java | 34 +++ .../org.jclouds.providers.ProviderMetadata | 1 + .../BluelockVCloudEnterpriseProviderTest.java | 35 +++ ...luelockVCloudEnterpriseClientLiveTest.java | 35 +++ ...CloudEnterpriseComputeServiceLiveTest.java | 70 +++++ ...loudEnterpriseTemplateBuilderLiveTest.java | 77 +++++ ...VCloudEnterpriseCatalogClientLiveTest.java | 35 +++ ...VCloudEnterpriseNetworkClientLiveTest.java | 35 +++ ...lockVCloudEnterpriseOrgClientLiveTest.java | 35 +++ ...ockVCloudEnterpriseTaskClientLiveTest.java | 35 +++ ...ockVCloudEnterpriseVAppClientLiveTest.java | 35 +++ ...dEnterpriseVAppTemplateClientLiveTest.java | 35 +++ ...lockVCloudEnterpriseVDCClientLiveTest.java | 35 +++ ...elockVCloudEnterpriseVmClientLiveTest.java | 39 +++ .../src/test/resources/bluelock/vdc.xml | 265 ++++++++++++++++++ .../src/test/resources/log4j.xml | 170 +++++++++++ providers/bluelock-vcloud-zone01/pom.xml | 164 +++++++++++ .../BluelockVCloudZone01ContextBuilder.java | 61 ++++ ...BluelockVCloudZone01PropertiesBuilder.java | 47 ++++ .../BluelockVCloudZone01ProviderMetadata.java | 116 ++++++++ .../BluelockVCloudZone01RestClientModule.java | 34 +++ .../org.jclouds.providers.ProviderMetadata | 1 + .../BluelockVCloudZone01ProviderTest.java | 35 +++ ...tedBluelockVCloudZone01ClientLiveTest.java | 35 +++ ...ockVCloudZone01ComputeServiceLiveTest.java | 70 +++++ ...ckVCloudZone01TemplateBuilderLiveTest.java | 77 +++++ ...lockVCloudZone01CatalogClientLiveTest.java | 35 +++ ...lockVCloudZone01NetworkClientLiveTest.java | 35 +++ ...BluelockVCloudZone01OrgClientLiveTest.java | 35 +++ ...luelockVCloudZone01TaskClientLiveTest.java | 35 +++ ...luelockVCloudZone01VAppClientLiveTest.java | 35 +++ ...CloudZone01VAppTemplateClientLiveTest.java | 35 +++ ...BluelockVCloudZone01VDCClientLiveTest.java | 35 +++ .../BluelockVCloudZone01VmClientLiveTest.java | 39 +++ .../src/test/resources/bluelock/vdc.xml | 265 ++++++++++++++++++ .../src/test/resources/log4j.xml | 170 +++++++++++ providers/pom.xml | 2 + 50 files changed, 2759 insertions(+), 10 deletions(-) create mode 100644 providers/bluelock-vcloud-vcenterprise/pom.xml create mode 100644 providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseContextBuilder.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseContextBuilder.java.new create mode 100644 providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterprisePropertiesBuilder.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderMetadata.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/config/BluelockVCloudEnterpriseRestClientModule.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/DeprecatedBluelockVCloudEnterpriseClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseComputeServiceLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseTemplateBuilderLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseCatalogClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseNetworkClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseOrgClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseTaskClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppTemplateClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVDCClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVmClientLiveTest.java create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/resources/bluelock/vdc.xml create mode 100644 providers/bluelock-vcloud-vcenterprise/src/test/resources/log4j.xml create mode 100644 providers/bluelock-vcloud-zone01/pom.xml create mode 100644 providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ContextBuilder.java create mode 100644 providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01PropertiesBuilder.java create mode 100644 providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderMetadata.java create mode 100644 providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/config/BluelockVCloudZone01RestClientModule.java create mode 100644 providers/bluelock-vcloud-zone01/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/DeprecatedBluelockVCloudZone01ClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01ComputeServiceLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01TemplateBuilderLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01CatalogClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01NetworkClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01OrgClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01TaskClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppTemplateClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VDCClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VmClientLiveTest.java create mode 100644 providers/bluelock-vcloud-zone01/src/test/resources/bluelock/vdc.xml create mode 100644 providers/bluelock-vcloud-zone01/src/test/resources/log4j.xml diff --git a/README.txt b/README.txt index a5311e4791..96ac14d007 100644 --- a/README.txt +++ b/README.txt @@ -32,7 +32,8 @@ our dev version is 1.0-SNAPSHOT our compute api supports: aws-ec2, gogrid, cloudservers-us, stub (in-memory), deltacloud, cloudservers-uk, vcloud (generic), ec2 (generic), byon, nova, trmk-ecloud, trmk-vcloudexpress, eucalyptus (generic), - cloudsigma-zrh, elasticstack(generic), bluelock-vclouddirector, + cloudsigma-zrh, elasticstack(generic), bluelock-vcloud-vcenterprise, + bluelock-vcloud-zone01, slicehost, eucalyptus-partnercloud-ec2, elastichosts-lon-p (Peer 1), elastichosts-sat-p (Peer 1), elastichosts-lon-b (BlueSquare), openhosting-east1, serverlove-z1-man, skalicloud-sdg-my diff --git a/allcompute/pom.xml b/allcompute/pom.xml index 406dc89efe..465001759a 100644 --- a/allcompute/pom.xml +++ b/allcompute/pom.xml @@ -104,6 +104,16 @@ bluelock-vcdirector ${project.version} + + org.jclouds.provider + bluelock-vcloud-vcenterprise + ${project.version} + + + org.jclouds.provider + bluelock-vcloud-zone01 + ${project.version} + org.jclouds.provider gogrid diff --git a/compute/src/main/clojure/org/jclouds/compute2.clj b/compute/src/main/clojure/org/jclouds/compute2.clj index 00d3ef2ed3..88afc74f13 100644 --- a/compute/src/main/clojure/org/jclouds/compute2.clj +++ b/compute/src/main/clojure/org/jclouds/compute2.clj @@ -20,19 +20,22 @@ (ns org.jclouds.compute2 "A clojure binding to the jclouds ComputeService. - Current supported providers are: - [aws-ec2, eucualyptus-partnercloud-ec2, elastichosts-lon-b, - cloudservers-uk, cloudservers-us, byon, cloudsigma-zrh, stub, - trmk-ecloud, trmk-vcloudexpress, vcloud, bluelock, eucalyptus, - slicehost, elastichosts-lon-p, elastichosts-sat-p, elastichosts, - openhosting-east1, serverlove-z1-man, skalicloud-sdg-my, deltacloud] + jclouds supports many compute providers including Amazon EC2 (aws-ec2), + Rackspace Cloud Servers (cloudservers-us), GoGrid (gogrid), and BlueLock + vCloud (bluelock-vcloud-zone01). There are over a dozen to choose from. + + Current supported providers are available via the following dependency: + org.jclouds/jclouds-allcompute + + You can inquire about which providers are loaded via the following: + (seq (org.jclouds.providers.Providers/allCompute)) Here's an example of getting some compute configuration from rackspace: (use 'org.jclouds.compute2) (use 'clojure.pprint) - (def provider \"cloudservers\") + (def provider \"cloudservers-us\") (def provider-identity \"username\") (def provider-credential \"password\") diff --git a/core/src/main/resources/rest.properties b/core/src/main/resources/rest.properties index af8b0e75e3..910dcf59cc 100644 --- a/core/src/main/resources/rest.properties +++ b/core/src/main/resources/rest.properties @@ -95,6 +95,15 @@ cloudservers-us.propertiesbuilder=org.jclouds.rackspace.cloudservers.CloudServer bluelock-vcdirector.contextbuilder=org.jclouds.vcloud.bluelock.BluelockVCloudDirectorContextBuilder bluelock-vcdirector.propertiesbuilder=org.jclouds.vcloud.bluelock.BluelockVCloudDirectorPropertiesBuilder +bluelock-vcdirector.contextbuilder=org.jclouds.vcloud.bluelock.BluelockVCloudDirectorContextBuilder +bluelock-vcdirector.propertiesbuilder=org.jclouds.vcloud.bluelock.BluelockVCloudDirectorPropertiesBuilder + +bluelock-vcloud-vcenterprise.contextbuilder=org.jclouds.bluelock.vcloud.vcenterprise.BluelockVCloudEnterpriseContextBuilder +bluelock-vcloud-vcenterprise.propertiesbuilder=org.jclouds.bluelock.vcloud.vcenterprise.BluelockVCloudEnterprisePropertiesBuilder + +bluelock-vcloud-zone01.contextbuilder=org.jclouds.bluelock.vcloud.zone01.BluelockVCloudZone01ContextBuilder +bluelock-vcloud-zone01.propertiesbuilder=org.jclouds.bluelock.vcloud.zone01.BluelockVCloudZone01PropertiesBuilder + gogrid.propertiesbuilder=org.jclouds.gogrid.GoGridPropertiesBuilder gogrid.contextbuilder=org.jclouds.gogrid.GoGridContextBuilder diff --git a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorContextBuilder.java b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorContextBuilder.java index 8df5951a8e..c479c0d1ee 100644 --- a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorContextBuilder.java +++ b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorContextBuilder.java @@ -42,6 +42,7 @@ import com.google.inject.Module; * * @author Adrian Cole */ +@Deprecated public class BluelockVCloudDirectorContextBuilder extends VCloudContextBuilder { public BluelockVCloudDirectorContextBuilder(Properties props) { diff --git a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorPropertiesBuilder.java b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorPropertiesBuilder.java index 899a3912ee..d16116f559 100644 --- a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorPropertiesBuilder.java +++ b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorPropertiesBuilder.java @@ -23,6 +23,7 @@ import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK; import java.util.Properties; +import java.util.logging.Logger; import org.jclouds.vcloud.VCloudPropertiesBuilder; @@ -31,9 +32,11 @@ import org.jclouds.vcloud.VCloudPropertiesBuilder; * * @author Adrian Cole */ +@Deprecated public class BluelockVCloudDirectorPropertiesBuilder extends VCloudPropertiesBuilder { @Override protected Properties defaultProperties() { + Logger.getAnonymousLogger().warning("this provider is deprecated: please use \"bluelock-vcloud-vcenterprise\""); Properties properties = super.defaultProperties(); properties.setProperty(PROPERTY_ISO3166_CODES, "US-IN"); properties.setProperty(PROPERTY_ENDPOINT, "https://vcenterprise.bluelock.com/api"); diff --git a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorProviderMetadata.java b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorProviderMetadata.java index 17c285f082..418f57a83f 100644 --- a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorProviderMetadata.java +++ b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/BluelockVCloudDirectorProviderMetadata.java @@ -27,10 +27,11 @@ import org.jclouds.providers.BaseProviderMetadata; import org.jclouds.providers.ProviderMetadata; /** - * Implementation of {@link org.jclouds.types.ProviderMetadata} for Bluelock vCloud Director. + * Implementation of {@link org.jclouds.types.ProviderMetadata} for Bluelock vCloud Enterprise. * * @author Adrian Cole */ +@Deprecated public class BluelockVCloudDirectorProviderMetadata extends BaseProviderMetadata { /** @@ -54,7 +55,7 @@ public class BluelockVCloudDirectorProviderMetadata extends BaseProviderMetadata */ @Override public String getName() { - return "Bluelock vCloud Director"; + return "Bluelock vCloud Enterprise"; } /** diff --git a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/config/BluelockVCloudDirectorRestClientModule.java b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/config/BluelockVCloudDirectorRestClientModule.java index 656876228e..3847087c83 100644 --- a/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/config/BluelockVCloudDirectorRestClientModule.java +++ b/providers/bluelock-vcdirector/src/main/java/org/jclouds/vcloud/bluelock/config/BluelockVCloudDirectorRestClientModule.java @@ -27,6 +27,7 @@ import org.jclouds.vcloud.config.VCloudRestClientModule; * * @author Adrian Cole */ +@Deprecated @RequiresHttp @ConfiguresRestClient public class BluelockVCloudDirectorRestClientModule extends VCloudRestClientModule { diff --git a/providers/bluelock-vcloud-vcenterprise/pom.xml b/providers/bluelock-vcloud-vcenterprise/pom.xml new file mode 100644 index 0000000000..ef0a7d2ca7 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/pom.xml @@ -0,0 +1,164 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + bluelock-vcloud-vcenterprise + jclouds Bluelock vCloud Enterprise provider + vCloud implementation targeted to Bluelock vCloud Enterprise + bundle + + + https://vcenterprise.bluelock.com/api + 1.0 + FIXME_IDENTITY + FIXME_CREDENTIAL + + + + + org.jclouds.api + vcloud + ${project.version} + + + org.jclouds.common + vcloud-common + ${project.version} + test-jar + test + + + org.jclouds.api + vcloud + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-compute + ${project.version} + test-jar + test + + + org.jclouds.driver + jclouds-log4j + ${project.version} + test + + + org.jclouds.driver + jclouds-jsch + ${project.version} + test + + + com.jcraft + jsch + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.bluelock-vcloud-vcenterprise.endpoint + ${test.bluelock-vcloud-vcenterprise.endpoint} + + + test.bluelock-vcloud-vcenterprise.apiversion + ${test.bluelock-vcloud-vcenterprise.apiversion} + + + test.bluelock-vcloud-vcenterprise.identity + ${test.bluelock-vcloud-vcenterprise.identity} + + + test.bluelock-vcloud-vcenterprise.credential + ${test.bluelock-vcloud-vcenterprise.credential} + + + + + + + + + + + + + + + org.apache.felix + maven-bundle-plugin + + + ${project.artifactId} + org.jclouds.bluelock.vcloud.vcenterprise.*;version="${project.version}" + org.jclouds.*;version="${project.version}",* + + + + + + + + diff --git a/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseContextBuilder.java b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseContextBuilder.java new file mode 100644 index 0000000000..a5772afdfc --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseContextBuilder.java @@ -0,0 +1,61 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise; + +import java.util.List; +import java.util.Properties; + +import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; +import org.jclouds.logging.jdk.config.JDKLoggingModule; +import org.jclouds.vcloud.VCloudContextBuilder; +import org.jclouds.bluelock.vcloud.vcenterprise.config.BluelockVCloudEnterpriseRestClientModule; +import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule; + +import com.google.inject.Injector; +import com.google.inject.Module; + +/** + * Creates {@link BlueLockVCloudComputeServiceContext} or {@link Injector} instances based on the + * most commonly requested arguments. + *

+ * Note that Threadsafe objects will be bound as singletons to the Injector or Context provided. + *

+ *

+ * If no Modules are specified, the default {@link JDKLoggingModule logging} and + * {@link JavaUrlHttpCommandExecutorServiceModule http transports} will be installed. + * + * @author Adrian Cole + */ +public class BluelockVCloudEnterpriseContextBuilder extends VCloudContextBuilder { + + public BluelockVCloudEnterpriseContextBuilder(Properties props) { + super(props); + } + + @Override + protected void addContextModule(List modules) { + modules.add(new VCloudComputeServiceContextModule()); + } + + @Override + protected void addClientModule(List modules) { + modules.add(new BluelockVCloudEnterpriseRestClientModule()); + } + +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseContextBuilder.java.new b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseContextBuilder.java.new new file mode 100644 index 0000000000..e69de29bb2 diff --git a/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterprisePropertiesBuilder.java b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterprisePropertiesBuilder.java new file mode 100644 index 0000000000..5ee26e8d44 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterprisePropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; +import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK; + +import java.util.Properties; + +import org.jclouds.vcloud.VCloudPropertiesBuilder; + +/** + * Builds properties used in bluelock VCloud Clients + * + * @author Adrian Cole + */ +public class BluelockVCloudEnterprisePropertiesBuilder extends VCloudPropertiesBuilder { + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_ISO3166_CODES, "US-IN"); + properties.setProperty(PROPERTY_ENDPOINT, "https://vcenterprise.bluelock.com/api"); + properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, "internet01"); + return properties; + } + + public BluelockVCloudEnterprisePropertiesBuilder(Properties properties) { + super(properties); + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderMetadata.java b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderMetadata.java new file mode 100644 index 0000000000..68a2cb71f6 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderMetadata.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; +import org.jclouds.providers.ProviderMetadata; + +/** + * Implementation of {@link org.jclouds.types.ProviderMetadata} for Bluelock vCloud Director. + * + * @author Adrian Cole + */ +public class BluelockVCloudEnterpriseProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "bluelock-vcloud-vcenterprise"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return ProviderMetadata.COMPUTE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "Bluelock vCloud Director"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "User at Organization (user@org)"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Password"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.bluelock.com/bluelock-cloud-hosting"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://vcenterprise.bluelock.com/cloud/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://www.vmware.com/support/pubs/vcd_pubs.html"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getLinkedServices() { + return ImmutableSet.of("bluelock-vcloud-vcenterprise"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US-IN"); + } + +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/config/BluelockVCloudEnterpriseRestClientModule.java b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/config/BluelockVCloudEnterpriseRestClientModule.java new file mode 100644 index 0000000000..c28236a186 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/main/java/org/jclouds/bluelock/vcloud/vcenterprise/config/BluelockVCloudEnterpriseRestClientModule.java @@ -0,0 +1,34 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.config; + +import org.jclouds.http.RequiresHttp; +import org.jclouds.rest.ConfiguresRestClient; +import org.jclouds.vcloud.config.VCloudRestClientModule; + +/** + * Configures the VCloud authentication service connection, including logging and http transport. + * + * @author Adrian Cole + */ +@RequiresHttp +@ConfiguresRestClient +public class BluelockVCloudEnterpriseRestClientModule extends VCloudRestClientModule { + +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/bluelock-vcloud-vcenterprise/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..0b50f63dbc --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.bluelock.vcloud.vcenterprise.BluelockVCloudEnterpriseProviderMetadata diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderTest.java new file mode 100644 index 0000000000..3f94f08223 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/BluelockVCloudEnterpriseProviderTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "unit", testName = "BluelockVCloudEnterpriseProviderTest") +public class BluelockVCloudEnterpriseProviderTest extends BaseProviderMetadataTest { + + public BluelockVCloudEnterpriseProviderTest() { + super(new BluelockVCloudEnterpriseProviderMetadata(), ProviderMetadata.COMPUTE_TYPE); + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/DeprecatedBluelockVCloudEnterpriseClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/DeprecatedBluelockVCloudEnterpriseClientLiveTest.java new file mode 100644 index 0000000000..1d3848e318 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/DeprecatedBluelockVCloudEnterpriseClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise; + +import org.jclouds.vcloud.DeprecatedVCloudClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Deprecated +@Test(groups = "live", singleThreaded = true, testName = "DeprecatedBluelockVCloudEnterpriseClientLiveTest") +public class DeprecatedBluelockVCloudEnterpriseClientLiveTest extends DeprecatedVCloudClientLiveTest { + public DeprecatedBluelockVCloudEnterpriseClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } + +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseComputeServiceLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseComputeServiceLiveTest.java new file mode 100644 index 0000000000..4a5bef6593 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseComputeServiceLiveTest.java @@ -0,0 +1,70 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import org.jclouds.compute.domain.Image; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.Template; +import org.jclouds.compute.domain.TemplateBuilder; +import org.jclouds.compute.predicates.OperatingSystemPredicates; +import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseComputeServiceLiveTest") +public class BluelockVCloudEnterpriseComputeServiceLiveTest extends VCloudComputeServiceLiveTest { + public BluelockVCloudEnterpriseComputeServiceLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + // vcloud requires instantiate before deploy, which takes longer than 30 seconds + nonBlockDurationSeconds = 300; + } + + @Override + public void setServiceDefaults() { + group = "director"; + } + + @Test + public void testTemplateBuilder() { + Template defaultTemplate = client.templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assert OperatingSystemPredicates.supportsApt().apply(defaultTemplate.getImage().getOperatingSystem()); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getDescription(), "Ubuntu Linux (64-bit)"); + assert defaultTemplate.getLocation().getId() != null : defaultTemplate.getLocation(); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + System.out.println(defaultTemplate.getHardware()); + } + + @Override + protected Template buildTemplate(TemplateBuilder templateBuilder) { + Template template = super.buildTemplate(templateBuilder); + Image image = template.getImage(); + assert image.getDefaultCredentials().credential != null : image; + return template; + } + +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseTemplateBuilderLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseTemplateBuilderLiveTest.java new file mode 100644 index 0000000000..ef0d4cd023 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/compute/BluelockVCloudEnterpriseTemplateBuilderLiveTest.java @@ -0,0 +1,77 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.util.Set; + +import org.jclouds.compute.BaseTemplateBuilderLiveTest; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.OsFamilyVersion64Bit; +import org.jclouds.compute.domain.Template; +import org.testng.annotations.Test; + +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableSet; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "BluelockVCloudEnterpriseTemplateBuilderLiveTest") +public class BluelockVCloudEnterpriseTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { + + public BluelockVCloudEnterpriseTemplateBuilderLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } + + @Override + protected Predicate defineUnsupportedOperatingSystems() { + return new Predicate() { + + @Override + public boolean apply(OsFamilyVersion64Bit input) { + switch (input.family) { + case UBUNTU: + return !input.version.equals("") || !input.is64Bit; + default: + return true; + } + } + + }; + } + + @Override + public void testDefaultTemplateBuilder() throws IOException { + Template defaultTemplate = context.getComputeService().templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), ""); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + } + + @Override + protected Set getIso3166Codes() { + return ImmutableSet. of("US-IN"); + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseCatalogClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseCatalogClientLiveTest.java new file mode 100644 index 0000000000..6a30ec381f --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseCatalogClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.CatalogClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseCatalogClientLiveTest") +public class BluelockVCloudEnterpriseCatalogClientLiveTest extends CatalogClientLiveTest { + + public BluelockVCloudEnterpriseCatalogClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseNetworkClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseNetworkClientLiveTest.java new file mode 100644 index 0000000000..05ef8f43bd --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseNetworkClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.NetworkClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseNetworkClientLiveTest") +public class BluelockVCloudEnterpriseNetworkClientLiveTest extends NetworkClientLiveTest { + + public BluelockVCloudEnterpriseNetworkClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseOrgClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseOrgClientLiveTest.java new file mode 100644 index 0000000000..d9d8ea524c --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseOrgClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.OrgClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseOrgClientLiveTest") +public class BluelockVCloudEnterpriseOrgClientLiveTest extends OrgClientLiveTest { + + public BluelockVCloudEnterpriseOrgClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseTaskClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseTaskClientLiveTest.java new file mode 100644 index 0000000000..4cdd1506d0 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseTaskClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.TaskClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseTaskClientLiveTest") +public class BluelockVCloudEnterpriseTaskClientLiveTest extends TaskClientLiveTest { + + public BluelockVCloudEnterpriseTaskClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppClientLiveTest.java new file mode 100644 index 0000000000..14c3995cce --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.VAppClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseVAppClientLiveTest") +public class BluelockVCloudEnterpriseVAppClientLiveTest extends VAppClientLiveTest { + + public BluelockVCloudEnterpriseVAppClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppTemplateClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppTemplateClientLiveTest.java new file mode 100644 index 0000000000..54cecdadbf --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVAppTemplateClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.VAppTemplateClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseVAppTemplateClientLiveTest") +public class BluelockVCloudEnterpriseVAppTemplateClientLiveTest extends VAppTemplateClientLiveTest { + + public BluelockVCloudEnterpriseVAppTemplateClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVDCClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVDCClientLiveTest.java new file mode 100644 index 0000000000..2bf6fa6f6a --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVDCClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.VDCClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseVDCClientLiveTest") +public class BluelockVCloudEnterpriseVDCClientLiveTest extends VDCClientLiveTest { + + public BluelockVCloudEnterpriseVDCClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVmClientLiveTest.java b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVmClientLiveTest.java new file mode 100644 index 0000000000..afa6629c0d --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/java/org/jclouds/bluelock/vcloud/vcenterprise/features/BluelockVCloudEnterpriseVmClientLiveTest.java @@ -0,0 +1,39 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.vcenterprise.features; + +import org.jclouds.vcloud.features.VmClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudEnterpriseVmClientLiveTest") +public class BluelockVCloudEnterpriseVmClientLiveTest extends VmClientLiveTest { + + public BluelockVCloudEnterpriseVmClientLiveTest() { + provider = "bluelock-vcloud-vcenterprise"; + } + + protected void checkApiOutput(String apiOutput) { + checkApiOutput1_0_0(apiOutput); + } +} diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/resources/bluelock/vdc.xml b/providers/bluelock-vcloud-vcenterprise/src/test/resources/bluelock/vdc.xml new file mode 100644 index 0000000000..0eb6c68bc9 --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/resources/bluelock/vdc.xml @@ -0,0 +1,265 @@ + + + + + + people in paradise + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/providers/bluelock-vcloud-vcenterprise/src/test/resources/log4j.xml b/providers/bluelock-vcloud-vcenterprise/src/test/resources/log4j.xml new file mode 100644 index 0000000000..c1e74e57ff --- /dev/null +++ b/providers/bluelock-vcloud-vcenterprise/src/test/resources/log4j.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/providers/bluelock-vcloud-zone01/pom.xml b/providers/bluelock-vcloud-zone01/pom.xml new file mode 100644 index 0000000000..ace6570bb2 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/pom.xml @@ -0,0 +1,164 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + bluelock-vcloud-zone01 + jclouds Bluelock vCloud Zone01 provider + vCloud implementation targeted to Bluelock vCloud Zone01 + bundle + + + https://zone01.bluelock.com/api + 1.0 + FIXME_IDENTITY + FIXME_CREDENTIAL + + + + + org.jclouds.api + vcloud + ${project.version} + + + org.jclouds.common + vcloud-common + ${project.version} + test-jar + test + + + org.jclouds.api + vcloud + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-compute + ${project.version} + test-jar + test + + + org.jclouds.driver + jclouds-log4j + ${project.version} + test + + + org.jclouds.driver + jclouds-jsch + ${project.version} + test + + + com.jcraft + jsch + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.bluelock-vcloud-zone01.endpoint + ${test.bluelock-vcloud-zone01.endpoint} + + + test.bluelock-vcloud-zone01.apiversion + ${test.bluelock-vcloud-zone01.apiversion} + + + test.bluelock-vcloud-zone01.identity + ${test.bluelock-vcloud-zone01.identity} + + + test.bluelock-vcloud-zone01.credential + ${test.bluelock-vcloud-zone01.credential} + + + + + + + + + + + + + + + org.apache.felix + maven-bundle-plugin + + + ${project.artifactId} + org.jclouds.bluelock.vcloud.zone01.*;version="${project.version}" + org.jclouds.*;version="${project.version}",* + + + + + + + + diff --git a/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ContextBuilder.java b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ContextBuilder.java new file mode 100644 index 0000000000..0978531e40 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ContextBuilder.java @@ -0,0 +1,61 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01; + +import java.util.List; +import java.util.Properties; + +import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; +import org.jclouds.logging.jdk.config.JDKLoggingModule; +import org.jclouds.vcloud.VCloudContextBuilder; +import org.jclouds.bluelock.vcloud.zone01.config.BluelockVCloudZone01RestClientModule; +import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule; + +import com.google.inject.Injector; +import com.google.inject.Module; + +/** + * Creates {@link BlueLockVCloudComputeServiceContext} or {@link Injector} instances based on the + * most commonly requested arguments. + *

+ * Note that Threadsafe objects will be bound as singletons to the Injector or Context provided. + *

+ *

+ * If no Modules are specified, the default {@link JDKLoggingModule logging} and + * {@link JavaUrlHttpCommandExecutorServiceModule http transports} will be installed. + * + * @author Adrian Cole + */ +public class BluelockVCloudZone01ContextBuilder extends VCloudContextBuilder { + + public BluelockVCloudZone01ContextBuilder(Properties props) { + super(props); + } + + @Override + protected void addContextModule(List modules) { + modules.add(new VCloudComputeServiceContextModule()); + } + + @Override + protected void addClientModule(List modules) { + modules.add(new BluelockVCloudZone01RestClientModule()); + } + +} diff --git a/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01PropertiesBuilder.java b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01PropertiesBuilder.java new file mode 100644 index 0000000000..779b1fdf85 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01PropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; +import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK; + +import java.util.Properties; + +import org.jclouds.vcloud.VCloudPropertiesBuilder; + +/** + * Builds properties used in bluelock VCloud Clients + * + * @author Adrian Cole + */ +public class BluelockVCloudZone01PropertiesBuilder extends VCloudPropertiesBuilder { + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_ISO3166_CODES, "US-IN"); + properties.setProperty(PROPERTY_ENDPOINT, "https://zone01.bluelock.com/api"); + properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, "internet01"); + return properties; + } + + public BluelockVCloudZone01PropertiesBuilder(Properties properties) { + super(properties); + } +} diff --git a/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderMetadata.java b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderMetadata.java new file mode 100644 index 0000000000..d4199e5771 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderMetadata.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; +import org.jclouds.providers.ProviderMetadata; + +/** + * Implementation of {@link org.jclouds.types.ProviderMetadata} for Bluelock vCloud Zone 1. + * + * @author Adrian Cole + */ +public class BluelockVCloudZone01ProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "bluelock-vcloud-zone01"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return ProviderMetadata.COMPUTE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "Bluelock vCloud Zone 1"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "User at Organization (user@org)"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Password"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.bluelock.com/bluelock-cloud-hosting"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://zone01.bluelock.com/cloud/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://www.vmware.com/support/pubs/vcd_pubs.html"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getLinkedServices() { + return ImmutableSet.of("bluelock-vcloud-zone01"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US-IN"); + } + +} diff --git a/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/config/BluelockVCloudZone01RestClientModule.java b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/config/BluelockVCloudZone01RestClientModule.java new file mode 100644 index 0000000000..61ef8a6834 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/main/java/org/jclouds/bluelock/vcloud/zone01/config/BluelockVCloudZone01RestClientModule.java @@ -0,0 +1,34 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.config; + +import org.jclouds.http.RequiresHttp; +import org.jclouds.rest.ConfiguresRestClient; +import org.jclouds.vcloud.config.VCloudRestClientModule; + +/** + * Configures the VCloud authentication service connection, including logging and http transport. + * + * @author Adrian Cole + */ +@RequiresHttp +@ConfiguresRestClient +public class BluelockVCloudZone01RestClientModule extends VCloudRestClientModule { + +} diff --git a/providers/bluelock-vcloud-zone01/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/bluelock-vcloud-zone01/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..6f51746574 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.bluelock.vcloud.zone01.BluelockVCloudZone01ProviderMetadata diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderTest.java new file mode 100644 index 0000000000..66d61697de --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/BluelockVCloudZone01ProviderTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "unit", testName = "BluelockVCloudZone01ProviderTest") +public class BluelockVCloudZone01ProviderTest extends BaseProviderMetadataTest { + + public BluelockVCloudZone01ProviderTest() { + super(new BluelockVCloudZone01ProviderMetadata(), ProviderMetadata.COMPUTE_TYPE); + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/DeprecatedBluelockVCloudZone01ClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/DeprecatedBluelockVCloudZone01ClientLiveTest.java new file mode 100644 index 0000000000..7036553d6e --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/DeprecatedBluelockVCloudZone01ClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01; + +import org.jclouds.vcloud.DeprecatedVCloudClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Deprecated +@Test(groups = "live", singleThreaded = true, testName = "DeprecatedBluelockVCloudZone01ClientLiveTest") +public class DeprecatedBluelockVCloudZone01ClientLiveTest extends DeprecatedVCloudClientLiveTest { + public DeprecatedBluelockVCloudZone01ClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } + +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01ComputeServiceLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01ComputeServiceLiveTest.java new file mode 100644 index 0000000000..edc603e0dd --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01ComputeServiceLiveTest.java @@ -0,0 +1,70 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import org.jclouds.compute.domain.Image; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.Template; +import org.jclouds.compute.domain.TemplateBuilder; +import org.jclouds.compute.predicates.OperatingSystemPredicates; +import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01ComputeServiceLiveTest") +public class BluelockVCloudZone01ComputeServiceLiveTest extends VCloudComputeServiceLiveTest { + public BluelockVCloudZone01ComputeServiceLiveTest() { + provider = "bluelock-vcloud-zone01"; + // vcloud requires instantiate before deploy, which takes longer than 30 seconds + nonBlockDurationSeconds = 300; + } + + @Override + public void setServiceDefaults() { + group = "director"; + } + + @Test + public void testTemplateBuilder() { + Template defaultTemplate = client.templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assert OperatingSystemPredicates.supportsApt().apply(defaultTemplate.getImage().getOperatingSystem()); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getDescription(), "Ubuntu Linux (64-bit)"); + assert defaultTemplate.getLocation().getId() != null : defaultTemplate.getLocation(); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + System.out.println(defaultTemplate.getHardware()); + } + + @Override + protected Template buildTemplate(TemplateBuilder templateBuilder) { + Template template = super.buildTemplate(templateBuilder); + Image image = template.getImage(); + assert image.getDefaultCredentials().credential != null : image; + return template; + } + +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01TemplateBuilderLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01TemplateBuilderLiveTest.java new file mode 100644 index 0000000000..f78f24b232 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/compute/BluelockVCloudZone01TemplateBuilderLiveTest.java @@ -0,0 +1,77 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.util.Set; + +import org.jclouds.compute.BaseTemplateBuilderLiveTest; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.OsFamilyVersion64Bit; +import org.jclouds.compute.domain.Template; +import org.testng.annotations.Test; + +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableSet; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "BluelockVCloudZone01TemplateBuilderLiveTest") +public class BluelockVCloudZone01TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { + + public BluelockVCloudZone01TemplateBuilderLiveTest() { + provider = "bluelock-vcloud-zone01"; + } + + @Override + protected Predicate defineUnsupportedOperatingSystems() { + return new Predicate() { + + @Override + public boolean apply(OsFamilyVersion64Bit input) { + switch (input.family) { + case UBUNTU: + return !input.version.equals("") || !input.is64Bit; + default: + return true; + } + } + + }; + } + + @Override + public void testDefaultTemplateBuilder() throws IOException { + Template defaultTemplate = context.getComputeService().templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), ""); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + } + + @Override + protected Set getIso3166Codes() { + return ImmutableSet. of("US-IN"); + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01CatalogClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01CatalogClientLiveTest.java new file mode 100644 index 0000000000..16e6a7af01 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01CatalogClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.CatalogClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01CatalogClientLiveTest") +public class BluelockVCloudZone01CatalogClientLiveTest extends CatalogClientLiveTest { + + public BluelockVCloudZone01CatalogClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01NetworkClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01NetworkClientLiveTest.java new file mode 100644 index 0000000000..1c1cc78e54 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01NetworkClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.NetworkClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01NetworkClientLiveTest") +public class BluelockVCloudZone01NetworkClientLiveTest extends NetworkClientLiveTest { + + public BluelockVCloudZone01NetworkClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01OrgClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01OrgClientLiveTest.java new file mode 100644 index 0000000000..286ca58611 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01OrgClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.OrgClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01OrgClientLiveTest") +public class BluelockVCloudZone01OrgClientLiveTest extends OrgClientLiveTest { + + public BluelockVCloudZone01OrgClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01TaskClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01TaskClientLiveTest.java new file mode 100644 index 0000000000..82d857ad58 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01TaskClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.TaskClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01TaskClientLiveTest") +public class BluelockVCloudZone01TaskClientLiveTest extends TaskClientLiveTest { + + public BluelockVCloudZone01TaskClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppClientLiveTest.java new file mode 100644 index 0000000000..d8744391c1 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.VAppClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01VAppClientLiveTest") +public class BluelockVCloudZone01VAppClientLiveTest extends VAppClientLiveTest { + + public BluelockVCloudZone01VAppClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppTemplateClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppTemplateClientLiveTest.java new file mode 100644 index 0000000000..b72b97d814 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VAppTemplateClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.VAppTemplateClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01VAppTemplateClientLiveTest") +public class BluelockVCloudZone01VAppTemplateClientLiveTest extends VAppTemplateClientLiveTest { + + public BluelockVCloudZone01VAppTemplateClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VDCClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VDCClientLiveTest.java new file mode 100644 index 0000000000..5b09a5d13f --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VDCClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.VDCClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01VDCClientLiveTest") +public class BluelockVCloudZone01VDCClientLiveTest extends VDCClientLiveTest { + + public BluelockVCloudZone01VDCClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VmClientLiveTest.java b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VmClientLiveTest.java new file mode 100644 index 0000000000..52276b3f50 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/java/org/jclouds/bluelock/vcloud/zone01/features/BluelockVCloudZone01VmClientLiveTest.java @@ -0,0 +1,39 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.bluelock.vcloud.zone01.features; + +import org.jclouds.vcloud.features.VmClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "BluelockVCloudZone01VmClientLiveTest") +public class BluelockVCloudZone01VmClientLiveTest extends VmClientLiveTest { + + public BluelockVCloudZone01VmClientLiveTest() { + provider = "bluelock-vcloud-zone01"; + } + + protected void checkApiOutput(String apiOutput) { + checkApiOutput1_0_0(apiOutput); + } +} diff --git a/providers/bluelock-vcloud-zone01/src/test/resources/bluelock/vdc.xml b/providers/bluelock-vcloud-zone01/src/test/resources/bluelock/vdc.xml new file mode 100644 index 0000000000..0eb6c68bc9 --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/resources/bluelock/vdc.xml @@ -0,0 +1,265 @@ + + + + + + people in paradise + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/providers/bluelock-vcloud-zone01/src/test/resources/log4j.xml b/providers/bluelock-vcloud-zone01/src/test/resources/log4j.xml new file mode 100644 index 0000000000..c1e74e57ff --- /dev/null +++ b/providers/bluelock-vcloud-zone01/src/test/resources/log4j.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/providers/pom.xml b/providers/pom.xml index 59bb182b5f..3b29719485 100644 --- a/providers/pom.xml +++ b/providers/pom.xml @@ -54,6 +54,8 @@ cloudfiles-uk cloudloadbalancers-us bluelock-vcdirector + bluelock-vcloud-vcenterprise + bluelock-vcloud-zone01 trmk-ecloud trmk-vcloudexpress elastichosts-lon-p From 8d317d67b5dfc47f7c944bd1da663dca33c4584e Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 00:21:51 -0700 Subject: [PATCH 28/40] Issue 590:Support StratoGen vCloud provider --- README.txt | 2 +- allcompute/pom.xml | 5 + core/src/main/resources/rest.properties | 3 + providers/pom.xml | 1 + providers/stratogen-vcloud-mycloud/pom.xml | 164 +++++++++++++++++ .../StratoGenVCloudMyCloudContextBuilder.java | 51 ++++++ ...ratoGenVCloudMyCloudPropertiesBuilder.java | 47 +++++ ...tratoGenVCloudMyCloudProviderMetadata.java | 116 ++++++++++++ ...oudMyCloudComputeServiceContextModule.java | 38 ++++ ...tratoGenVCloudMyCloudRestClientModule.java | 34 ++++ .../org.jclouds.providers.ProviderMetadata | 1 + ...dStratoGenVCloudMyCloudClientLiveTest.java | 35 ++++ .../StratoGenVCloudMyCloudProviderTest.java | 35 ++++ ...enVCloudMyCloudComputeServiceLiveTest.java | 70 ++++++++ ...nVCloudMyCloudTemplateBuilderLiveTest.java | 77 ++++++++ ...GenVCloudMyCloudCatalogClientLiveTest.java | 35 ++++ ...GenVCloudMyCloudNetworkClientLiveTest.java | 35 ++++ ...ratoGenVCloudMyCloudOrgClientLiveTest.java | 35 ++++ ...atoGenVCloudMyCloudTaskClientLiveTest.java | 35 ++++ ...atoGenVCloudMyCloudVAppClientLiveTest.java | 35 ++++ ...loudMyCloudVAppTemplateClientLiveTest.java | 35 ++++ ...ratoGenVCloudMyCloudVDCClientLiveTest.java | 35 ++++ ...tratoGenVCloudMyCloudVmClientLiveTest.java | 39 ++++ .../src/test/resources/log4j.xml | 170 ++++++++++++++++++ 24 files changed, 1132 insertions(+), 1 deletion(-) create mode 100644 providers/stratogen-vcloud-mycloud/pom.xml create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java create mode 100644 providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java create mode 100644 providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml diff --git a/README.txt b/README.txt index 96ac14d007..89c1dd96a5 100644 --- a/README.txt +++ b/README.txt @@ -33,7 +33,7 @@ our compute api supports: aws-ec2, gogrid, cloudservers-us, stub (in-memory), de cloudservers-uk, vcloud (generic), ec2 (generic), byon, nova, trmk-ecloud, trmk-vcloudexpress, eucalyptus (generic), cloudsigma-zrh, elasticstack(generic), bluelock-vcloud-vcenterprise, - bluelock-vcloud-zone01, + bluelock-vcloud-zone01, stratogen-vcloud-mycloud, slicehost, eucalyptus-partnercloud-ec2, elastichosts-lon-p (Peer 1), elastichosts-sat-p (Peer 1), elastichosts-lon-b (BlueSquare), openhosting-east1, serverlove-z1-man, skalicloud-sdg-my diff --git a/allcompute/pom.xml b/allcompute/pom.xml index 465001759a..f1a130039f 100644 --- a/allcompute/pom.xml +++ b/allcompute/pom.xml @@ -114,6 +114,11 @@ bluelock-vcloud-zone01 ${project.version} + + org.jclouds.provider + stratogen-vcloud-mycloud + ${project.version} + org.jclouds.provider gogrid diff --git a/core/src/main/resources/rest.properties b/core/src/main/resources/rest.properties index 910dcf59cc..c4167f6770 100644 --- a/core/src/main/resources/rest.properties +++ b/core/src/main/resources/rest.properties @@ -104,6 +104,9 @@ bluelock-vcloud-vcenterprise.propertiesbuilder=org.jclouds.bluelock.vcloud.vcent bluelock-vcloud-zone01.contextbuilder=org.jclouds.bluelock.vcloud.zone01.BluelockVCloudZone01ContextBuilder bluelock-vcloud-zone01.propertiesbuilder=org.jclouds.bluelock.vcloud.zone01.BluelockVCloudZone01PropertiesBuilder +stratogen-vcloud-mycloud.contextbuilder=org.jclouds.stratogen.vcloud.mycloud.StratoGenVCloudMyCloudContextBuilder +stratogen-vcloud-mycloud.propertiesbuilder=org.jclouds.stratogen.vcloud.mycloud.StratoGenVCloudMyCloudPropertiesBuilder + gogrid.propertiesbuilder=org.jclouds.gogrid.GoGridPropertiesBuilder gogrid.contextbuilder=org.jclouds.gogrid.GoGridContextBuilder diff --git a/providers/pom.xml b/providers/pom.xml index 3b29719485..91ba5d6a15 100644 --- a/providers/pom.xml +++ b/providers/pom.xml @@ -56,6 +56,7 @@ bluelock-vcdirector bluelock-vcloud-vcenterprise bluelock-vcloud-zone01 + stratogen-vcloud-mycloud trmk-ecloud trmk-vcloudexpress elastichosts-lon-p diff --git a/providers/stratogen-vcloud-mycloud/pom.xml b/providers/stratogen-vcloud-mycloud/pom.xml new file mode 100644 index 0000000000..445159ddc9 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/pom.xml @@ -0,0 +1,164 @@ + + + + + 4.0.0 + + org.jclouds + jclouds-project + 1.0-SNAPSHOT + ../../project/pom.xml + + org.jclouds.provider + stratogen-vcloud-mycloud + jclouds StratoGen vCloud MyCloud provider + vCloud implementation targeted to StratoGen vCloud MyCloud + bundle + + + https://mycloud.stratogen.net/api + 1.0 + FIXME_IDENTITY + FIXME_CREDENTIAL + + + + + org.jclouds.api + vcloud + ${project.version} + + + org.jclouds.common + vcloud-common + ${project.version} + test-jar + test + + + org.jclouds.api + vcloud + ${project.version} + test-jar + test + + + org.jclouds + jclouds-core + ${project.version} + test-jar + test + + + org.jclouds + jclouds-compute + ${project.version} + test-jar + test + + + org.jclouds.driver + jclouds-log4j + ${project.version} + test + + + org.jclouds.driver + jclouds-jsch + ${project.version} + test + + + com.jcraft + jsch + test + + + log4j + log4j + 1.2.16 + test + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + + test.stratogen-vcloud-mycloud.endpoint + ${test.stratogen-vcloud-mycloud.endpoint} + + + test.stratogen-vcloud-mycloud.apiversion + ${test.stratogen-vcloud-mycloud.apiversion} + + + test.stratogen-vcloud-mycloud.identity + ${test.stratogen-vcloud-mycloud.identity} + + + test.stratogen-vcloud-mycloud.credential + ${test.stratogen-vcloud-mycloud.credential} + + + + + + + + + + + + + + + org.apache.felix + maven-bundle-plugin + + + ${project.artifactId} + org.jclouds.stratogen.vcloud.mycloud.*;version="${project.version}" + org.jclouds.*;version="${project.version}",* + + + + + + + + diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java new file mode 100644 index 0000000000..e8a9ec9010 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudContextBuilder.java @@ -0,0 +1,51 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud; + +import java.util.List; +import java.util.Properties; + +import org.jclouds.stratogen.vcloud.mycloud.config.StratoGenVCloudMyCloudComputeServiceContextModule; +import org.jclouds.stratogen.vcloud.mycloud.config.StratoGenVCloudMyCloudRestClientModule; +import org.jclouds.vcloud.VCloudContextBuilder; + +import com.google.inject.Module; + +/** + * {@inheritDoc} + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudContextBuilder extends VCloudContextBuilder { + + public StratoGenVCloudMyCloudContextBuilder(Properties props) { + super(props); + } + + @Override + protected void addContextModule(List modules) { + modules.add(new StratoGenVCloudMyCloudComputeServiceContextModule()); + } + + @Override + protected void addClientModule(List modules) { + modules.add(new StratoGenVCloudMyCloudRestClientModule()); + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java new file mode 100644 index 0000000000..692c2d62d4 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudPropertiesBuilder.java @@ -0,0 +1,47 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud; + +import static org.jclouds.Constants.PROPERTY_ENDPOINT; +import static org.jclouds.Constants.PROPERTY_ISO3166_CODES; +import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_NETWORK; + +import java.util.Properties; + +import org.jclouds.vcloud.VCloudPropertiesBuilder; + +/** + * Builds properties used in stratogen VCloud Clients + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudPropertiesBuilder extends VCloudPropertiesBuilder { + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_ISO3166_CODES, "GB"); + properties.setProperty(PROPERTY_ENDPOINT, "https://mycloud.stratogen.net/api"); + properties.setProperty(PROPERTY_VCLOUD_DEFAULT_NETWORK, "Direct Internet"); + return properties; + } + + public StratoGenVCloudMyCloudPropertiesBuilder(Properties properties) { + super(properties); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java new file mode 100644 index 0000000000..286767f073 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderMetadata.java @@ -0,0 +1,116 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; +import org.jclouds.providers.ProviderMetadata; + +/** + * Implementation of {@link org.jclouds.types.ProviderMetadata} for StratoGen VMware hosting + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "stratogen-vcloud-mycloud"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return ProviderMetadata.COMPUTE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "StratoGen VMware hosting"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "User at Organization (user@org)"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Password"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.stratogen.net"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://mycloud.stratogen.net/cloud/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://www.vmware.com/support/pubs/vcd_pubs.html"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getLinkedServices() { + return ImmutableSet.of("stratogen-vcloud-mycloud"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("GB"); + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java new file mode 100644 index 0000000000..e08be2a180 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudComputeServiceContextModule.java @@ -0,0 +1,38 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.config; + +import org.jclouds.compute.options.TemplateOptions; +import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule; +import org.jclouds.vcloud.compute.options.VCloudTemplateOptions; +import org.jclouds.vcloud.domain.network.IpAddressAllocationMode; + +import com.google.inject.Injector; + +/** + * per docs, we are to use pool mode. + * + * @author Adrian Cole + */ +public class StratoGenVCloudMyCloudComputeServiceContextModule extends VCloudComputeServiceContextModule { + @Override + protected TemplateOptions provideTemplateOptions(Injector injector, TemplateOptions options) { + return options.as(VCloudTemplateOptions.class).ipAddressAllocationMode(IpAddressAllocationMode.POOL); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java new file mode 100644 index 0000000000..0572b42022 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/java/org/jclouds/stratogen/vcloud/mycloud/config/StratoGenVCloudMyCloudRestClientModule.java @@ -0,0 +1,34 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.config; + +import org.jclouds.http.RequiresHttp; +import org.jclouds.rest.ConfiguresRestClient; +import org.jclouds.vcloud.config.VCloudRestClientModule; + +/** + * Configures the VCloud authentication service connection, including logging and http transport. + * + * @author Adrian Cole + */ +@RequiresHttp +@ConfiguresRestClient +public class StratoGenVCloudMyCloudRestClientModule extends VCloudRestClientModule { + +} diff --git a/providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..63dd94140e --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.stratogen.vcloud.mycloud.StratoGenVCloudMyCloudProviderMetadata diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java new file mode 100644 index 0000000000..4503b9b080 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/DeprecatedStratoGenVCloudMyCloudClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud; + +import org.jclouds.vcloud.DeprecatedVCloudClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Deprecated +@Test(groups = "live", singleThreaded = true, testName = "DeprecatedStratoGenVCloudMyCloudClientLiveTest") +public class DeprecatedStratoGenVCloudMyCloudClientLiveTest extends DeprecatedVCloudClientLiveTest { + public DeprecatedStratoGenVCloudMyCloudClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java new file mode 100644 index 0000000000..477d09eb4d --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/StratoGenVCloudMyCloudProviderTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "unit", testName = "StratoGenVCloudMyCloudProviderTest") +public class StratoGenVCloudMyCloudProviderTest extends BaseProviderMetadataTest { + + public StratoGenVCloudMyCloudProviderTest() { + super(new StratoGenVCloudMyCloudProviderMetadata(), ProviderMetadata.COMPUTE_TYPE); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java new file mode 100644 index 0000000000..16ad0f7f92 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java @@ -0,0 +1,70 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import org.jclouds.compute.domain.Image; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.Template; +import org.jclouds.compute.domain.TemplateBuilder; +import org.jclouds.compute.predicates.OperatingSystemPredicates; +import org.jclouds.vcloud.compute.VCloudComputeServiceLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudComputeServiceLiveTest") +public class StratoGenVCloudMyCloudComputeServiceLiveTest extends VCloudComputeServiceLiveTest { + public StratoGenVCloudMyCloudComputeServiceLiveTest() { + provider = "stratogen-vcloud-mycloud"; + // vcloud requires instantiate before deploy, which takes longer than 30 seconds + nonBlockDurationSeconds = 300; + } + + @Override + public void setServiceDefaults() { + group = "director"; + } + + @Test + public void testTemplateBuilder() { + Template defaultTemplate = client.templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assert OperatingSystemPredicates.supportsApt().apply(defaultTemplate.getImage().getOperatingSystem()); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getDescription(), "Ubuntu Linux (64-bit)"); + assert defaultTemplate.getLocation().getId() != null : defaultTemplate.getLocation(); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + System.out.println(defaultTemplate.getHardware()); + } + + @Override + protected Template buildTemplate(TemplateBuilder templateBuilder) { + Template template = super.buildTemplate(templateBuilder); + Image image = template.getImage(); + assert image.getDefaultCredentials().credential != null : image; + return template; + } + +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java new file mode 100644 index 0000000000..361ec1113e --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudTemplateBuilderLiveTest.java @@ -0,0 +1,77 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.compute; + +import static org.jclouds.compute.util.ComputeServiceUtils.getCores; +import static org.testng.Assert.assertEquals; + +import java.io.IOException; +import java.util.Set; + +import org.jclouds.compute.BaseTemplateBuilderLiveTest; +import org.jclouds.compute.domain.OsFamily; +import org.jclouds.compute.domain.OsFamilyVersion64Bit; +import org.jclouds.compute.domain.Template; +import org.testng.annotations.Test; + +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableSet; + +/** + * + * @author Adrian Cole + */ +@Test(groups = "live", testName = "StratoGenVCloudMyCloudTemplateBuilderLiveTest") +public class StratoGenVCloudMyCloudTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { + + public StratoGenVCloudMyCloudTemplateBuilderLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } + + @Override + protected Predicate defineUnsupportedOperatingSystems() { + return new Predicate() { + + @Override + public boolean apply(OsFamilyVersion64Bit input) { + switch (input.family) { + case UBUNTU: + return !input.version.equals("") || !input.is64Bit; + default: + return true; + } + } + + }; + } + + @Override + public void testDefaultTemplateBuilder() throws IOException { + Template defaultTemplate = context.getComputeService().templateBuilder().build(); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), ""); + assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); + } + + @Override + protected Set getIso3166Codes() { + return ImmutableSet. of("GB"); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java new file mode 100644 index 0000000000..42b7b04017 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudCatalogClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.CatalogClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudCatalogClientLiveTest") +public class StratoGenVCloudMyCloudCatalogClientLiveTest extends CatalogClientLiveTest { + + public StratoGenVCloudMyCloudCatalogClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java new file mode 100644 index 0000000000..a74a0efa2f --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudNetworkClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.NetworkClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudNetworkClientLiveTest") +public class StratoGenVCloudMyCloudNetworkClientLiveTest extends NetworkClientLiveTest { + + public StratoGenVCloudMyCloudNetworkClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java new file mode 100644 index 0000000000..e000259167 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudOrgClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.OrgClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudOrgClientLiveTest") +public class StratoGenVCloudMyCloudOrgClientLiveTest extends OrgClientLiveTest { + + public StratoGenVCloudMyCloudOrgClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java new file mode 100644 index 0000000000..e6b54053c2 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudTaskClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.TaskClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudTaskClientLiveTest") +public class StratoGenVCloudMyCloudTaskClientLiveTest extends TaskClientLiveTest { + + public StratoGenVCloudMyCloudTaskClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java new file mode 100644 index 0000000000..58eb39ec8a --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VAppClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVAppClientLiveTest") +public class StratoGenVCloudMyCloudVAppClientLiveTest extends VAppClientLiveTest { + + public StratoGenVCloudMyCloudVAppClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java new file mode 100644 index 0000000000..f3c36da6f9 --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVAppTemplateClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VAppTemplateClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVAppTemplateClientLiveTest") +public class StratoGenVCloudMyCloudVAppTemplateClientLiveTest extends VAppTemplateClientLiveTest { + + public StratoGenVCloudMyCloudVAppTemplateClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java new file mode 100644 index 0000000000..8ee2715b3c --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVDCClientLiveTest.java @@ -0,0 +1,35 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VDCClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVDCClientLiveTest") +public class StratoGenVCloudMyCloudVDCClientLiveTest extends VDCClientLiveTest { + + public StratoGenVCloudMyCloudVDCClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java new file mode 100644 index 0000000000..9a7319374f --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/features/StratoGenVCloudMyCloudVmClientLiveTest.java @@ -0,0 +1,39 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.stratogen.vcloud.mycloud.features; + +import org.jclouds.vcloud.features.VmClientLiveTest; +import org.testng.annotations.Test; + +/** + * + * + * @author Adrian Cole + */ +@Test(groups = "live", enabled = true, singleThreaded = true, testName = "StratoGenVCloudMyCloudVmClientLiveTest") +public class StratoGenVCloudMyCloudVmClientLiveTest extends VmClientLiveTest { + + public StratoGenVCloudMyCloudVmClientLiveTest() { + provider = "stratogen-vcloud-mycloud"; + } + + protected void checkApiOutput(String apiOutput) { + checkApiOutput1_0_1(apiOutput); + } +} diff --git a/providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml b/providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml new file mode 100644 index 0000000000..c1e74e57ff --- /dev/null +++ b/providers/stratogen-vcloud-mycloud/src/test/resources/log4j.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4b761c790a3fcabbac16fd94356e3f34a79d0375 Mon Sep 17 00:00:00 2001 From: Mattias Holmqvist Date: Thu, 2 Jun 2011 12:08:00 +0200 Subject: [PATCH 29/40] Renamed Predicate protocol to Coercions --- compute/src/main/clojure/org/jclouds/predicate.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compute/src/main/clojure/org/jclouds/predicate.clj b/compute/src/main/clojure/org/jclouds/predicate.clj index 1a35f88ae4..ae295e5618 100644 --- a/compute/src/main/clojure/org/jclouds/predicate.clj +++ b/compute/src/main/clojure/org/jclouds/predicate.clj @@ -18,11 +18,12 @@ ; (ns org.jclouds.predicate) -(defprotocol Predicate - "Protocol for making a com.google.common.base.Predicate." +(defprotocol Coercions + "Protocol for coercing between predicate-like things, like + Clojure fns and com.google.common.base.Predicate." (to-predicate [p])) -(extend-protocol Predicate +(extend-protocol Coercions clojure.lang.IFn (to-predicate [p] (reify com.google.common.base.Predicate From e49e0254ce0f405ca2af0d07f795f14acb00e091 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 11:08:58 -0700 Subject: [PATCH 30/40] Issue 591:Need to handle 2+ cookies from TE --- .../ParseLoginResponseFromHeaders.java | 61 ++++++++++-------- .../ParseLoginResponseFromHeadersTest.java | 63 +++++++++++++++---- 2 files changed, 86 insertions(+), 38 deletions(-) diff --git a/common/vcloud/src/main/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeaders.java b/common/vcloud/src/main/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeaders.java index 4453929364..6c71e10d4e 100755 --- a/common/vcloud/src/main/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeaders.java +++ b/common/vcloud/src/main/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeaders.java @@ -18,10 +18,10 @@ */ package org.jclouds.vcloud.functions; -import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.http.HttpUtils.releasePayload; import java.util.Map; +import java.util.NoSuchElementException; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -41,6 +41,8 @@ import org.jclouds.vcloud.endpoints.Org; import org.jclouds.vcloud.xml.OrgListHandler; import com.google.common.base.Function; +import com.google.common.base.Predicates; +import com.google.common.collect.Iterables; /** * This parses {@link VCloudSession} from HTTP headers. @@ -49,7 +51,7 @@ import com.google.common.base.Function; */ @Singleton public class ParseLoginResponseFromHeaders implements Function { - static final Pattern pattern = Pattern.compile("(vcloud-token=)?([^;]+)(;.*)?"); + static final Pattern pattern = Pattern.compile("(vcloud-token)=?([^;]+)(;.*)?"); private final ParseSax.Factory factory; private final Provider orgHandlerProvider; @@ -61,38 +63,45 @@ public class ParseLoginResponseFromHeaders implements Function org = factory.create(orgHandlerProvider.get()).parse( + final String token = parseTokenFromHeaders(from); + final Map org = factory.create(orgHandlerProvider.get()).parse( from.getPayload().getInput()); - return new VCloudSession() { - @VCloudToken - public String getVCloudToken() { - return matcher.group(2); - } + return new VCloudSession() { + @VCloudToken + public String getVCloudToken() { + return token; + } - @Org - public Map getOrgs() { - return org; - } - }; - - } + @Org + public Map getOrgs() { + return org; + } + }; } finally { releasePayload(from); } - throw new HttpResponseException("x-vcloud-authorization not found ", null, from); + } + + public String parseTokenFromHeaders(HttpResponse from) { + String cookieHeader = from.getFirstHeaderOrNull("x-vcloud-authorization"); + if (cookieHeader != null) { + Matcher matcher = pattern.matcher(cookieHeader); + return matcher.find() ? matcher.group(2) : cookieHeader; + } else { + try { + cookieHeader = Iterables.find(from.getHeaders().get(HttpHeaders.SET_COOKIE), Predicates.contains(pattern)); + Matcher matcher = pattern.matcher(cookieHeader); + matcher.find(); + return matcher.group(2); + } catch (NoSuchElementException e) { + throw new HttpResponseException(String.format("Header %s or %s must be present", "x-vcloud-authorization", + HttpHeaders.SET_COOKIE), null, from); + } + } } } diff --git a/common/vcloud/src/test/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeadersTest.java b/common/vcloud/src/test/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeadersTest.java index d4945d37f0..fdfeadc1ea 100644 --- a/common/vcloud/src/test/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeadersTest.java +++ b/common/vcloud/src/test/java/org/jclouds/vcloud/functions/ParseLoginResponseFromHeadersTest.java @@ -23,6 +23,7 @@ import static org.testng.Assert.assertEquals; import java.net.URI; import org.jclouds.http.HttpResponse; +import org.jclouds.http.HttpResponseException; import org.jclouds.http.functions.BaseHandlerTest; import org.jclouds.io.Payloads; import org.jclouds.vcloud.VCloudMediaType; @@ -54,60 +55,98 @@ public class ParseLoginResponseFromHeadersTest extends BaseHandlerTest { @Test public void testApply() { HttpResponse response = new HttpResponse(200, "OK", Payloads.newInputStreamPayload(getClass() - .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("x-vcloud-authorization", - "vcloud-token=9er4d061-4bff-48fa-84b1-5da7166764d2; path=/")); + .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("x-vcloud-authorization", + "vcloud-token=9er4d061-4bff-48fa-84b1-5da7166764d2; path=/")); response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8"); response.getPayload().getContentMetadata().setContentLength(307l); VCloudSession reply = parser.apply(response); assertEquals(reply.getVCloudToken(), "9er4d061-4bff-48fa-84b1-5da7166764d2"); assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org", - VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); + VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); } @Test public void testApplyBlueLock() { HttpResponse response = new HttpResponse(200, "OK", Payloads.newInputStreamPayload(getClass() - .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("x-vcloud-authorization", - "MUKOJ2HoAfoMmLnHRp4esNb2MtWscCLLhVysnsIsCG0=")); + .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("x-vcloud-authorization", + "MUKOJ2HoAfoMmLnHRp4esNb2MtWscCLLhVysnsIsCG0=")); response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8"); response.getPayload().getContentMetadata().setContentLength(307l); VCloudSession reply = parser.apply(response); assertEquals(reply.getVCloudToken(), "MUKOJ2HoAfoMmLnHRp4esNb2MtWscCLLhVysnsIsCG0="); assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org", - VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); + VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); } @Test public void testApplyTerremark() { HttpResponse response = new HttpResponse(200, "OK", Payloads.newInputStreamPayload(getClass() - .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("Set-Cookie", - "vcloud-token=37ce2715-9aba-4f48-8e45-2db8a8da702d; path=/")); + .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("Set-Cookie", + "vcloud-token=37ce2715-9aba-4f48-8e45-2db8a8da702d; path=/")); response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8"); response.getPayload().getContentMetadata().setContentLength(307l); VCloudSession reply = parser.apply(response); assertEquals(reply.getVCloudToken(), "37ce2715-9aba-4f48-8e45-2db8a8da702d"); assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org", - VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); + VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); } + @Test + public void testApplyTerremarkMultipleCookies() { + HttpResponse response = new HttpResponse(200, "OK", Payloads.newInputStreamPayload(getClass() + .getResourceAsStream("/orglist.xml")), ImmutableMultimap. builder().put("Set-Cookie", + "NSC_ESUO_21654_72.46.239.132_443=fooo;expires=Thu, 02-Jun-2011 17:19:26 GMT;path=/;secure;httponly") + .put("Set-Cookie", "vcloud-token=37ce2715-9aba-4f48-8e45-2db8a8da702d; path=/").build()); + response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8"); + response.getPayload().getContentMetadata().setContentLength(307l); + + VCloudSession reply = parser.apply(response); + assertEquals(reply.getVCloudToken(), "37ce2715-9aba-4f48-8e45-2db8a8da702d"); + assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org", + VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); + + } + + @Test(expectedExceptions = HttpResponseException.class) + public void testUnmatchedCookieThrowsHttpResponseException() { + HttpResponse response = new HttpResponse(200, "OK", Payloads.newInputStreamPayload(getClass() + .getResourceAsStream("/orglist.xml")), ImmutableMultimap. builder().put("Set-Cookie", + "NSC_ESUO_21654_72.46.239.132_443=fooo;expires=Thu, 02-Jun-2011 17:19:26 GMT;path=/;secure;httponly") + .build()); + response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8"); + response.getPayload().getContentMetadata().setContentLength(307l); + + parser.apply(response); + } + + @Test(expectedExceptions = HttpResponseException.class) + public void testNoThrowsHttpResponseException() { + HttpResponse response = new HttpResponse(200, "OK", Payloads.newInputStreamPayload(getClass() + .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of()); + response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8"); + response.getPayload().getContentMetadata().setContentLength(307l); + + parser.apply(response); + } + @Test public void testApplyVirtacore() { HttpResponse response = new HttpResponse(200, "OK", Payloads.newInputStreamPayload(getClass() - .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("x-vcloud-authorization", - "vcloud-token=IPy0w7UGD4lwtdWAK/ZVzfuLK+dztxGRqsOhWqV0i48=")); + .getResourceAsStream("/orglist.xml")), ImmutableMultimap. of("x-vcloud-authorization", + "vcloud-token=IPy0w7UGD4lwtdWAK/ZVzfuLK+dztxGRqsOhWqV0i48=")); response.getPayload().getContentMetadata().setContentType("Content-Type: application/xml; charset=utf-8"); response.getPayload().getContentMetadata().setContentLength(307l); VCloudSession reply = parser.apply(response); assertEquals(reply.getVCloudToken(), "IPy0w7UGD4lwtdWAK/ZVzfuLK+dztxGRqsOhWqV0i48="); assertEquals(reply.getOrgs(), ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org", - VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); + VCloudMediaType.ORG_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48")))); } } From 34bbfa3797d68e83bec5962c86cc70f2fe8f9b4f Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 12:59:57 -0700 Subject: [PATCH 31/40] more detail on test failures in elasticstack --- .../org/jclouds/elasticstack/ElasticStackClientLiveTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java index 05993b1d4e..b6085157e0 100644 --- a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java +++ b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java @@ -159,8 +159,8 @@ public class ElasticStackClientLiveTest { @Test public void testGetDrive() throws Exception { for (String driveUUID : client.listDrives()) { - assert !"".equals(driveUUID); - assertNotNull(client.getDriveInfo(driveUUID)); + assert !"".equals(driveUUID) : driveUUID; + assert client.getDriveInfo(driveUUID) != null : driveUUID; } } From 11884540a65d9cccb36f9799a7a3d7f01296312a Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 13:00:18 -0700 Subject: [PATCH 32/40] test size comparison when testing templates --- .../compute/BaseTemplateBuilderLiveTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java index cc30beefcd..5ae857f58a 100644 --- a/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java @@ -33,6 +33,7 @@ import java.util.concurrent.TimeoutException; import org.jclouds.Constants; import org.jclouds.compute.config.BaseComputeServiceContextModule; +import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; @@ -77,6 +78,29 @@ public abstract class BaseTemplateBuilderLiveTest { apiversion = System.getProperty("test." + provider + ".apiversion"); } + public void testCompareSizes() throws Exception { + Hardware defaultSize = context.getComputeService().templateBuilder().build().getHardware(); + + Hardware smallest = context.getComputeService().templateBuilder().smallest().build().getHardware(); + Hardware fastest = context.getComputeService().templateBuilder().fastest().build().getHardware(); + Hardware biggest = context.getComputeService().templateBuilder().biggest().build().getHardware(); + + System.out.printf("smallest %s%n", smallest); + System.out.printf("fastest %s%n", fastest); + System.out.printf("biggest %s%n", biggest); + + assertEquals(defaultSize, smallest); + + assert getCores(smallest) <= getCores(fastest) : String.format("%s ! <= %s", smallest, fastest); + assert getCores(biggest) <= getCores(fastest) : String.format("%s ! <= %s", biggest, fastest); + + assert biggest.getRam() >= fastest.getRam() : String.format("%s ! >= %s", biggest, fastest); + assert biggest.getRam() >= smallest.getRam() : String.format("%s ! >= %s", biggest, smallest); + + assert getCores(fastest) >= getCores(biggest) : String.format("%s ! >= %s", fastest, biggest); + assert getCores(fastest) >= getCores(smallest) : String.format("%s ! >= %s", fastest, smallest); + } + protected Properties setupProperties() { Properties overrides = new Properties(); overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true"); From 2360bd1afdb78148c7f05eaef667db8443de9a34 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 13:19:39 -0700 Subject: [PATCH 33/40] bumped aws-ec2 to 11.04 ubuntu --- .../jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java index ed15d0962a..57126d25fe 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java @@ -84,7 +84,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { .osVersionMatches("1[10].[10][04]").imageDescriptionMatches("ubuntu-images").osFamily(OsFamily.UBUNTU).build(); assert (template.getImage().getProviderId().startsWith("ami-")) : template; - assertEquals(template.getImage().getOperatingSystem().getVersion(), "10.10"); + assertEquals(template.getImage().getOperatingSystem().getVersion(), "11.04"); assertEquals(template.getImage().getOperatingSystem().is64Bit(), false); assertEquals(template.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); assertEquals(template.getImage().getUserMetadata().get("rootDeviceType"), "instance-store"); From a0692e737ff9c83ecdfb38149b55b3b55b61a572 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 13:20:17 -0700 Subject: [PATCH 34/40] refactored so that eucalyptus m1.small can use 64 bit image --- .../ec2/compute/domain/EC2HardwareBuilder.java | 14 ++++++++++++-- .../ec2/compute/suppliers/EC2HardwareSupplier.java | 3 +-- .../ec2/compute/EC2TemplateBuilderTest.java | 4 ++-- .../RunningInstanceToNodeMetadataTest.java | 10 +++++----- ...urityGroupsAsNeededAndReturnRunOptionsTest.java | 4 ++-- .../compute/suppliers/AWSEC2HardwareSupplier.java | 4 ++-- ...urityGroupsAsNeededAndReturnRunOptionsTest.java | 6 +++--- ...tnerCloudEucalyptusTemplateBuilderLiveTest.java | 11 ++++++++--- 8 files changed, 35 insertions(+), 21 deletions(-) diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java index 53cbe925d8..2e10e9f7cc 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java @@ -209,13 +209,23 @@ public class EC2HardwareBuilder extends HardwareBuilder { /** * @see InstanceType#M1_SMALL */ - public static EC2HardwareBuilder m1_small() { + public static EC2HardwareBuilder m1_small32() { return new EC2HardwareBuilder(InstanceType.M1_SMALL).ram(1740).processors( ImmutableList.of(new Processor(1.0, 1.0))).volumes( ImmutableList. of(new VolumeImpl(10.0f, "/dev/sda1", true, false), new VolumeImpl(150.0f, "/dev/sda2", false, false))).is64Bit(false); } - + + /** + * @see InstanceType#M1_SMALL + */ + public static EC2HardwareBuilder m1_small() { + return new EC2HardwareBuilder(InstanceType.M1_SMALL).ram(1740).processors( + ImmutableList.of(new Processor(1.0, 1.0))).volumes( + ImmutableList. of(new VolumeImpl(10.0f, "/dev/sda1", true, false), new VolumeImpl(150.0f, + "/dev/sda2", false, false))); + } + /** * @see InstanceType#T1_MICRO */ diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/suppliers/EC2HardwareSupplier.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/suppliers/EC2HardwareSupplier.java index ee0185d107..bcc5d09fa2 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/suppliers/EC2HardwareSupplier.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/suppliers/EC2HardwareSupplier.java @@ -18,7 +18,6 @@ */ package org.jclouds.ec2.compute.suppliers; -import static org.jclouds.compute.predicates.ImagePredicates.any; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_medium; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_large; @@ -43,7 +42,7 @@ public class EC2HardwareSupplier implements Supplier> { @Override public Set get() { - return ImmutableSet. of(m1_small().supportsImage(any()).build(), c1_medium().build(), c1_xlarge() + return ImmutableSet. of(m1_small().build(), c1_medium().build(), c1_xlarge() .build(), m1_large().build(), m1_xlarge().build()); } } diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2TemplateBuilderTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2TemplateBuilderTest.java index 92d0e9191f..d4bb385fc9 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2TemplateBuilderTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/EC2TemplateBuilderTest.java @@ -26,7 +26,7 @@ import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_medium; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cc1_4xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_large; -import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_small; +import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_small32; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m2_2xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m2_4xlarge; @@ -161,7 +161,7 @@ public class EC2TemplateBuilderTest { .build())); Supplier> sizes = Suppliers.> ofInstance(ImmutableSet . of(t1_micro().build(), c1_medium().build(), c1_xlarge().build(), m1_large().build(), - m1_small().build(), m1_xlarge().build(), m2_xlarge().build(), m2_2xlarge().build(), + m1_small32().build(), m1_xlarge().build(), m2_xlarge().build(), m2_2xlarge().build(), m2_4xlarge().build(), CC1_4XLARGE)); return new TemplateBuilderImpl(locations, images, sizes, Suppliers.ofInstance(location), optionsProvider, diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java index 4eaca6bf6b..16683b37b8 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java @@ -18,7 +18,7 @@ */ package org.jclouds.ec2.compute.functions; -import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_small; +import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_small32; import static org.testng.Assert.assertEquals; import java.net.UnknownHostException; @@ -129,7 +129,7 @@ public class RunningInstanceToNodeMetadataTest { @Test public void testApplyWhereTagDoesntMatchAndImageHardwareAndLocationFound() throws UnknownHostException { - RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.of(m1_small().build()), ImmutableSet + RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.of(m1_small32().build()), ImmutableSet .of(provider), EC2ImageParserTest.convertImages("/amzn_images.xml"), ImmutableMap . of()); @@ -137,7 +137,7 @@ public class RunningInstanceToNodeMetadataTest { assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.RUNNING).privateAddresses( ImmutableSet.of("10.243.42.70")).publicAddresses(ImmutableSet.of("174.129.81.68")).imageId( - "us-east-1/ami-82e4b5c7").hardware(m1_small().build()).operatingSystem( + "us-east-1/ami-82e4b5c7").hardware(m1_small32().build()).operatingSystem( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).version("").arch("paravirtual").description( "137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()).id("us-east-1/i-0799056f") .providerId("i-0799056f").location(provider).build()); @@ -158,7 +158,7 @@ public class RunningInstanceToNodeMetadataTest { }; Map instanceToImage = new MapMaker().makeComputingMap(nullReturningFunction); - RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.of(m1_small().build()), ImmutableSet + RunningInstanceToNodeMetadata parser = createNodeParser(ImmutableSet.of(m1_small32().build()), ImmutableSet .of(provider), ImmutableMap. of(), EC2ComputeServiceDependenciesModule.instanceToNodeState, instanceToImage); @@ -167,7 +167,7 @@ public class RunningInstanceToNodeMetadataTest { assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.RUNNING).privateAddresses( ImmutableSet.of("10.243.42.70")).publicAddresses(ImmutableSet.of("174.129.81.68")).imageId( "us-east-1/ami-82e4b5c7").id("us-east-1/i-0799056f").providerId("i-0799056f").hardware( - m1_small().build()).location(provider).build()); + m1_small32().build()).location(provider).build()); } protected RunningInstance firstInstanceFromResource(String resource) { diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/strategy/CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/strategy/CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java index 3cacd017a0..f54b6cca71 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/strategy/CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/strategy/CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java @@ -69,7 +69,7 @@ public class CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptionsTest { // setup constants String region = Region.AP_SOUTHEAST_1; String tag = "tag"; - Hardware size = EC2HardwareBuilder.m1_small().build(); + Hardware size = EC2HardwareBuilder.m1_small32().build(); String systemGeneratedKeyPairName = "systemGeneratedKeyPair"; String generatedGroup = "group"; Set generatedGroups = ImmutableSet.of(generatedGroup); @@ -124,7 +124,7 @@ public class CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptionsTest { // setup constants String region = Region.AP_SOUTHEAST_1; String tag = "tag"; - Hardware size = EC2HardwareBuilder.m1_small().build(); + Hardware size = EC2HardwareBuilder.m1_small32().build(); String systemGeneratedKeyPairName = "systemGeneratedKeyPair"; String generatedGroup = "group"; Set generatedGroups = ImmutableSet.of(generatedGroup); diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java index c51c9897da..e16ff71084 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java @@ -24,7 +24,7 @@ import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_medium; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cc1_4xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_large; -import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_small; +import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_small32; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m2_2xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m2_4xlarge; @@ -82,7 +82,7 @@ public class AWSEC2HardwareSupplier extends EC2HardwareSupplier { sizes.add(cc1_4xlarge().location(location).supportsImageIds(ccAmi).build()); } sizes.addAll(ImmutableSet. of(t1_micro().build(), c1_medium().build(), c1_xlarge().build(), m1_large() - .build(), m1_small().build(), m1_xlarge().build(), m2_xlarge().build(), m2_2xlarge().build(), + .build(), m1_small32().build(), m1_xlarge().build(), m2_xlarge().build(), m2_2xlarge().build(), m2_4xlarge().build())); return sizes.build(); } diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java index f61a77b8ef..b5388a6c71 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptionsTest.java @@ -73,7 +73,7 @@ public class CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptionsT // setup constants String region = Region.AP_SOUTHEAST_1; String group = "group"; - Hardware size = EC2HardwareBuilder.m1_small().build(); + Hardware size = EC2HardwareBuilder.m1_small32().build(); String systemGeneratedKeyPairName = "systemGeneratedKeyPair"; String generatedGroup = "group"; Set generatedGroups = ImmutableSet.of(generatedGroup); @@ -262,7 +262,7 @@ public class CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptionsT // setup constants String region = Region.AP_SOUTHEAST_1; String group = "group"; - Hardware size = EC2HardwareBuilder.m1_small().build(); + Hardware size = EC2HardwareBuilder.m1_small32().build(); String systemGeneratedKeyPairName = "systemGeneratedKeyPair"; // create mocks @@ -320,7 +320,7 @@ public class CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptionsT // setup constants String region = Region.AP_SOUTHEAST_1; String group = "group"; - Hardware size = EC2HardwareBuilder.m1_small().build(); + Hardware size = EC2HardwareBuilder.m1_small32().build(); String systemGeneratedKeyPairName = "systemGeneratedKeyPair"; String generatedGroup = "group"; Set generatedGroups = ImmutableSet.of(generatedGroup); diff --git a/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/EucalyptusPartnerCloudEucalyptusTemplateBuilderLiveTest.java b/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/EucalyptusPartnerCloudEucalyptusTemplateBuilderLiveTest.java index 03193f81d4..bdd38a5d46 100644 --- a/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/EucalyptusPartnerCloudEucalyptusTemplateBuilderLiveTest.java +++ b/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/EucalyptusPartnerCloudEucalyptusTemplateBuilderLiveTest.java @@ -24,10 +24,13 @@ import static org.testng.Assert.assertEquals; import java.io.IOException; import java.util.Set; +import org.jclouds.aws.util.AWSUtils; import org.jclouds.compute.BaseTemplateBuilderLiveTest; import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.OsFamilyVersion64Bit; import org.jclouds.compute.domain.Template; +import org.jclouds.domain.LocationScope; +import org.jclouds.ec2.compute.util.EC2ComputeUtils; import org.testng.annotations.Test; import com.google.common.base.Predicate; @@ -68,16 +71,18 @@ public class EucalyptusPartnerCloudEucalyptusTemplateBuilderLiveTest extends Bas @Test public void testDefaultTemplateBuilder() throws IOException { - Template defaultTemplate = context.getComputeService().templateBuilder().build(); assert (defaultTemplate.getImage().getProviderId().startsWith("emi-")) : defaultTemplate; assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "10.04"); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); assertEquals(defaultTemplate.getImage().getUserMetadata().get("rootDeviceType"), "instance-store"); + assertEquals(defaultTemplate.getHardware().getId(), "m1.small"); assertEquals(defaultTemplate.getLocation().getId(), "kvm-cluster"); - assertEquals(getCores(defaultTemplate.getHardware()), 2.0d); - + assertEquals(defaultTemplate.getLocation().getScope(), LocationScope.ZONE); + assertEquals(AWSUtils.getRegionFromLocationOrNull(defaultTemplate.getLocation()), "Eucalyptus"); + assertEquals(EC2ComputeUtils.getZoneFromLocationOrNull(defaultTemplate.getLocation()), "kvm-cluster"); + assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); } @Override From ac56adc2e169f038eb9302a011c34e51f0d96015 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 13:47:57 -0700 Subject: [PATCH 35/40] Issue 592:templateBuilder.fromTemplate loses location when more narrow than region --- .../org/jclouds/ec2/compute/options/EC2TemplateOptions.java | 2 +- .../compute/domain/internal/TemplateBuilderImpl.java | 1 + .../org/jclouds/compute/BaseTemplateBuilderLiveTest.java | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java index 5f63ffbd10..1c44f71c93 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java @@ -509,6 +509,6 @@ public class EC2TemplateOptions extends TemplateOptions implements Cloneable { @Override public String toString() { return "[groupIds=" + groupIds + ", keyPair=" + keyPair + ", noKeyPair=" + noKeyPair + ", userData=" - + Arrays.toString(userData) + ", blockDeviceMappings=" + blockDeviceMappings + "]"; + + Arrays.toString(userData) + ", blockDeviceMappings=" + blockDeviceMappings.build() + "]"; } } diff --git a/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java b/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java index c03791bbd0..4c9c44949a 100644 --- a/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java +++ b/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java @@ -416,6 +416,7 @@ public class TemplateBuilderImpl implements TemplateBuilder { */ @Override public TemplateBuilder fromTemplate(Template template) { + location = template.getLocation(); fromHardware(template.getHardware()); fromImage(template.getImage()); options(template.getOptions()); diff --git a/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java index 5ae857f58a..75d9800e4e 100644 --- a/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseTemplateBuilderLiveTest.java @@ -101,6 +101,12 @@ public abstract class BaseTemplateBuilderLiveTest { assert getCores(fastest) >= getCores(smallest) : String.format("%s ! >= %s", fastest, smallest); } + public void testFromTemplate() { + Template defaultTemplate = context.getComputeService().templateBuilder().build(); + assertEquals(context.getComputeService().templateBuilder().fromTemplate(defaultTemplate).build().toString(), + defaultTemplate.toString()); + } + protected Properties setupProperties() { Properties overrides = new Properties(); overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true"); From a68640351f7cfb9c2bbd5cf509586b7d52bf2c72 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 13:51:49 -0700 Subject: [PATCH 36/40] better error when last-modified header not found --- .../functions/ParseSystemAndUserMetadataFromHeaders.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blobstore/src/main/java/org/jclouds/blobstore/functions/ParseSystemAndUserMetadataFromHeaders.java b/blobstore/src/main/java/org/jclouds/blobstore/functions/ParseSystemAndUserMetadataFromHeaders.java index 69c0f743d0..160881a2f9 100755 --- a/blobstore/src/main/java/org/jclouds/blobstore/functions/ParseSystemAndUserMetadataFromHeaders.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/functions/ParseSystemAndUserMetadataFromHeaders.java @@ -94,8 +94,7 @@ public class ParseSystemAndUserMetadataFromHeaders implements Function Date: Thu, 2 Jun 2011 16:34:37 -0600 Subject: [PATCH 37/40] Issue 550: Added ProviderMetadata for Eucalyptus Partner Cloud S3. [in providers/eucalyptus-partnercloud-s3/src] * main/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderMetadata.java, main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata, test/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderTest.java: Added. --- ...alyptusPartnerCloudS3ProviderMetadata.java | 108 ++++++++++++++++++ .../org.jclouds.providers.ProviderMetadata | 1 + .../EucalyptusPartnerCloudS3ProviderTest.java | 37 ++++++ 3 files changed, 146 insertions(+) create mode 100644 providers/eucalyptus-partnercloud-s3/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderMetadata.java create mode 100644 providers/eucalyptus-partnercloud-s3/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/eucalyptus-partnercloud-s3/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderTest.java diff --git a/providers/eucalyptus-partnercloud-s3/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderMetadata.java b/providers/eucalyptus-partnercloud-s3/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderMetadata.java new file mode 100644 index 0000000000..0c1d6d2d38 --- /dev/null +++ b/providers/eucalyptus-partnercloud-s3/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderMetadata.java @@ -0,0 +1,108 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.epc; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; + +/** + * Implementation of {@ link org.jclouds.types.ProviderMetadata} for Eucalpytus' + * Partner Cloud S3 provider. + * + * @author Jeremy Whitlock + */ +public class EucalyptusPartnerCloudS3ProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "eucalyptus-partnercloud-s3"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return BLOBSTORE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "Eucalyptus Partner Cloud (S3)"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "Username"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Password"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.eucalyptus.com/partners"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://partnercloud.eucalyptus.com:8443"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://open.eucalyptus.com/wiki/IntroducingEucalyptus_v2.0"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US-CA"); + } + +} diff --git a/providers/eucalyptus-partnercloud-s3/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/eucalyptus-partnercloud-s3/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..55e706a690 --- /dev/null +++ b/providers/eucalyptus-partnercloud-s3/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.epc.EucalyptusPartnerCloudS3ProviderMetadata diff --git a/providers/eucalyptus-partnercloud-s3/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderTest.java b/providers/eucalyptus-partnercloud-s3/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderTest.java new file mode 100644 index 0000000000..027cead9ce --- /dev/null +++ b/providers/eucalyptus-partnercloud-s3/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudS3ProviderTest.java @@ -0,0 +1,37 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.epc; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * The EucalyptusPartnerCloudS3ProviderTest tests the {@link EucalyptusPartnerCloudS3ProviderMetadata} class. + * + * @author Jeremy Whitlock + */ +@Test(groups = "unit", testName = "EucalyptusPartnerCloudS3ProviderTest") +public class EucalyptusPartnerCloudS3ProviderTest extends BaseProviderMetadataTest { + + public EucalyptusPartnerCloudS3ProviderTest() { + super(new EucalyptusPartnerCloudS3ProviderMetadata(), ProviderMetadata.BLOBSTORE_TYPE); + } + +} \ No newline at end of file From 8a8daaa372f7cc2dc17f034171d3e6f70ea67e27 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 15:45:45 -0700 Subject: [PATCH 38/40] revised rimu tests --- .../rimuhosting/miro/RimuHostingPropertiesBuilder.java | 2 ++ .../miro/compute/RimuHostingComputeServiceLiveTest.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java b/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java index e8e9a5c0ac..cdea040357 100644 --- a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java +++ b/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java @@ -31,6 +31,7 @@ import static org.jclouds.rimuhosting.miro.reference.RimuHostingConstants.PROPER import java.util.Properties; import org.jclouds.PropertiesBuilder; +import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.concurrent.Timeout; /** @@ -55,6 +56,7 @@ public class RimuHostingPropertiesBuilder extends PropertiesBuilder { long timeoutMillis = timeout.timeUnit().toMillis(timeout.duration()); properties.setProperty(PROPERTY_SO_TIMEOUT, timeoutMillis + ""); properties.setProperty(PROPERTY_CONNECTION_TIMEOUT, timeoutMillis + ""); + properties.setProperty(ComputeServiceConstants.PROPERTY_TIMEOUT_NODE_TERMINATED, 60 * 1000 + ""); return properties; } diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java b/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java index 4af778afc2..974864b1a1 100755 --- a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java +++ b/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java @@ -43,4 +43,8 @@ public class RimuHostingComputeServiceLiveTest extends BaseComputeServiceLiveTes return new JschSshClientModule(); } + @Override + public void testOptionToNotBlock() { + // start call is blocking anyway. + } } From 3ea6b290d1f1a8f88d0564778954c5c8d2a0cae0 Mon Sep 17 00:00:00 2001 From: Jeremy Whitlock Date: Thu, 2 Jun 2011 16:50:57 -0600 Subject: [PATCH 39/40] Issue 550: Added ProviderMetadata for Eucalyptus Partner Cloud EC2. [in providers/eucalyptus-partnercloud-ec2/src] * main/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderMetadata.java, main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata, test/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderTest.java: Added. --- ...lyptusPartnerCloudEC2ProviderMetadata.java | 108 ++++++++++++++++++ .../org.jclouds.providers.ProviderMetadata | 1 + ...EucalyptusPartnerCloudEC2ProviderTest.java | 37 ++++++ 3 files changed, 146 insertions(+) create mode 100644 providers/eucalyptus-partnercloud-ec2/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderMetadata.java create mode 100644 providers/eucalyptus-partnercloud-ec2/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderTest.java diff --git a/providers/eucalyptus-partnercloud-ec2/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderMetadata.java b/providers/eucalyptus-partnercloud-ec2/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderMetadata.java new file mode 100644 index 0000000000..c18ed12397 --- /dev/null +++ b/providers/eucalyptus-partnercloud-ec2/src/main/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderMetadata.java @@ -0,0 +1,108 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.epc; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; + +/** + * Implementation of {@ link org.jclouds.types.ProviderMetadata} for Eucalpytus' + * Partner Cloud EC2 provider. + * + * @author Jeremy Whitlock + */ +public class EucalyptusPartnerCloudEC2ProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "eucalyptus-partnercloud-ec2"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return COMPUTE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "Eucalyptus Partner Cloud (EC2)"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "Username"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Password"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://www.eucalyptus.com/partners"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://partnercloud.eucalyptus.com:8443"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://open.eucalyptus.com/wiki/IntroducingEucalyptus_v2.0"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US-CA"); + } + +} diff --git a/providers/eucalyptus-partnercloud-ec2/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/eucalyptus-partnercloud-ec2/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..1afa66de43 --- /dev/null +++ b/providers/eucalyptus-partnercloud-ec2/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.epc.EucalyptusPartnerCloudEC2ProviderMetadata diff --git a/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderTest.java b/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderTest.java new file mode 100644 index 0000000000..41659cefd9 --- /dev/null +++ b/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/EucalyptusPartnerCloudEC2ProviderTest.java @@ -0,0 +1,37 @@ +/** + * + * Copyright (C) 2011 Cloud Conscious, LLC. + * + * ==================================================================== + * 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.epc; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * The EucalyptusPartnerCloudEC2ProviderTest tests the {@link EucalyptusPartnerCloudEC2ProviderMetadata} class. + * + * @author Jeremy Whitlock + */ +@Test(groups = "unit", testName = "EucalyptusPartnerCloudEC2ProviderTest") +public class EucalyptusPartnerCloudEC2ProviderTest extends BaseProviderMetadataTest { + + public EucalyptusPartnerCloudEC2ProviderTest() { + super(new EucalyptusPartnerCloudEC2ProviderMetadata(), ProviderMetadata.COMPUTE_TYPE); + } + +} \ No newline at end of file From 389943558810b63d149a34e341d81cc4ab7111c7 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 2 Jun 2011 16:22:50 -0700 Subject: [PATCH 40/40] Issue 593:add rimu hosting to supported providers list --- README.txt | 4 ++-- allcompute/pom.xml | 5 +++++ providers/pom.xml | 1 + {sandbox-providers => providers}/rimuhosting/README.txt | 0 {sandbox-providers => providers}/rimuhosting/pom.xml | 0 .../org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java | 0 .../java/org/jclouds/rimuhosting/miro/RimuHostingClient.java | 0 .../jclouds/rimuhosting/miro/RimuHostingContextBuilder.java | 0 .../rimuhosting/miro/RimuHostingPropertiesBuilder.java | 0 .../jclouds/rimuhosting/miro/binder/CreateServerOptions.java | 0 .../rimuhosting/miro/binder/RimuHostingJsonBinder.java | 0 .../rimuhosting/miro/binder/RimuHostingRebootJsonBinder.java | 0 .../config/RimuHostingBindComputeStrategiesByClass.java | 0 .../config/RimuHostingBindComputeSuppliersByClass.java | 0 .../config/RimuHostingComputeServiceContextModule.java | 0 .../config/RimuHostingComputeServiceDependenciesModule.java | 0 .../miro/compute/functions/ServerToNodeMetadata.java | 0 .../RimuHostingCreateNodeWithGroupEncodedIntoName.java | 0 .../compute/strategy/RimuHostingDestroyNodeStrategy.java | 0 .../compute/strategy/RimuHostingGetNodeMetadataStrategy.java | 0 .../miro/compute/strategy/RimuHostingLifeCycleStrategy.java | 0 .../miro/compute/strategy/RimuHostingListNodesStrategy.java | 0 .../suppliers/RimuHostingDefaultLocationSupplier.java | 0 .../miro/compute/suppliers/RimuHostingHardwareSupplier.java | 0 .../miro/compute/suppliers/RimuHostingImageSupplier.java | 0 .../miro/compute/suppliers/RimuHostingLocationSupplier.java | 0 .../rimuhosting/miro/config/RimuHostingRestClientModule.java | 0 .../java/org/jclouds/rimuhosting/miro/data/CloneOptions.java | 0 .../org/jclouds/rimuhosting/miro/data/CreateOptions.java | 0 .../org/jclouds/rimuhosting/miro/data/IpRequestData.java | 0 .../org/jclouds/rimuhosting/miro/data/NewServerData.java | 0 .../java/org/jclouds/rimuhosting/miro/data/PostData.java | 0 .../org/jclouds/rimuhosting/miro/domain/BillingData.java | 0 .../java/org/jclouds/rimuhosting/miro/domain/DataCenter.java | 0 .../rimuhosting/miro/domain/DataTransferAllowance.java | 0 .../main/java/org/jclouds/rimuhosting/miro/domain/Image.java | 0 .../org/jclouds/rimuhosting/miro/domain/IpAddresses.java | 0 .../java/org/jclouds/rimuhosting/miro/domain/MetaData.java | 0 .../jclouds/rimuhosting/miro/domain/NewServerResponse.java | 0 .../org/jclouds/rimuhosting/miro/domain/PricingPlan.java | 0 .../org/jclouds/rimuhosting/miro/domain/ResizeResponse.java | 0 .../org/jclouds/rimuhosting/miro/domain/ResizeResult.java | 0 .../java/org/jclouds/rimuhosting/miro/domain/Server.java | 0 .../java/org/jclouds/rimuhosting/miro/domain/ServerInfo.java | 0 .../jclouds/rimuhosting/miro/domain/ServerParameters.java | 0 .../rimuhosting/miro/domain/internal/RimuHostingError.java | 0 .../miro/domain/internal/RimuHostingResponse.java | 0 .../miro/domain/internal/RimuHostingTimestamp.java | 0 .../rimuhosting/miro/domain/internal/RunningState.java | 0 .../jclouds/rimuhosting/miro/domain/internal/ServerType.java | 0 .../rimuhosting/miro/filters/RimuHostingAuthentication.java | 0 .../miro/functions/ParseDestroyResponseFromJsonResponse.java | 0 .../miro/functions/ParseImagesFromJsonResponse.java | 0 .../miro/functions/ParsePricingPlansFromJsonResponse.java | 0 .../miro/functions/ParseRimuHostingException.java | 0 .../miro/functions/ParseServerFromJsonResponse.java | 0 .../miro/functions/ParseServerInfoFromJsonResponse.java | 0 .../miro/functions/ParseServersFromJsonResponse.java | 0 .../jclouds/rimuhosting/miro/predicates/ServerDestroyed.java | 0 .../jclouds/rimuhosting/miro/predicates/ServerRunning.java | 0 .../rimuhosting/miro/reference/RimuHostingConstants.java | 0 .../jclouds/rimuhosting/miro/ProvidersInPropertiesTest.java | 0 .../jclouds/rimuhosting/miro/RimuHostingAsyncClientTest.java | 0 .../jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java | 0 .../miro/compute/RimuHostingComputeServiceLiveTest.java | 0 .../miro/compute/RimuHostingTemplateBuilderLiveTest.java | 0 .../config/RimuHostingComputeServiceContextModuleTest.java | 0 .../miro/functions/ParseServerFromJsonResponseTest.java | 0 .../rimuhosting/src/test/resources/cancelled.json | 0 .../rimuhosting/src/test/resources/log4j.xml | 0 70 files changed, 8 insertions(+), 2 deletions(-) rename {sandbox-providers => providers}/rimuhosting/README.txt (100%) rename {sandbox-providers => providers}/rimuhosting/pom.xml (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/CreateServerOptions.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingJsonBinder.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingRebootJsonBinder.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeStrategiesByClass.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeSuppliersByClass.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModule.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceDependenciesModule.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingCreateNodeWithGroupEncodedIntoName.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingDestroyNodeStrategy.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingGetNodeMetadataStrategy.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingLifeCycleStrategy.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingListNodesStrategy.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingDefaultLocationSupplier.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingHardwareSupplier.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingImageSupplier.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingLocationSupplier.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CloneOptions.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CreateOptions.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/IpRequestData.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/NewServerData.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/PostData.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/BillingData.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataCenter.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataTransferAllowance.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Image.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/IpAddresses.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/MetaData.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/NewServerResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/PricingPlan.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResult.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Server.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerInfo.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerParameters.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingError.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingTimestamp.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RunningState.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/ServerType.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/filters/RimuHostingAuthentication.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseDestroyResponseFromJsonResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseImagesFromJsonResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParsePricingPlansFromJsonResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseRimuHostingException.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerInfoFromJsonResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServersFromJsonResponse.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerDestroyed.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerRunning.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/ProvidersInPropertiesTest.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClientTest.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingTemplateBuilderLiveTest.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModuleTest.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponseTest.java (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/resources/cancelled.json (100%) rename {sandbox-providers => providers}/rimuhosting/src/test/resources/log4j.xml (100%) diff --git a/README.txt b/README.txt index 89c1dd96a5..44a5a78f0c 100644 --- a/README.txt +++ b/README.txt @@ -33,7 +33,7 @@ our compute api supports: aws-ec2, gogrid, cloudservers-us, stub (in-memory), de cloudservers-uk, vcloud (generic), ec2 (generic), byon, nova, trmk-ecloud, trmk-vcloudexpress, eucalyptus (generic), cloudsigma-zrh, elasticstack(generic), bluelock-vcloud-vcenterprise, - bluelock-vcloud-zone01, stratogen-vcloud-mycloud, + bluelock-vcloud-zone01, stratogen-vcloud-mycloud, rimuhosting, slicehost, eucalyptus-partnercloud-ec2, elastichosts-lon-p (Peer 1), elastichosts-sat-p (Peer 1), elastichosts-lon-b (BlueSquare), openhosting-east1, serverlove-z1-man, skalicloud-sdg-my @@ -55,7 +55,7 @@ our loadbalancer api supports: cloudloadbalancers-us * note * the pom dependency org.jclouds/jclouds-allloadbalancer gives you access to to all of these providers -we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, rimuhosting, openstack nova, +we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, openstack nova, azurequeue, simpledb, cloudstack as well as a async-http-client driver in the sandbox diff --git a/allcompute/pom.xml b/allcompute/pom.xml index f1a130039f..c032904840 100644 --- a/allcompute/pom.xml +++ b/allcompute/pom.xml @@ -49,6 +49,11 @@ aws-ec2 ${project.version} + + org.jclouds.provider + rimuhosting + ${project.version} + org.jclouds.api nova diff --git a/providers/pom.xml b/providers/pom.xml index 91ba5d6a15..5db5034f4d 100644 --- a/providers/pom.xml +++ b/providers/pom.xml @@ -62,6 +62,7 @@ elastichosts-lon-p elastichosts-sat-p elastichosts-lon-b + rimuhosting openhosting-east1 serverlove-z1-man skalicloud-sdg-my diff --git a/sandbox-providers/rimuhosting/README.txt b/providers/rimuhosting/README.txt similarity index 100% rename from sandbox-providers/rimuhosting/README.txt rename to providers/rimuhosting/README.txt diff --git a/sandbox-providers/rimuhosting/pom.xml b/providers/rimuhosting/pom.xml similarity index 100% rename from sandbox-providers/rimuhosting/pom.xml rename to providers/rimuhosting/pom.xml diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/CreateServerOptions.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/CreateServerOptions.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/CreateServerOptions.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/CreateServerOptions.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingJsonBinder.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingJsonBinder.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingJsonBinder.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingJsonBinder.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingRebootJsonBinder.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingRebootJsonBinder.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingRebootJsonBinder.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/binder/RimuHostingRebootJsonBinder.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeStrategiesByClass.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeStrategiesByClass.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeStrategiesByClass.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeStrategiesByClass.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeSuppliersByClass.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeSuppliersByClass.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeSuppliersByClass.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingBindComputeSuppliersByClass.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModule.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModule.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModule.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModule.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceDependenciesModule.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceDependenciesModule.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceDependenciesModule.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceDependenciesModule.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingCreateNodeWithGroupEncodedIntoName.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingCreateNodeWithGroupEncodedIntoName.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingCreateNodeWithGroupEncodedIntoName.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingCreateNodeWithGroupEncodedIntoName.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingDestroyNodeStrategy.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingDestroyNodeStrategy.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingDestroyNodeStrategy.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingDestroyNodeStrategy.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingGetNodeMetadataStrategy.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingGetNodeMetadataStrategy.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingGetNodeMetadataStrategy.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingGetNodeMetadataStrategy.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingLifeCycleStrategy.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingLifeCycleStrategy.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingLifeCycleStrategy.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingLifeCycleStrategy.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingListNodesStrategy.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingListNodesStrategy.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingListNodesStrategy.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/strategy/RimuHostingListNodesStrategy.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingDefaultLocationSupplier.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingDefaultLocationSupplier.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingDefaultLocationSupplier.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingDefaultLocationSupplier.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingHardwareSupplier.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingHardwareSupplier.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingHardwareSupplier.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingHardwareSupplier.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingImageSupplier.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingImageSupplier.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingImageSupplier.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingImageSupplier.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingLocationSupplier.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingLocationSupplier.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingLocationSupplier.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/suppliers/RimuHostingLocationSupplier.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CloneOptions.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CloneOptions.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CloneOptions.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CloneOptions.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CreateOptions.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CreateOptions.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CreateOptions.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/CreateOptions.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/IpRequestData.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/IpRequestData.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/IpRequestData.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/IpRequestData.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/NewServerData.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/NewServerData.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/NewServerData.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/NewServerData.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/PostData.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/PostData.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/PostData.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/data/PostData.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/BillingData.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/BillingData.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/BillingData.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/BillingData.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataCenter.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataCenter.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataCenter.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataCenter.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataTransferAllowance.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataTransferAllowance.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataTransferAllowance.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/DataTransferAllowance.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Image.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Image.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Image.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Image.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/IpAddresses.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/IpAddresses.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/IpAddresses.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/IpAddresses.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/MetaData.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/MetaData.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/MetaData.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/MetaData.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/NewServerResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/NewServerResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/NewServerResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/NewServerResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/PricingPlan.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/PricingPlan.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/PricingPlan.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/PricingPlan.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResult.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResult.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResult.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ResizeResult.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Server.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Server.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Server.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/Server.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerInfo.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerInfo.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerInfo.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerInfo.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerParameters.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerParameters.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerParameters.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/ServerParameters.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingError.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingError.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingError.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingError.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingTimestamp.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingTimestamp.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingTimestamp.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RimuHostingTimestamp.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RunningState.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RunningState.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RunningState.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/RunningState.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/ServerType.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/ServerType.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/ServerType.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/domain/internal/ServerType.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/filters/RimuHostingAuthentication.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/filters/RimuHostingAuthentication.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/filters/RimuHostingAuthentication.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/filters/RimuHostingAuthentication.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseDestroyResponseFromJsonResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseDestroyResponseFromJsonResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseDestroyResponseFromJsonResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseDestroyResponseFromJsonResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseImagesFromJsonResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseImagesFromJsonResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseImagesFromJsonResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseImagesFromJsonResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParsePricingPlansFromJsonResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParsePricingPlansFromJsonResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParsePricingPlansFromJsonResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParsePricingPlansFromJsonResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseRimuHostingException.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseRimuHostingException.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseRimuHostingException.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseRimuHostingException.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerInfoFromJsonResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerInfoFromJsonResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerInfoFromJsonResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServerInfoFromJsonResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServersFromJsonResponse.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServersFromJsonResponse.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServersFromJsonResponse.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/functions/ParseServersFromJsonResponse.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerDestroyed.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerDestroyed.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerDestroyed.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerDestroyed.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerRunning.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerRunning.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerRunning.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/predicates/ServerRunning.java diff --git a/sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java similarity index 100% rename from sandbox-providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java rename to providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/ProvidersInPropertiesTest.java b/providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/ProvidersInPropertiesTest.java similarity index 100% rename from sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/ProvidersInPropertiesTest.java rename to providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/ProvidersInPropertiesTest.java diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClientTest.java b/providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClientTest.java similarity index 100% rename from sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClientTest.java rename to providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClientTest.java diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java b/providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java similarity index 100% rename from sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java rename to providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java b/providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java similarity index 100% rename from sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java rename to providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingComputeServiceLiveTest.java diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingTemplateBuilderLiveTest.java b/providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingTemplateBuilderLiveTest.java similarity index 100% rename from sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingTemplateBuilderLiveTest.java rename to providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/RimuHostingTemplateBuilderLiveTest.java diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModuleTest.java b/providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModuleTest.java similarity index 100% rename from sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModuleTest.java rename to providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/compute/config/RimuHostingComputeServiceContextModuleTest.java diff --git a/sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponseTest.java b/providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponseTest.java similarity index 100% rename from sandbox-providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponseTest.java rename to providers/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/functions/ParseServerFromJsonResponseTest.java diff --git a/sandbox-providers/rimuhosting/src/test/resources/cancelled.json b/providers/rimuhosting/src/test/resources/cancelled.json similarity index 100% rename from sandbox-providers/rimuhosting/src/test/resources/cancelled.json rename to providers/rimuhosting/src/test/resources/cancelled.json diff --git a/sandbox-providers/rimuhosting/src/test/resources/log4j.xml b/providers/rimuhosting/src/test/resources/log4j.xml similarity index 100% rename from sandbox-providers/rimuhosting/src/test/resources/log4j.xml rename to providers/rimuhosting/src/test/resources/log4j.xml