You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2014/10/07 00:31:14 UTC

[37/52] [abbrv] git commit: JCLOUDS-49 clear remaining async stuff from openstack

JCLOUDS-49 clear remaining async stuff from openstack


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/360e8b8d
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/360e8b8d
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/360e8b8d

Branch: refs/heads/use-agentproxy-008
Commit: 360e8b8d6ac7247367cd60572b970f2c341b5562
Parents: e42cc80
Author: Adrian Cole <ad...@gmail.com>
Authored: Sun Oct 5 17:37:06 2014 -0700
Committer: Adrian Cole <ad...@gmail.com>
Committed: Sun Oct 5 22:32:20 2014 -0700

----------------------------------------------------------------------
 .../v2_0/features/ExtensionAsyncApi.java        | 72 --------------------
 .../internal/OpenStackAuthClientTest.java       | 14 ++--
 2 files changed, 6 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/360e8b8d/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionAsyncApi.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionAsyncApi.java
deleted file mode 100644
index 215fad3..0000000
--- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/features/ExtensionAsyncApi.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.openstack.v2_0.features;
-
-import java.util.Set;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.v2_0.domain.Extension;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.SelectJson;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to Extensions via their REST API.
- * <p/>
- * 
- * @see ExtensionApi
- * @see <a href=
- *      "http://docs.openstack.org/api/openstack-compute/2/content/Extensions-d1e1444.html"
- *      />
- */
-@RequestFilters(AuthenticateRequest.class)
-public interface ExtensionAsyncApi {
-
-   /**
-    * @see ExtensionApi#list
-    */
-   @Named("extension:list")
-   @GET
-   @SelectJson("extensions")
-   @Consumes(MediaType.APPLICATION_JSON)
-   @Path("/extensions")
-   @Fallback(EmptySetOnNotFoundOr404.class)
-   ListenableFuture<? extends Set<? extends Extension>> list();
-
-   /**
-    * @see ExtensionApi#get
-    */
-   @Named("extension:get")
-   @GET
-   @SelectJson("extension")
-   @Consumes(MediaType.APPLICATION_JSON)
-   @Path("/extensions/{alias}")
-   @Fallback(NullOnNotFoundOr404.class)
-   ListenableFuture<? extends Extension> get(@PathParam("alias") String id);
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds/blob/360e8b8d/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthClientTest.java
----------------------------------------------------------------------
diff --git a/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthClientTest.java b/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthClientTest.java
index 5829fa8..fedd4d6 100644
--- a/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthClientTest.java
+++ b/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthClientTest.java
@@ -16,17 +16,16 @@
  */
 package org.jclouds.openstack.internal;
 
+import static org.jclouds.providers.AnonymousProviderMetadata.forApiOnEndpoint;
 import static org.jclouds.reflect.Reflection2.method;
 
 import java.io.IOException;
 
-import org.jclouds.apis.ApiMetadata;
 import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions;
 import org.jclouds.http.HttpRequest;
-import org.jclouds.http.IntegrationTestAsyncClient;
 import org.jclouds.http.IntegrationTestClient;
 import org.jclouds.openstack.functions.ParseAuthenticationResponseFromHeaders;
-import org.jclouds.rest.AnonymousRestApiMetadata;
+import org.jclouds.providers.ProviderMetadata;
 import org.jclouds.rest.internal.BaseRestAnnotationProcessingTest;
 import org.jclouds.rest.internal.GeneratedHttpRequest;
 import org.testng.annotations.Test;
@@ -41,7 +40,7 @@ public class OpenStackAuthClientTest extends BaseRestAnnotationProcessingTest<Op
       Invokable<?, ?> method = method(OpenStackAuthClient.class, "authenticate", String.class, String.class);
       GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("foo", "bar"));
 
-      assertRequestLineEquals(httpRequest, "GET http://localhost:8080/v1.0 HTTP/1.1");
+      assertRequestLineEquals(httpRequest, "GET http://localhost:8080/v1 HTTP/1.1");
       assertNonPayloadHeadersEqual(httpRequest, "Accept: */*\nHost: localhost:8080\nX-Auth-Key: bar\nX-Auth-User: foo\n");
       assertPayloadEquals(httpRequest, null, null, false);
 
@@ -55,7 +54,7 @@ public class OpenStackAuthClientTest extends BaseRestAnnotationProcessingTest<Op
       Invokable<?, ?> method = method(OpenStackAuthClient.class, "authenticateStorage", String.class, String.class);
       GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("foo", "bar"));
 
-      assertRequestLineEquals(httpRequest, "GET http://localhost:8080/v1.0 HTTP/1.1");
+      assertRequestLineEquals(httpRequest, "GET http://localhost:8080/v1 HTTP/1.1");
       assertNonPayloadHeadersEqual(httpRequest, "Accept: */*\nHost: localhost:8080\nX-Storage-Pass: bar\nX-Storage-User: foo\n");
       assertPayloadEquals(httpRequest, null, null, false);
 
@@ -66,9 +65,8 @@ public class OpenStackAuthClientTest extends BaseRestAnnotationProcessingTest<Op
    }
 
    @Override
-   public ApiMetadata createApiMetadata() {
-      return AnonymousRestApiMetadata.forClientMappedToAsyncClient(IntegrationTestClient.class, IntegrationTestAsyncClient.class).toBuilder().defaultEndpoint(
-            "http://localhost:8080").version("1.0").build();
+   public ProviderMetadata createProviderMetadata() {
+      return forApiOnEndpoint(IntegrationTestClient.class, "http://localhost:8080");
    }
 
    @Override