mirror of https://github.com/apache/jclouds.git
format and imports
This commit is contained in:
parent
e1ecb920d5
commit
e389ce0f2d
|
@ -25,9 +25,9 @@ import org.jclouds.location.Region;
|
||||||
import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull;
|
import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.FlavorAsyncClient;
|
import org.jclouds.openstack.nova.v1_1.features.FlavorAsyncClient;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.FloatingIPAsyncClient;
|
import org.jclouds.openstack.nova.v1_1.features.FloatingIPAsyncClient;
|
||||||
|
import org.jclouds.openstack.nova.v1_1.features.ImageAsyncClient;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.KeyPairAsyncClient;
|
import org.jclouds.openstack.nova.v1_1.features.KeyPairAsyncClient;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.SecurityGroupAsyncClient;
|
import org.jclouds.openstack.nova.v1_1.features.SecurityGroupAsyncClient;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.ImageAsyncClient;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.features.ServerAsyncClient;
|
import org.jclouds.openstack.nova.v1_1.features.ServerAsyncClient;
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
import org.jclouds.rest.annotations.EndpointParam;
|
import org.jclouds.rest.annotations.EndpointParam;
|
||||||
|
|
|
@ -24,7 +24,6 @@ import java.util.Properties;
|
||||||
import org.jclouds.compute.ComputeServiceContextBuilder;
|
import org.jclouds.compute.ComputeServiceContextBuilder;
|
||||||
import org.jclouds.openstack.nova.v1_1.compute.config.NovaComputeServiceContextModule;
|
import org.jclouds.openstack.nova.v1_1.compute.config.NovaComputeServiceContextModule;
|
||||||
import org.jclouds.openstack.nova.v1_1.config.NovaRestClientModule;
|
import org.jclouds.openstack.nova.v1_1.config.NovaRestClientModule;
|
||||||
import org.jclouds.rest.RestContextBuilder;
|
|
||||||
|
|
||||||
import com.google.inject.Module;
|
import com.google.inject.Module;
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.compute.config;
|
package org.jclouds.openstack.nova.v1_1.compute.config;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.inject.TypeLiteral;
|
|
||||||
import org.jclouds.compute.ComputeServiceAdapter;
|
import org.jclouds.compute.ComputeServiceAdapter;
|
||||||
import org.jclouds.compute.config.ComputeServiceAdapterContextModule;
|
import org.jclouds.compute.config.ComputeServiceAdapterContextModule;
|
||||||
import org.jclouds.compute.domain.Hardware;
|
import org.jclouds.compute.domain.Hardware;
|
||||||
|
@ -38,6 +36,9 @@ import org.jclouds.openstack.nova.v1_1.compute.strategy.NovaComputeServiceAdapte
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
|
|
||||||
|
import com.google.common.base.Function;
|
||||||
|
import com.google.inject.TypeLiteral;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module for building a compute service context for Nova
|
* Module for building a compute service context for Nova
|
||||||
*
|
*
|
||||||
|
|
|
@ -18,13 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import org.jclouds.compute.domain.Hardware;
|
import org.jclouds.compute.domain.Hardware;
|
||||||
import org.jclouds.compute.domain.HardwareBuilder;
|
import org.jclouds.compute.domain.HardwareBuilder;
|
||||||
import org.jclouds.compute.domain.Processor;
|
import org.jclouds.compute.domain.Processor;
|
||||||
import org.jclouds.compute.domain.internal.VolumeImpl;
|
import org.jclouds.compute.domain.internal.VolumeImpl;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
||||||
|
|
||||||
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function for transforming the nova specific Flavor object to the generic Hardware object.
|
* A function for transforming the nova specific Flavor object to the generic Hardware object.
|
||||||
*
|
*
|
||||||
|
|
|
@ -18,11 +18,13 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.Image;
|
import org.jclouds.compute.domain.Image;
|
||||||
import org.jclouds.compute.domain.ImageBuilder;
|
import org.jclouds.compute.domain.ImageBuilder;
|
||||||
import org.jclouds.compute.domain.OperatingSystem;
|
import org.jclouds.compute.domain.OperatingSystem;
|
||||||
import javax.inject.Inject;
|
|
||||||
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function for transforming a nova-specific Image into a generic Image object.
|
* A function for transforming a nova-specific Image into a generic Image object.
|
||||||
|
|
|
@ -18,6 +18,22 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import org.jclouds.compute.domain.OperatingSystem;
|
||||||
|
import org.jclouds.compute.domain.OsFamily;
|
||||||
|
import org.jclouds.compute.reference.ComputeServiceConstants;
|
||||||
|
import org.jclouds.compute.util.ComputeServiceUtils;
|
||||||
|
import org.jclouds.logging.Logger;
|
||||||
|
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
||||||
|
|
||||||
import com.google.common.base.CharMatcher;
|
import com.google.common.base.CharMatcher;
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
@ -25,19 +41,6 @@ import com.google.common.base.Predicate;
|
||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import org.jclouds.compute.domain.OperatingSystem;
|
|
||||||
import org.jclouds.compute.domain.OsFamily;
|
|
||||||
import org.jclouds.compute.reference.ComputeServiceConstants;
|
|
||||||
import org.jclouds.compute.util.ComputeServiceUtils;
|
|
||||||
import org.jclouds.logging.Logger;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function for transforming a nova specific Image into a generic OperatingSystem object.
|
* A function for transforming a nova specific Image into a generic OperatingSystem object.
|
||||||
|
|
|
@ -18,17 +18,19 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
package org.jclouds.openstack.nova.v1_1.compute.functions;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import java.util.Map;
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import com.google.common.collect.Iterables;
|
|
||||||
import org.jclouds.compute.domain.NodeMetadata;
|
import org.jclouds.compute.domain.NodeMetadata;
|
||||||
import org.jclouds.compute.domain.NodeMetadataBuilder;
|
import org.jclouds.compute.domain.NodeMetadataBuilder;
|
||||||
import org.jclouds.compute.domain.NodeState;
|
import org.jclouds.compute.domain.NodeState;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.ServerStatus;
|
import org.jclouds.openstack.nova.v1_1.domain.ServerStatus;
|
||||||
import java.util.Map;
|
|
||||||
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import com.google.common.base.Function;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function for transforming a nova-specific Server into a generic NodeMetadata object.
|
* A function for transforming a nova-specific Server into a generic NodeMetadata object.
|
||||||
|
|
|
@ -18,9 +18,11 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.compute.strategy;
|
package org.jclouds.openstack.nova.v1_1.compute.strategy;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import java.util.Set;
|
||||||
import com.google.common.collect.ImmutableSet;
|
|
||||||
import com.google.common.collect.Iterables;
|
import javax.annotation.Nullable;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.jclouds.compute.ComputeServiceAdapter;
|
import org.jclouds.compute.ComputeServiceAdapter;
|
||||||
import org.jclouds.compute.domain.Template;
|
import org.jclouds.compute.domain.Template;
|
||||||
import org.jclouds.domain.Location;
|
import org.jclouds.domain.Location;
|
||||||
|
@ -34,9 +36,10 @@ import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.FlavorClient;
|
import org.jclouds.openstack.nova.v1_1.features.FlavorClient;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.ImageClient;
|
import org.jclouds.openstack.nova.v1_1.features.ImageClient;
|
||||||
import org.jclouds.openstack.nova.v1_1.features.ServerClient;
|
import org.jclouds.openstack.nova.v1_1.features.ServerClient;
|
||||||
import java.util.Set;
|
|
||||||
import javax.annotation.Nullable;
|
import com.google.common.base.Function;
|
||||||
import javax.inject.Inject;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The adapter used by the NovaComputeServiceContextModule to interface the nova-specific domain model to the computeService generic domain model.
|
* The adapter used by the NovaComputeServiceContextModule to interface the nova-specific domain model to the computeService generic domain model.
|
||||||
|
|
|
@ -18,25 +18,31 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.domain;
|
package org.jclouds.openstack.nova.v1_1.domain;
|
||||||
|
|
||||||
|
import static com.google.common.base.Objects.toStringHelper;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
import com.google.common.base.Predicates;
|
|
||||||
import com.google.common.collect.*;
|
|
||||||
import org.jclouds.openstack.domain.Link;
|
import org.jclouds.openstack.domain.Link;
|
||||||
import org.jclouds.openstack.domain.Resource;
|
import org.jclouds.openstack.domain.Resource;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Address.Type;
|
import org.jclouds.openstack.nova.v1_1.domain.Address.Type;
|
||||||
import org.jclouds.util.InetAddresses2;
|
import org.jclouds.util.InetAddresses2;
|
||||||
import org.jclouds.util.Multimaps2;
|
import org.jclouds.util.Multimaps2;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
|
import com.google.common.base.Predicates;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.ImmutableSetMultimap;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
import com.google.common.collect.LinkedHashMultimap;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.google.common.collect.Multimap;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.toStringHelper;
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
/**
|
/**
|
||||||
* A server is a virtual machine instance in the compute system. Flavor and
|
* A server is a virtual machine instance in the compute system. Flavor and
|
||||||
* image are requisite elements when creating a server.
|
* image are requisite elements when creating a server.
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.jclouds.openstack.nova.v1_1.features;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.SecurityGroup;
|
import org.jclouds.openstack.nova.v1_1.domain.SecurityGroup;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.SecurityGroupRule;
|
import org.jclouds.openstack.nova.v1_1.domain.SecurityGroupRule;
|
||||||
|
|
|
@ -32,7 +32,6 @@ import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
import org.jclouds.openstack.domain.Resource;
|
import org.jclouds.openstack.domain.Resource;
|
||||||
import org.jclouds.openstack.filters.AuthenticateRequest;
|
import org.jclouds.openstack.filters.AuthenticateRequest;
|
||||||
import org.jclouds.openstack.nova.v1_1.NovaClient;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.RebootType;
|
import org.jclouds.openstack.nova.v1_1.domain.RebootType;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
import org.jclouds.openstack.nova.v1_1.options.CreateServerOptions;
|
import org.jclouds.openstack.nova.v1_1.options.CreateServerOptions;
|
||||||
|
|
|
@ -18,14 +18,15 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.features;
|
package org.jclouds.openstack.nova.v1_1.features;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.openstack.domain.Resource;
|
import org.jclouds.openstack.domain.Resource;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.RebootType;
|
import org.jclouds.openstack.nova.v1_1.domain.RebootType;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
import org.jclouds.openstack.nova.v1_1.options.CreateServerOptions;
|
import org.jclouds.openstack.nova.v1_1.options.CreateServerOptions;
|
||||||
import org.jclouds.openstack.nova.v1_1.options.RebuildServerOptions;
|
import org.jclouds.openstack.nova.v1_1.options.RebuildServerOptions;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to Server.
|
* Provides synchronous access to Server.
|
||||||
|
|
|
@ -24,8 +24,8 @@ import static com.google.common.base.Preconditions.checkState;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,12 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.features;
|
package org.jclouds.openstack.nova.v1_1.features;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import static org.testng.Assert.assertEquals;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import static org.testng.Assert.assertNull;
|
||||||
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
import org.jclouds.http.HttpRequest;
|
import org.jclouds.http.HttpRequest;
|
||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.openstack.nova.v1_1.NovaClient;
|
import org.jclouds.openstack.nova.v1_1.NovaClient;
|
||||||
|
@ -28,11 +32,8 @@ import org.jclouds.openstack.nova.v1_1.parse.ParseFloatingIPListTest;
|
||||||
import org.jclouds.openstack.nova.v1_1.parse.ParseFloatingIPTest;
|
import org.jclouds.openstack.nova.v1_1.parse.ParseFloatingIPTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.net.URI;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import static org.testng.Assert.assertEquals;
|
|
||||||
import static org.testng.Assert.assertNull;
|
|
||||||
import static org.testng.Assert.assertTrue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests annotation parsing of {@code FloatingIPAsyncClient}
|
* Tests annotation parsing of {@code FloatingIPAsyncClient}
|
||||||
|
|
|
@ -18,19 +18,21 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.features;
|
package org.jclouds.openstack.nova.v1_1.features;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import static org.testng.Assert.assertEquals;
|
||||||
import com.google.common.collect.Iterables;
|
import static org.testng.Assert.assertFalse;
|
||||||
import com.google.common.collect.Multimap;
|
import static org.testng.Assert.assertNotNull;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.FloatingIP;
|
import org.jclouds.openstack.nova.v1_1.domain.FloatingIP;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.ServerStatus;
|
import org.jclouds.openstack.nova.v1_1.domain.ServerStatus;
|
||||||
import org.jclouds.openstack.nova.v1_1.internal.BaseNovaClientLiveTest;
|
import org.jclouds.openstack.nova.v1_1.internal.BaseNovaClientLiveTest;
|
||||||
import org.testng.annotations.BeforeGroups;
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import java.util.Set;
|
|
||||||
import static org.testng.Assert.*;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of {@code ServerClient}
|
* Tests behavior of {@code ServerClient}
|
||||||
|
|
|
@ -18,42 +18,39 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.features;
|
package org.jclouds.openstack.nova.v1_1.features;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
import org.jclouds.compute.ComputeService;
|
import org.jclouds.compute.ComputeService;
|
||||||
import org.jclouds.http.HttpRequest;
|
import org.jclouds.http.HttpRequest;
|
||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.openstack.domain.Resource;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.internal.BaseNovaComputeServiceExpectTest;
|
import org.jclouds.openstack.nova.v1_1.internal.BaseNovaComputeServiceExpectTest;
|
||||||
import org.jclouds.openstack.nova.v1_1.parse.ParseServerListTest;
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import java.net.URI;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import static org.testng.Assert.*;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the compute service abstraction of the nova client.
|
* Tests the compute service abstraction of the nova client.
|
||||||
*
|
*
|
||||||
* @author Matt Stephenson
|
* @author Matt Stephenson
|
||||||
*/
|
*/
|
||||||
@Test(groups = "unit", testName = "NovaComputeServiceExpectTest")
|
@Test(groups = "unit", testName = "NovaComputeServiceExpectTest")
|
||||||
public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTest
|
public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTest {
|
||||||
{
|
|
||||||
|
|
||||||
public void testListServersWhenResponseIs2xx() throws Exception
|
public void testListServersWhenResponseIs2xx() throws Exception {
|
||||||
{
|
|
||||||
HttpRequest listServers = HttpRequest.builder().method("GET").endpoint(
|
HttpRequest listServers = HttpRequest.builder().method("GET").endpoint(
|
||||||
URI.create("https://compute.north.host/v1.1/3456/servers/detail")).headers(
|
URI.create("https://compute.north.host/v1.1/3456/servers/detail")).headers(
|
||||||
ImmutableMultimap.<String, String>builder().put("Accept", "application/json").put("X-Auth-Token",
|
ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
|
||||||
authToken).build()).build();
|
authToken).build()).build();
|
||||||
|
|
||||||
HttpResponse listServersResponse = HttpResponse.builder().statusCode(200).payload(
|
HttpResponse listServersResponse = HttpResponse.builder().statusCode(200).payload(
|
||||||
payloadFromResource("/server_list_details.json")).build();
|
payloadFromResource("/server_list_details.json")).build();
|
||||||
|
|
||||||
ComputeService clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey,
|
ComputeService clientWhenServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey,
|
||||||
responseWithKeystoneAccess, listServers, listServersResponse);
|
responseWithKeystoneAccess, listServers, listServersResponse);
|
||||||
|
|
||||||
|
|
||||||
assertNotNull(clientWhenServersExist.listAssignableLocations());
|
assertNotNull(clientWhenServersExist.listAssignableLocations());
|
||||||
assertEquals(clientWhenServersExist.listAssignableLocations().size(), 1);
|
assertEquals(clientWhenServersExist.listAssignableLocations().size(), 1);
|
||||||
|
@ -65,17 +62,16 @@ public class NovaComputeServiceExpectTest extends BaseNovaComputeServiceExpectTe
|
||||||
assertEquals(clientWhenServersExist.listNodes().iterator().next().getName(), "sample-server");
|
assertEquals(clientWhenServersExist.listNodes().iterator().next().getName(), "sample-server");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testListServersWhenReponseIs404IsEmpty() throws Exception
|
public void testListServersWhenReponseIs404IsEmpty() throws Exception {
|
||||||
{
|
|
||||||
HttpRequest listServers = HttpRequest.builder().method("GET").endpoint(
|
HttpRequest listServers = HttpRequest.builder().method("GET").endpoint(
|
||||||
URI.create("https://compute.north.host/v1.1/3456/servers/detail")).headers(
|
URI.create("https://compute.north.host/v1.1/3456/servers/detail")).headers(
|
||||||
ImmutableMultimap.<String, String>builder().put("Accept", "application/json").put("X-Auth-Token",
|
ImmutableMultimap.<String, String> builder().put("Accept", "application/json").put("X-Auth-Token",
|
||||||
authToken).build()).build();
|
authToken).build()).build();
|
||||||
|
|
||||||
HttpResponse listServersResponse = HttpResponse.builder().statusCode(404).build();
|
HttpResponse listServersResponse = HttpResponse.builder().statusCode(404).build();
|
||||||
|
|
||||||
ComputeService clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey,
|
ComputeService clientWhenNoServersExist = requestsSendResponses(keystoneAuthWithAccessKeyAndSecretKey,
|
||||||
responseWithKeystoneAccess, listServers, listServersResponse);
|
responseWithKeystoneAccess, listServers, listServersResponse);
|
||||||
|
|
||||||
assertTrue(clientWhenNoServersExist.listNodes().isEmpty());
|
assertTrue(clientWhenNoServersExist.listNodes().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.openstack.nova.v1_1.NovaClient;
|
import org.jclouds.openstack.nova.v1_1.NovaClient;
|
||||||
import org.jclouds.openstack.nova.v1_1.internal.BaseNovaRestClientExpectTest;
|
import org.jclouds.openstack.nova.v1_1.internal.BaseNovaRestClientExpectTest;
|
||||||
import org.jclouds.openstack.nova.v1_1.parse.ParseServerListTest;
|
import org.jclouds.openstack.nova.v1_1.parse.ParseServerListTest;
|
||||||
import org.jclouds.openstack.nova.v1_1.parse.ParseServerTest;
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
|
|
@ -18,13 +18,16 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.functions;
|
package org.jclouds.openstack.nova.v1_1.functions;
|
||||||
|
|
||||||
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.assertFalse;
|
||||||
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.Hardware;
|
import org.jclouds.compute.domain.Hardware;
|
||||||
import org.jclouds.openstack.nova.v1_1.compute.functions.FlavorToHardware;
|
import org.jclouds.openstack.nova.v1_1.compute.functions.FlavorToHardware;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import static org.testng.Assert.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the function used to transform Flavor objects into Hardware objects
|
* Tests the function used to transform Flavor objects into Hardware objects
|
||||||
|
|
|
@ -18,16 +18,19 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.functions;
|
package org.jclouds.openstack.nova.v1_1.functions;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.OperatingSystem;
|
import org.jclouds.compute.domain.OperatingSystem;
|
||||||
import org.jclouds.compute.domain.OsFamily;
|
import org.jclouds.compute.domain.OsFamily;
|
||||||
import org.jclouds.openstack.nova.v1_1.compute.functions.NovaImageToImage;
|
import org.jclouds.openstack.nova.v1_1.compute.functions.NovaImageToImage;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import java.util.UUID;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the function that transforms nova-specific images to generic images.
|
* Tests the function that transforms nova-specific images to generic images.
|
||||||
|
|
|
@ -18,21 +18,26 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.functions;
|
package org.jclouds.openstack.nova.v1_1.functions;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import static org.testng.Assert.assertEquals;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import static org.testng.Assert.assertFalse;
|
||||||
import com.google.common.collect.Iterables;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.OperatingSystem;
|
import org.jclouds.compute.domain.OperatingSystem;
|
||||||
import org.jclouds.compute.domain.OsFamily;
|
import org.jclouds.compute.domain.OsFamily;
|
||||||
import org.jclouds.openstack.nova.v1_1.compute.functions.NovaImageToOperatingSystem;
|
import org.jclouds.openstack.nova.v1_1.compute.functions.NovaImageToOperatingSystem;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
||||||
import org.testng.annotations.DataProvider;
|
import org.testng.annotations.DataProvider;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import static org.testng.Assert.*;
|
import com.google.common.base.Function;
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the function for transforming a nova specific Image into a generic OperatingSystem object.
|
* Tests for the function for transforming a nova specific Image into a generic OperatingSystem object.
|
||||||
|
|
|
@ -18,16 +18,17 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.functions;
|
package org.jclouds.openstack.nova.v1_1.functions;
|
||||||
|
|
||||||
|
import static org.testng.Assert.assertEquals;
|
||||||
|
import static org.testng.Assert.assertNotNull;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.jclouds.compute.domain.NodeMetadata;
|
import org.jclouds.compute.domain.NodeMetadata;
|
||||||
import org.jclouds.openstack.nova.v1_1.compute.functions.ServerToNodeMetadata;
|
import org.jclouds.openstack.nova.v1_1.compute.functions.ServerToNodeMetadata;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.ServerStatus;
|
import org.jclouds.openstack.nova.v1_1.domain.ServerStatus;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
|
||||||
import static org.testng.Assert.assertNotNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the function for transforming a nova specific Server into a generic NodeMetadata object.
|
* Tests for the function for transforming a nova specific Server into a generic NodeMetadata object.
|
||||||
|
|
|
@ -18,9 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.internal;
|
package org.jclouds.openstack.nova.v1_1.internal;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import java.util.Properties;
|
||||||
import com.google.common.collect.ImmutableSet;
|
|
||||||
import com.google.inject.Module;
|
|
||||||
import org.jclouds.compute.ComputeService;
|
import org.jclouds.compute.ComputeService;
|
||||||
import org.jclouds.compute.ComputeServiceContextFactory;
|
import org.jclouds.compute.ComputeServiceContextFactory;
|
||||||
import org.jclouds.http.HttpRequest;
|
import org.jclouds.http.HttpRequest;
|
||||||
|
@ -28,7 +27,10 @@ import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.logging.config.NullLoggingModule;
|
import org.jclouds.logging.config.NullLoggingModule;
|
||||||
import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
|
import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
|
||||||
import org.jclouds.rest.BaseRestClientExpectTest;
|
import org.jclouds.rest.BaseRestClientExpectTest;
|
||||||
import java.util.Properties;
|
|
||||||
|
import com.google.common.base.Function;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.inject.Module;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for writing KeyStone Expect tests with the ComputeService abstraction
|
* Base class for writing KeyStone Expect tests with the ComputeService abstraction
|
||||||
|
|
|
@ -26,7 +26,6 @@ import javax.ws.rs.core.MediaType;
|
||||||
import org.jclouds.json.BaseItemParserTest;
|
import org.jclouds.json.BaseItemParserTest;
|
||||||
import org.jclouds.json.config.GsonModule;
|
import org.jclouds.json.config.GsonModule;
|
||||||
import org.jclouds.openstack.domain.Link;
|
import org.jclouds.openstack.domain.Link;
|
||||||
import org.jclouds.openstack.domain.Resource;
|
|
||||||
import org.jclouds.openstack.domain.Link.Relation;
|
import org.jclouds.openstack.domain.Link.Relation;
|
||||||
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
||||||
|
|
|
@ -18,23 +18,21 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.parse;
|
package org.jclouds.openstack.nova.v1_1.parse;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import java.util.Set;
|
||||||
import com.google.inject.Guice;
|
|
||||||
import com.google.inject.Injector;
|
import javax.ws.rs.Consumes;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
import org.jclouds.json.BaseSetParserTest;
|
import org.jclouds.json.BaseSetParserTest;
|
||||||
import org.jclouds.json.config.GsonModule;
|
import org.jclouds.json.config.GsonModule;
|
||||||
import org.jclouds.openstack.domain.Link;
|
|
||||||
import org.jclouds.openstack.domain.Link.Relation;
|
|
||||||
import org.jclouds.openstack.domain.Resource;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.FloatingIP;
|
import org.jclouds.openstack.nova.v1_1.domain.FloatingIP;
|
||||||
import org.jclouds.rest.annotations.SelectJson;
|
import org.jclouds.rest.annotations.SelectJson;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import javax.ws.rs.core.MediaType;
|
import com.google.inject.Guice;
|
||||||
import java.net.URI;
|
import com.google.inject.Injector;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -18,22 +18,18 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.nova.v1_1.parse;
|
package org.jclouds.openstack.nova.v1_1.parse;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import javax.ws.rs.Consumes;
|
||||||
import com.google.inject.Guice;
|
import javax.ws.rs.core.MediaType;
|
||||||
import com.google.inject.Injector;
|
|
||||||
import org.jclouds.json.BaseItemParserTest;
|
import org.jclouds.json.BaseItemParserTest;
|
||||||
import org.jclouds.json.config.GsonModule;
|
import org.jclouds.json.config.GsonModule;
|
||||||
import org.jclouds.openstack.domain.Link;
|
|
||||||
import org.jclouds.openstack.domain.Link.Relation;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Flavor;
|
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.FloatingIP;
|
import org.jclouds.openstack.nova.v1_1.domain.FloatingIP;
|
||||||
import org.jclouds.rest.annotations.SelectJson;
|
import org.jclouds.rest.annotations.SelectJson;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import com.google.inject.Guice;
|
||||||
import javax.ws.rs.core.MediaType;
|
import com.google.inject.Injector;
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jeremy Daggett
|
* @author Jeremy Daggett
|
||||||
|
|
|
@ -27,8 +27,8 @@ import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||||
import org.jclouds.json.BaseItemParserTest;
|
import org.jclouds.json.BaseItemParserTest;
|
||||||
import org.jclouds.json.config.GsonModule;
|
import org.jclouds.json.config.GsonModule;
|
||||||
import org.jclouds.openstack.domain.Link;
|
import org.jclouds.openstack.domain.Link;
|
||||||
import org.jclouds.openstack.domain.Link.Relation;
|
|
||||||
import org.jclouds.openstack.domain.Resource;
|
import org.jclouds.openstack.domain.Resource;
|
||||||
|
import org.jclouds.openstack.domain.Link.Relation;
|
||||||
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
import org.jclouds.openstack.nova.v1_1.domain.Image;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.ImageStatus;
|
import org.jclouds.openstack.nova.v1_1.domain.ImageStatus;
|
||||||
|
|
|
@ -27,8 +27,8 @@ import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||||
import org.jclouds.json.BaseItemParserTest;
|
import org.jclouds.json.BaseItemParserTest;
|
||||||
import org.jclouds.json.config.GsonModule;
|
import org.jclouds.json.config.GsonModule;
|
||||||
import org.jclouds.openstack.domain.Link;
|
import org.jclouds.openstack.domain.Link;
|
||||||
import org.jclouds.openstack.domain.Link.Relation;
|
|
||||||
import org.jclouds.openstack.domain.Resource;
|
import org.jclouds.openstack.domain.Resource;
|
||||||
|
import org.jclouds.openstack.domain.Link.Relation;
|
||||||
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
import org.jclouds.openstack.nova.v1_1.config.NovaParserModule;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
import org.jclouds.openstack.nova.v1_1.domain.Address;
|
||||||
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
import org.jclouds.openstack.nova.v1_1.domain.Server;
|
||||||
|
|
Loading…
Reference in New Issue