From e43f16ff5d7b5c1dd6da4a988cf9a81d7dd53341 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Fri, 7 Sep 2012 12:56:46 +0200 Subject: [PATCH] Pom fixes and cleanup, properties convention and other fixes commented in the pull-request --- labs/abiquo/NOTICE | 6 ++++- labs/abiquo/pom.xml | 27 +++---------------- .../org/jclouds/abiquo/AbiquoApiMetadata.java | 4 +-- .../AbiquoComputeServiceContextModule.java | 1 - .../{reference => config}/AbiquoEdition.java | 2 +- .../AbiquoProperties.java} | 6 ++--- .../domain/infrastructure/Datacenter.java | 2 +- .../http/filters/AbiquoAuthentication.java | 2 +- .../internal/BaseMonitoringService.java | 4 +-- .../internal/BaseAsyncTaskMonitor.java | 4 +-- .../internal/BaseConversionMonitor.java | 4 +-- .../internal/BaseVirtualApplianceMonitor.java | 4 +-- .../internal/BaseVirtualMachineMonitor.java | 4 +-- .../compute/AbiquoComputeServiceLiveTest.java | 4 +-- .../VirtualMachineTemplateLiveApiTest.java | 6 ----- .../InfrastructureTestEnvironment.java | 2 +- .../AbiquoAuthenticationLiveApiTest.java | 6 ++--- .../internal/BaseMonitoringServiceTest.java | 2 +- 18 files changed, 34 insertions(+), 56 deletions(-) rename labs/abiquo/src/main/java/org/jclouds/abiquo/{reference => config}/AbiquoEdition.java (96%) rename labs/abiquo/src/main/java/org/jclouds/abiquo/{reference/AbiquoConstants.java => config/AbiquoProperties.java} (90%) diff --git a/labs/abiquo/NOTICE b/labs/abiquo/NOTICE index 7e867501e1..bf10c4168b 100644 --- a/labs/abiquo/NOTICE +++ b/labs/abiquo/NOTICE @@ -22,4 +22,8 @@ Copyright 2009-2011 jclouds, Inc. This product includes software developed at Abiquo Holdings S.L. (http://www.abiquo.com/). -distributed under the GNU Lesser General Public License version 3 + +The following Abiquo dependencies are distributed under +the GNU Lesser General Public License version 3: + com.abiquo:api-model-transport + com.abiquo:am-model diff --git a/labs/abiquo/pom.xml b/labs/abiquo/pom.xml index 453f52fa22..9eab759b7b 100644 --- a/labs/abiquo/pom.xml +++ b/labs/abiquo/pom.xml @@ -16,8 +16,9 @@ 2.1-SNAPSHOT - - + http://localhost/api + FIXME + FIXME org.jclouds.abiquo*;version="${project.version}" @@ -112,7 +113,7 @@ org.jclouds.driver - jclouds-jsch + jclouds-sshj ${project.version} test @@ -122,12 +123,6 @@ ${project.version} test - - org.slf4j - slf4j-api - 1.6.1 - test - ch.qos.logback logback-core @@ -140,20 +135,6 @@ 1.0.0 test - diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java index ef1c5d5087..78fd985237 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java @@ -20,8 +20,8 @@ package org.jclouds.abiquo; import static org.jclouds.Constants.PROPERTY_MAX_REDIRECTS; -import static org.jclouds.abiquo.reference.AbiquoConstants.ASYNC_TASK_MONITOR_DELAY; -import static org.jclouds.abiquo.reference.AbiquoConstants.CREDENTIAL_IS_TOKEN; +import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY; +import static org.jclouds.abiquo.config.AbiquoProperties.CREDENTIAL_IS_TOKEN; import java.net.URI; import java.util.Properties; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java index fc86f99409..4007b0afd6 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java @@ -30,7 +30,6 @@ import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate; import org.jclouds.abiquo.domain.infrastructure.Datacenter; import org.jclouds.compute.ComputeServiceAdapter; import org.jclouds.compute.config.ComputeServiceAdapterContextModule; -import org.jclouds.compute.config.ComputeServiceAdapterContextModule.LocationsFromComputeServiceAdapterModule; import org.jclouds.compute.domain.Hardware; import org.jclouds.compute.domain.Image; import org.jclouds.compute.domain.NodeMetadata; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/reference/AbiquoEdition.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoEdition.java similarity index 96% rename from labs/abiquo/src/main/java/org/jclouds/abiquo/reference/AbiquoEdition.java rename to labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoEdition.java index a3d685dbea..c7c88f1630 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/reference/AbiquoEdition.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoEdition.java @@ -17,7 +17,7 @@ * under the License. */ -package org.jclouds.abiquo.reference; +package org.jclouds.abiquo.config; /** * The Abiquo Edition (Community or Enterprise). diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/reference/AbiquoConstants.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java similarity index 90% rename from labs/abiquo/src/main/java/org/jclouds/abiquo/reference/AbiquoConstants.java rename to labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java index ac560edb9c..bf98bc50ec 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/reference/AbiquoConstants.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java @@ -17,16 +17,16 @@ * under the License. */ -package org.jclouds.abiquo.reference; +package org.jclouds.abiquo.config; import org.jclouds.abiquo.features.services.MonitoringService; /** - * Global constants used in the Abiquo provider. + * Configuration properties and constants used in Abiquo connections. * * @author Ignasi Barrera */ -public interface AbiquoConstants +public interface AbiquoProperties { /** * Boolean property indicating if the provided credential is an api token. diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java index 0894ba2840..80ef2e8af8 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java @@ -25,6 +25,7 @@ import java.util.List; import org.jclouds.abiquo.AbiquoApi; import org.jclouds.abiquo.AbiquoAsyncApi; +import org.jclouds.abiquo.config.AbiquoEdition; import org.jclouds.abiquo.domain.DomainWrapper; import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate; import org.jclouds.abiquo.domain.enterprise.Enterprise; @@ -34,7 +35,6 @@ import org.jclouds.abiquo.domain.infrastructure.options.IpmiOptions; import org.jclouds.abiquo.domain.infrastructure.options.MachineOptions; import org.jclouds.abiquo.domain.network.Network; import org.jclouds.abiquo.domain.network.options.NetworkOptions; -import org.jclouds.abiquo.reference.AbiquoEdition; import org.jclouds.abiquo.reference.annotations.EnterpriseEdition; import org.jclouds.rest.RestContext; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java index 4be0049037..f3a462ec1d 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java @@ -20,7 +20,7 @@ package org.jclouds.abiquo.http.filters; import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.abiquo.reference.AbiquoConstants.CREDENTIAL_IS_TOKEN; +import static org.jclouds.abiquo.config.AbiquoProperties.CREDENTIAL_IS_TOKEN; import java.io.UnsupportedEncodingException; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java index cd38b8e64f..8d850efb7e 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java @@ -21,7 +21,7 @@ package org.jclouds.abiquo.internal; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS; -import static org.jclouds.abiquo.reference.AbiquoConstants.ASYNC_TASK_MONITOR_DELAY; +import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; @@ -31,8 +31,8 @@ import javax.annotation.Resource; import javax.inject.Named; import javax.inject.Singleton; -import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.AbiquoApi; +import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.events.handlers.AbstractEventHandler; import org.jclouds.abiquo.events.handlers.BlockingEventHandler; import org.jclouds.abiquo.events.monitor.CompletedEvent; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java index 00cb30a264..f6e88c00e9 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java @@ -21,7 +21,7 @@ package org.jclouds.abiquo.monitor.internal; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS; -import static org.jclouds.abiquo.reference.AbiquoConstants.ASYNC_TASK_MONITOR_DELAY; +import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -30,8 +30,8 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.AbiquoApi; +import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.domain.task.AsyncTask; import org.jclouds.abiquo.internal.BaseMonitoringService; import org.jclouds.abiquo.monitor.AsyncTaskMonitor; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java index a31ed41db5..b30be3a666 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java @@ -21,7 +21,7 @@ package org.jclouds.abiquo.monitor.internal; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS; -import static org.jclouds.abiquo.reference.AbiquoConstants.ASYNC_TASK_MONITOR_DELAY; +import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -30,8 +30,8 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.AbiquoApi; +import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.domain.cloud.Conversion; import org.jclouds.abiquo.internal.BaseMonitoringService; import org.jclouds.abiquo.monitor.ConversionMonitor; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java index a561352aaa..a1948dc7dc 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java @@ -21,7 +21,7 @@ package org.jclouds.abiquo.monitor.internal; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS; -import static org.jclouds.abiquo.reference.AbiquoConstants.ASYNC_TASK_MONITOR_DELAY; +import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -30,8 +30,8 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.AbiquoApi; +import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.domain.cloud.VirtualAppliance; import org.jclouds.abiquo.internal.BaseMonitoringService; import org.jclouds.abiquo.monitor.VirtualApplianceMonitor; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java index 1cc6e0cb35..aa7df1820f 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java @@ -21,7 +21,7 @@ package org.jclouds.abiquo.monitor.internal; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS; -import static org.jclouds.abiquo.reference.AbiquoConstants.ASYNC_TASK_MONITOR_DELAY; +import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -30,8 +30,8 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.AbiquoApi; +import org.jclouds.abiquo.AbiquoAsyncApi; import org.jclouds.abiquo.domain.cloud.VirtualMachine; import org.jclouds.abiquo.internal.BaseMonitoringService; import org.jclouds.abiquo.monitor.VirtualMachineMonitor; diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java index 2f016a123c..48d1f31797 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java @@ -32,7 +32,7 @@ import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.internal.BaseComputeServiceLiveTest; import org.jclouds.logging.config.LoggingModule; import org.jclouds.logging.slf4j.config.SLF4JLoggingModule; -import org.jclouds.ssh.jsch.config.JschSshClientModule; +import org.jclouds.sshj.config.SshjSshClientModule; import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; @@ -89,7 +89,7 @@ public class AbiquoComputeServiceLiveTest extends BaseComputeServiceLiveTest @Override protected Module getSshModule() { - return new JschSshClientModule(); + return new SshjSshClientModule(); } @Override diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java index b9be919742..7391cf5421 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java @@ -54,12 +54,6 @@ public class VirtualMachineTemplateLiveApiTest extends BaseAbiquoApiLiveApiTest assertNotNull(category); } - public void testGetIcon() - { - String iconUrl = env.virtualMachine.getTemplate().getIconUrl(); - assertNotNull(iconUrl); - } - public void testRequestConversionToSameFormat() { try diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java index ead8ac5ead..17d9db6efa 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java @@ -33,6 +33,7 @@ import java.util.List; import java.util.UUID; import org.jclouds.abiquo.AbiquoContext; +import org.jclouds.abiquo.config.AbiquoEdition; import org.jclouds.abiquo.domain.config.License; import org.jclouds.abiquo.domain.enterprise.Enterprise; import org.jclouds.abiquo.domain.enterprise.Limits; @@ -62,7 +63,6 @@ import org.jclouds.abiquo.predicates.infrastructure.RemoteServicePredicates; import org.jclouds.abiquo.predicates.infrastructure.StorageDeviceMetadataPredicates; import org.jclouds.abiquo.predicates.infrastructure.StoragePoolPredicates; import org.jclouds.abiquo.predicates.infrastructure.TierPredicates; -import org.jclouds.abiquo.reference.AbiquoEdition; import org.jclouds.abiquo.util.Config; import com.abiquo.model.enumerator.HypervisorType; diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AbiquoAuthenticationLiveApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AbiquoAuthenticationLiveApiTest.java index baf418593c..e63697c64a 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AbiquoAuthenticationLiveApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AbiquoAuthenticationLiveApiTest.java @@ -38,7 +38,7 @@ import javax.ws.rs.core.HttpHeaders; import org.jclouds.ContextBuilder; import org.jclouds.abiquo.AbiquoApiMetadata; import org.jclouds.abiquo.AbiquoContext; -import org.jclouds.abiquo.reference.AbiquoConstants; +import org.jclouds.abiquo.config.AbiquoProperties; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; import org.jclouds.logging.slf4j.config.SLF4JLoggingModule; @@ -79,7 +79,7 @@ public class AbiquoAuthenticationLiveApiTest String token = getAuthtenticationToken(); Properties props = new Properties(); - props.setProperty(AbiquoConstants.CREDENTIAL_IS_TOKEN, "true"); + props.setProperty(AbiquoProperties.CREDENTIAL_IS_TOKEN, "true"); // Create a new context that uses the generated token to perform the API calls AbiquoContext tokenContext = ContextBuilder.newBuilder(new AbiquoApiMetadata()) // @@ -111,7 +111,7 @@ public class AbiquoAuthenticationLiveApiTest String token = getAuthtenticationToken() + "INVALID"; Properties props = new Properties(); - props.setProperty(AbiquoConstants.CREDENTIAL_IS_TOKEN, "true"); + props.setProperty(AbiquoProperties.CREDENTIAL_IS_TOKEN, "true"); // Create a new context that uses the generated token to perform the API calls AbiquoContext tokenContext = ContextBuilder.newBuilder(new AbiquoApiMetadata()) // diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java index 9d7ca5520b..6d58677094 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java @@ -19,7 +19,7 @@ package org.jclouds.abiquo.internal; -import static org.jclouds.abiquo.reference.AbiquoConstants.ASYNC_TASK_MONITOR_DELAY; +import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull;