diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java index 309fb0bd4f..07858849b0 100644 --- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java +++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersClientLiveTest.java @@ -47,6 +47,7 @@ import org.jclouds.cloudservers.domain.ServerStatus; import org.jclouds.cloudservers.domain.SharedIpGroup; import org.jclouds.cloudservers.domain.WeeklyBackup; import org.jclouds.cloudservers.options.RebuildServerOptions; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.Credentials; import org.jclouds.http.HttpResponseException; import org.jclouds.io.Payload; @@ -55,7 +56,6 @@ import org.jclouds.net.IPSocket; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContextFactory; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshException; import org.jclouds.ssh.jsch.config.JschSshClientModule; diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/CloudApplicationArchitecturesEC2ClientLiveTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/CloudApplicationArchitecturesEC2ClientLiveTest.java index fbf64a4cef..23dbee0ac6 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/CloudApplicationArchitecturesEC2ClientLiveTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/CloudApplicationArchitecturesEC2ClientLiveTest.java @@ -37,6 +37,7 @@ import java.util.concurrent.TimeoutException; import org.jclouds.Constants; import org.jclouds.aws.AWSResponseException; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.Credentials; import org.jclouds.ec2.domain.BlockDevice; import org.jclouds.ec2.domain.Image.EbsBlockDevice; @@ -58,7 +59,6 @@ import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContextFactory; import org.jclouds.scriptbuilder.ScriptBuilder; import org.jclouds.scriptbuilder.domain.OsFamily; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshException; import org.testng.annotations.AfterTest; diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/EBSBootEC2ClientLiveTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/EBSBootEC2ClientLiveTest.java index 24af71a4cb..83f79b30f9 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/EBSBootEC2ClientLiveTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/EBSBootEC2ClientLiveTest.java @@ -37,6 +37,7 @@ import java.util.concurrent.TimeoutException; import org.jclouds.Constants; import org.jclouds.aws.AWSResponseException; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.Credentials; import org.jclouds.ec2.domain.Attachment; import org.jclouds.ec2.domain.BlockDevice; @@ -70,7 +71,6 @@ import org.jclouds.scriptbuilder.InitBuilder; import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.scriptbuilder.domain.Statement; import org.jclouds.scriptbuilder.domain.Statements; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshException; import org.testng.annotations.AfterTest; 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 8dda4ddad1..a2b1dbacbd 100644 --- a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java +++ b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackClientLiveTest.java @@ -31,6 +31,7 @@ import java.util.logging.Logger; import org.jclouds.Constants; import org.jclouds.compute.ComputeServiceContextFactory; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.Credentials; import org.jclouds.elasticstack.domain.ClaimType; import org.jclouds.elasticstack.domain.CreateDriveRequest; @@ -51,7 +52,6 @@ import org.jclouds.net.IPSocket; import org.jclouds.predicates.InetSocketAddressConnect; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.rest.RestContext; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.jsch.config.JschSshClientModule; import org.jclouds.util.Strings2; 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 a0fc557c84..8baf7694bf 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 @@ -33,7 +33,6 @@ import static org.testng.Assert.assertNotNull; import java.io.IOException; import java.net.URI; import java.util.List; -import java.util.NoSuchElementException; import java.util.Properties; import java.util.Map.Entry; import java.util.concurrent.ExecutionException; @@ -41,7 +40,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.jclouds.Constants; -import org.jclouds.http.HttpResponseException; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.net.IPSocket; import org.jclouds.predicates.RetryablePredicate; @@ -83,13 +81,6 @@ import com.google.inject.Module; public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTest { - // Terremark service call 695,490 - @Override - @Test(expectedExceptions = NoSuchElementException.class) - public void testCatalog() throws Exception { - super.testCatalog(); - } - protected String expectedOs = "Ubuntu Linux (64-bit)"; protected String itemName = "Ubuntu JeOS 9.10 (64-bit)"; @@ -149,7 +140,7 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes prepare(); StringBuffer name = new StringBuffer(); for (int i = 0; i < 15; i++) - name.append("a"); + name.append("c"); String serverName = name.toString();// "adriantest"; long hardDisk = 4194304; @@ -166,6 +157,8 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes TerremarkCatalogItem item = tmClient.findCatalogItemInOrgCatalogNamed(null, null, itemName); + assert item != null; + // if this template supports setting the root password, let's add it to // our options CustomizationParameters customizationOptions = tmClient.getCustomizationOptions(item.getCustomizationOptions() @@ -175,6 +168,8 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes VCloudExpressVAppTemplate vAppTemplate = tmClient.getVAppTemplate(item.getEntity().getHref()); + assert vAppTemplate != null; + // instantiate, noting vApp returned has minimal details vApp = tmClient.instantiateVAppTemplateInVDC(vdc.getHref(), vAppTemplate.getHref(), serverName, instantiateOptions); @@ -196,8 +191,7 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes try {// per docs, this is not supported tmClient.cancelTask(deployTask.getHref()); - } catch (HttpResponseException e) { - assertEquals(e.getResponse().getStatusCode(), 501); + } catch (UnsupportedOperationException e) { } assert successTester.apply(deployTask.getHref()); @@ -302,14 +296,14 @@ public abstract class TerremarkClientLiveTest extends VCloudExpressClientLiveTes try {// per docs, this is not supported tmClient.undeployVApp(vApp.getHref()); - } catch (HttpResponseException e) { - assertEquals(e.getResponse().getStatusCode(), 501); + assert false; + } catch (UnsupportedOperationException e) { } try {// per docs, this is not supported tmClient.suspendVApp(vApp.getHref()); - } catch (HttpResponseException e) { - assertEquals(e.getResponse().getStatusCode(), 501); + assert false; + } catch (UnsupportedOperationException e) { } assert successTester.apply(tmClient.resetVApp(vApp.getHref()).getHref()); diff --git a/common/vcloud/src/main/java/org/jclouds/vcloud/functions/OrgNameCatalogNameVAppTemplateNameToEndpoint.java b/common/vcloud/src/main/java/org/jclouds/vcloud/functions/OrgNameCatalogNameVAppTemplateNameToEndpoint.java index 1bbe1304a9..6c73108cef 100644 --- a/common/vcloud/src/main/java/org/jclouds/vcloud/functions/OrgNameCatalogNameVAppTemplateNameToEndpoint.java +++ b/common/vcloud/src/main/java/org/jclouds/vcloud/functions/OrgNameCatalogNameVAppTemplateNameToEndpoint.java @@ -48,8 +48,8 @@ public class OrgNameCatalogNameVAppTemplateNameToEndpoint implements Function>>> orgCatalogItemMap, - @Org String defaultOrg, @Catalog String defaultCatalog) { + Supplier>>> orgCatalogItemMap, + @Org String defaultOrg, @Catalog String defaultCatalog) { this.orgCatalogItemMap = orgCatalogItemMap; this.defaultOrg = defaultOrg; this.defaultCatalog = defaultCatalog; @@ -65,13 +65,23 @@ public class OrgNameCatalogNameVAppTemplateNameToEndpoint implements Function> catalogs = checkNotNull(orgCatalogItemMap.get().get(org)); - return catalogs.get(catalog).get(catalogItem).getEntity().getHref(); - } catch (NullPointerException e) { - throw new NoSuchElementException(org + "/" + catalog + "/" + catalogItem + " not found in " - + orgCatalogItemMap.get()); - } + Map>> orgCatalogItemMap = this.orgCatalogItemMap.get(); + + if (!orgCatalogItemMap.containsKey(org)) + throw new NoSuchElementException("org: " + org + " not found in " + orgCatalogItemMap.keySet()); + Map> catalogs = orgCatalogItemMap.get(org); + + if (!catalogs.containsKey(catalog)) + throw new NoSuchElementException("catalog: " + org + "/" + catalog + " not found in " + catalogs.keySet()); + Map catalogMap = catalogs.get(catalog); + + if (!catalogMap.containsKey(catalogItem)) + throw new NoSuchElementException("item: " + org + "/" + catalog + "/" + catalogItem + " not found in " + + catalogMap.keySet()); + CatalogItem item = catalogMap.get(catalogItem); + + return checkNotNull(item.getEntity(), "item: " + org + "/" + catalog + "/" + catalogItem + " has no entity") + .getHref(); } } \ No newline at end of file diff --git a/compute/src/main/clojure/org/jclouds/modules.clj b/compute/src/main/clojure/org/jclouds/modules.clj index f49e6a9d5c..53982b606c 100644 --- a/compute/src/main/clojure/org/jclouds/modules.clj +++ b/compute/src/main/clojure/org/jclouds/modules.clj @@ -20,7 +20,8 @@ (:require [clojure.contrib.logging :as logging]) (:import - [org.jclouds.ssh SshClient ExecResponse] + org.jclouds.ssh.SshClient + org.jclouds.compute.domain.ExecResponse com.google.inject.Module com.google.common.collect.ImmutableSet org.jclouds.domain.Credentials diff --git a/compute/src/main/java/org/jclouds/compute/ComputeService.java b/compute/src/main/java/org/jclouds/compute/ComputeService.java index e94b060f6c..fc6a92b615 100755 --- a/compute/src/main/java/org/jclouds/compute/ComputeService.java +++ b/compute/src/main/java/org/jclouds/compute/ComputeService.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.Set; import org.jclouds.compute.domain.ComputeMetadata; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.Image; import org.jclouds.compute.domain.NodeMetadata; @@ -34,7 +35,6 @@ import org.jclouds.compute.options.TemplateOptions; import org.jclouds.domain.Location; import org.jclouds.io.Payload; import org.jclouds.scriptbuilder.domain.Statement; -import org.jclouds.ssh.ExecResponse; import com.google.common.base.Predicate; import com.google.inject.ImplementedBy; diff --git a/compute/src/main/java/org/jclouds/compute/RunScriptOnNodesException.java b/compute/src/main/java/org/jclouds/compute/RunScriptOnNodesException.java index 7d2d8c21a4..51b09604df 100644 --- a/compute/src/main/java/org/jclouds/compute/RunScriptOnNodesException.java +++ b/compute/src/main/java/org/jclouds/compute/RunScriptOnNodesException.java @@ -26,10 +26,10 @@ import java.util.Map; import javax.annotation.Nullable; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.options.RunScriptOptions; import org.jclouds.scriptbuilder.domain.Statement; -import org.jclouds.ssh.ExecResponse; /** * diff --git a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNode.java b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNode.java index c3841a6b65..ebeb405b15 100644 --- a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNode.java +++ b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNode.java @@ -21,10 +21,10 @@ package org.jclouds.compute.callables; import java.util.concurrent.Callable; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.options.RunScriptOptions; import org.jclouds.scriptbuilder.domain.Statement; -import org.jclouds.ssh.ExecResponse; import com.google.common.annotations.Beta; 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 0ff672cdee..eca269255a 100644 --- a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java +++ b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSsh.java @@ -27,6 +27,7 @@ import java.util.Collections; import javax.annotation.Resource; import javax.inject.Named; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.options.RunScriptOptions; import org.jclouds.compute.reference.ComputeServiceConstants; @@ -34,7 +35,6 @@ import org.jclouds.logging.Logger; import org.jclouds.scriptbuilder.InitBuilder; import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.scriptbuilder.domain.Statement; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import com.google.common.annotations.VisibleForTesting; diff --git a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java index 753e10fb51..ebc302e42a 100644 --- a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java +++ b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java @@ -24,11 +24,11 @@ import static com.google.common.base.Preconditions.checkNotNull; import javax.inject.Inject; import javax.inject.Named; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.options.RunScriptOptions; import org.jclouds.compute.predicates.ScriptStatusReturnsZero.CommandUsingClient; import org.jclouds.scriptbuilder.domain.Statement; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import com.google.common.base.Function; diff --git a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeUsingSsh.java b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeUsingSsh.java index cb5902682a..321b2dc792 100644 --- a/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeUsingSsh.java +++ b/compute/src/main/java/org/jclouds/compute/callables/RunScriptOnNodeUsingSsh.java @@ -25,13 +25,13 @@ import static com.google.common.base.Preconditions.checkState; import javax.annotation.Resource; import javax.inject.Named; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.options.RunScriptOptions; import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.logging.Logger; import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.scriptbuilder.domain.Statement; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import com.google.common.annotations.VisibleForTesting; diff --git a/compute/src/main/java/org/jclouds/ssh/ExecResponse.java b/compute/src/main/java/org/jclouds/compute/domain/ExecResponse.java similarity index 98% rename from compute/src/main/java/org/jclouds/ssh/ExecResponse.java rename to compute/src/main/java/org/jclouds/compute/domain/ExecResponse.java index c5f83c8ae6..2f7af8429c 100644 --- a/compute/src/main/java/org/jclouds/ssh/ExecResponse.java +++ b/compute/src/main/java/org/jclouds/compute/domain/ExecResponse.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.jclouds.ssh; +package org.jclouds.compute.domain; import org.jclouds.compute.config.CustomizationResponse; diff --git a/compute/src/main/java/org/jclouds/compute/internal/BaseComputeService.java b/compute/src/main/java/org/jclouds/compute/internal/BaseComputeService.java index 5c9456a838..4104e6821c 100755 --- a/compute/src/main/java/org/jclouds/compute/internal/BaseComputeService.java +++ b/compute/src/main/java/org/jclouds/compute/internal/BaseComputeService.java @@ -59,6 +59,7 @@ import org.jclouds.compute.RunScriptOnNodesException; import org.jclouds.compute.callables.RunScriptOnNode; import org.jclouds.compute.config.CustomizationResponse; import org.jclouds.compute.domain.ComputeMetadata; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.Image; import org.jclouds.compute.domain.NodeMetadata; @@ -85,7 +86,6 @@ import org.jclouds.logging.Logger; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.scriptbuilder.domain.Statement; import org.jclouds.scriptbuilder.domain.Statements; -import org.jclouds.ssh.ExecResponse; import org.jclouds.util.Strings2; import com.google.common.base.Function; diff --git a/compute/src/main/java/org/jclouds/compute/predicates/ScriptStatusReturnsZero.java b/compute/src/main/java/org/jclouds/compute/predicates/ScriptStatusReturnsZero.java index baa3c568b7..24886584f4 100644 --- a/compute/src/main/java/org/jclouds/compute/predicates/ScriptStatusReturnsZero.java +++ b/compute/src/main/java/org/jclouds/compute/predicates/ScriptStatusReturnsZero.java @@ -22,8 +22,8 @@ package org.jclouds.compute.predicates; import javax.annotation.Resource; import javax.inject.Singleton; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.logging.Logger; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import com.google.common.base.Predicate; diff --git a/compute/src/main/java/org/jclouds/compute/strategy/CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java b/compute/src/main/java/org/jclouds/compute/strategy/CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java index ae31acdff3..fbe3440ea7 100644 --- a/compute/src/main/java/org/jclouds/compute/strategy/CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java +++ b/compute/src/main/java/org/jclouds/compute/strategy/CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java @@ -34,6 +34,7 @@ import javax.inject.Named; import org.jclouds.compute.callables.RunScriptOnNode; import org.jclouds.compute.config.CustomizationResponse; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.options.TemplateOptions; import org.jclouds.compute.predicates.RetryIfSocketNotYetOpen; @@ -41,7 +42,6 @@ import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.compute.reference.ComputeServiceConstants.Timeouts; import org.jclouds.logging.Logger; import org.jclouds.scriptbuilder.domain.Statement; -import org.jclouds.ssh.ExecResponse; import com.google.common.base.Function; import com.google.common.base.Predicate; diff --git a/compute/src/main/java/org/jclouds/compute/strategy/RunScriptOnNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java b/compute/src/main/java/org/jclouds/compute/strategy/RunScriptOnNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java index bf9e6d4d25..58a00182f0 100644 --- a/compute/src/main/java/org/jclouds/compute/strategy/RunScriptOnNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java +++ b/compute/src/main/java/org/jclouds/compute/strategy/RunScriptOnNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java @@ -30,10 +30,10 @@ import javax.annotation.Resource; import javax.inject.Named; import org.jclouds.compute.callables.RunScriptOnNode; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.logging.Logger; -import org.jclouds.ssh.ExecResponse; import com.google.common.base.Objects; import com.google.inject.assistedinject.AssistedInject; diff --git a/compute/src/main/java/org/jclouds/ssh/SshClient.java b/compute/src/main/java/org/jclouds/ssh/SshClient.java index 25ccc1f84e..709076b1ac 100644 --- a/compute/src/main/java/org/jclouds/ssh/SshClient.java +++ b/compute/src/main/java/org/jclouds/ssh/SshClient.java @@ -22,6 +22,7 @@ package org.jclouds.ssh; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.Credentials; import org.jclouds.io.Payload; import org.jclouds.net.IPSocket; diff --git a/compute/src/test/clojure/org/jclouds/ssh_test.clj b/compute/src/test/clojure/org/jclouds/ssh_test.clj index 5766833862..31f7947d32 100644 --- a/compute/src/test/clojure/org/jclouds/ssh_test.clj +++ b/compute/src/test/clojure/org/jclouds/ssh_test.clj @@ -21,7 +21,8 @@ [clojure.contrib.logging :as logging] [org.jclouds.modules :as modules]) (:import - [org.jclouds.ssh SshClient ExecResponse] + org.jclouds.ssh.SshClient + org.jclouds.compute.domain.ExecResponse org.jclouds.io.Payload org.jclouds.net.IPSocket)) diff --git a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java index 104f801050..843123647f 100755 --- a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java @@ -58,6 +58,7 @@ import java.util.concurrent.TimeoutException; import org.jclouds.Constants; import org.jclouds.compute.domain.ComputeMetadata; import org.jclouds.compute.domain.ComputeType; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.Image; import org.jclouds.compute.domain.NodeMetadata; @@ -78,7 +79,6 @@ import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.AuthorizationException; import org.jclouds.rest.RestContextFactory; import org.jclouds.scriptbuilder.domain.Statements; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshException; import org.testng.annotations.AfterTest; @@ -239,11 +239,11 @@ public abstract class BaseComputeServiceLiveTest { } for (Entry response : client.runScriptOnNodesMatching( - runningWithTag(tag), Statements.exec("echo hello"), overrideCredentialsWith(good).wrapInInitScript(false)) - .entrySet()) + runningWithTag(tag), Statements.exec("echo hello"), + overrideCredentialsWith(good).wrapInInitScript(false).runAsRoot(false)).entrySet()) assert response.getValue().getOutput().trim().equals("hello") : response.getKey() + ": " + response.getValue(); - + runScriptWithCreds(tag, os, good); checkNodes(nodes, tag); diff --git a/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java b/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java index 9eaaef2651..c55169e1a6 100644 --- a/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java +++ b/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java @@ -36,6 +36,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.easymock.IArgumentMatcher; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.domain.Credentials; import org.jclouds.io.Payload; @@ -43,7 +44,6 @@ import org.jclouds.net.IPSocket; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.predicates.SocketOpen; import org.jclouds.rest.RestContext; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshException; import org.jclouds.util.Strings2; 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 7bf9421d95..524d3e94d8 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 @@ -40,12 +40,12 @@ import javax.inject.Named; import org.apache.commons.io.input.ProxyInputStream; import org.apache.commons.io.output.ByteArrayOutputStream; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.http.handlers.BackoffLimitedRetryHandler; import org.jclouds.io.Payload; import org.jclouds.io.Payloads; import org.jclouds.logging.Logger; import org.jclouds.net.IPSocket; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshException; import org.jclouds.util.Strings2; diff --git a/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java b/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java index 787a3c89e7..4ab1701a2e 100644 --- a/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java +++ b/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java @@ -26,11 +26,11 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.Credentials; import org.jclouds.io.Payload; import org.jclouds.io.Payloads; import org.jclouds.net.IPSocket; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.jsch.config.JschSshClientModule; import org.jclouds.util.Strings2; diff --git a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java b/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java index 1e3772e6ff..2cf1514b84 100644 --- a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java +++ b/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java @@ -46,13 +46,13 @@ import org.jclouds.cloudsigma.options.CloneDriveOptions; import org.jclouds.cloudsigma.predicates.DriveClaimed; import org.jclouds.cloudsigma.util.Servers; import org.jclouds.compute.ComputeServiceContextFactory; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.domain.Credentials; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.net.IPSocket; import org.jclouds.predicates.InetSocketAddressConnect; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.rest.RestContext; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.SshClient; import org.jclouds.ssh.jsch.config.JschSshClientModule; import org.testng.annotations.AfterGroups; diff --git a/sandbox-apis/byon/src/test/java/org/jclouds/byon/BYONComputeServiceLiveTest.java b/sandbox-apis/byon/src/test/java/org/jclouds/byon/BYONComputeServiceLiveTest.java index 342ee3004c..9e58366318 100644 --- a/sandbox-apis/byon/src/test/java/org/jclouds/byon/BYONComputeServiceLiveTest.java +++ b/sandbox-apis/byon/src/test/java/org/jclouds/byon/BYONComputeServiceLiveTest.java @@ -32,10 +32,10 @@ import java.util.Map.Entry; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContextFactory; import org.jclouds.compute.ComputeTestUtils; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.scriptbuilder.domain.OsFamily; -import org.jclouds.ssh.ExecResponse; import org.jclouds.ssh.jsch.config.JschSshClientModule; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; diff --git a/sandbox-apis/byon/src/test/java/org/jclouds/byon/functions/NodeToNodeMetadataTest.java b/sandbox-apis/byon/src/test/java/org/jclouds/byon/functions/NodeToNodeMetadataTest.java index e81941fb39..f7ab227b0a 100644 --- a/sandbox-apis/byon/src/test/java/org/jclouds/byon/functions/NodeToNodeMetadataTest.java +++ b/sandbox-apis/byon/src/test/java/org/jclouds/byon/functions/NodeToNodeMetadataTest.java @@ -46,10 +46,10 @@ import com.google.common.collect.Maps; public class NodeToNodeMetadataTest { public static final Location location = new LocationImpl(LocationScope.PROVIDER, "byon", "byon", null); - public static final NodeMetadata TEST1 = new NodeMetadataBuilder().ids("first").tag("hadoop").name("xyz").location( + public static final NodeMetadata TEST1 = new NodeMetadataBuilder().ids("cluster-1").tag("hadoop").name("xyz").location( location).state(NodeState.RUNNING).operatingSystem( new OperatingSystemBuilder().name("redhat").family(OsFamily.RHEL).arch("x86").version("5.3").description( - "xyz").build()).publicAddresses(ImmutableSet.of("firsthost")).credentials( + "xyz").build()).publicAddresses(ImmutableSet.of("cluster-1.mydomain.com")).credentials( new Credentials("myUser", "fancyfoot")).adminPassword("sudo").build(); @Test @@ -60,7 +60,7 @@ public class NodeToNodeMetadataTest { NodeToNodeMetadata parser = new NodeToNodeMetadata(Suppliers.ofInstance(location), credentialStore); assertEquals(parser.apply(NodesFromYamlTest.TEST1), TEST1); - assertEquals(credentialStore, ImmutableMap.of("node#first", new Credentials("myUser", "fancyfoot"))); + assertEquals(credentialStore, ImmutableMap.of("node#cluster-1", new Credentials("myUser", "fancyfoot"))); } }