You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by am...@apache.org on 2018/08/01 22:06:11 UTC

[cxf] branch 3.2.x-fixes updated (183eea1 -> 704dc75)

This is an automated email from the ASF dual-hosted git repository.

amccright pushed a change to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 183eea1  Updating BouncyCastle
     new b68becf  [CXF-7673] MP Rest Client 1.1 Impl
     new 0bebe29  Code Review Changes
     new b14c73f  [CXF-7673] MP Rest Client 1.1 Impl (continued)
     new d60aecb  Use testng.xml
     new a9a38ef  Add cxf.module.name property to pom.xml
     new b04462f  Reset pom version to 3.2.6
     new a169339  Remove unnecessary changes for InvocationCallback
     new 704dc75  Avoid direct dependency on 1.1-specific APIs for 1.0 compat

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cxf/jaxrs/impl/ResponseImpl.java    |   3 +
 .../apache/cxf/jaxrs/client/ClientProxyImpl.java   |  36 +++--
 rt/rs/microprofile-client/pom.xml                  |   7 +
 .../client/CxfTypeSafeClientBuilder.java           |  20 ++-
 .../microprofile/client/MPRestClientCallback.java} |  86 +++---------
 .../cxf/microprofile/client/Messages.properties    |   6 +-
 .../client/MicroProfileClientFactoryBean.java      |  13 +-
 .../client/MicroProfileClientProviderFactory.java  |  23 +++-
 .../apache/cxf/microprofile/client/Validator.java  |   2 +-
 .../microprofile/client/cdi/RestClientBean.java    |  36 +++--
 .../proxy/MPAsyncInvocationInterceptorImpl.java    |  74 ++++++++++
 .../MPAsyncInvocationInterceptorPostAsyncImpl.java |  44 +++---
 .../client/proxy/MicroProfileClientProxyImpl.java  |  81 ++++++++++-
 .../client/CxfTypeSafeClientBuilderTest.java       |   4 +-
 systests/microprofile/{ => client/async}/pom.xml   |  39 +++---
 .../microprofile/rest/client/AsyncMethodTest.java  | 153 +++++++++++++++++++++
 .../mock/AsyncClientWithCompletionStage.java       |  14 +-
 .../AsyncInvocationInterceptorFactoryTestImpl.java |  62 +++++++++
 ...AsyncInvocationInterceptorFactoryTestImpl2.java |  57 ++++++++
 .../rest/client/mock/ThreadLocalClientFilter.java  |  27 ++--
 systests/microprofile/client/weld/pom.xml          |   3 +
 systests/microprofile/client/weld/testng.xml       |  27 ++++
 systests/microprofile/pom.xml                      |   9 +-
 23 files changed, 665 insertions(+), 161 deletions(-)
 copy rt/rs/{client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java => microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MPRestClientCallback.java} (53%)
 create mode 100644 rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java
 copy testutils/src/main/java/org/apache/cxf/greeter_control/FaultThrowingInterceptor.java => rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorPostAsyncImpl.java (50%)
 copy systests/microprofile/{ => client/async}/pom.xml (82%)
 create mode 100644 systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
 copy rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/mock/ExceptionMappingClient.java => systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithCompletionStage.java (77%)
 create mode 100644 systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java
 create mode 100644 systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java
 copy rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/multipart/JwsMultipartClientResponseFilter.java => systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java (53%)
 create mode 100644 systests/microprofile/client/weld/testng.xml


[cxf] 05/08: Add cxf.module.name property to pom.xml

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit a9a38ef621ea818288f169f8e31a9bc7e83dd103
Author: Andy McCright <j....@gmail.com>
AuthorDate: Tue Jul 10 10:23:05 2018 -0500

    Add cxf.module.name property to pom.xml
---
 systests/microprofile/client/async/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/systests/microprofile/client/async/pom.xml b/systests/microprofile/client/async/pom.xml
index 1c854b4..0433018 100644
--- a/systests/microprofile/client/async/pom.xml
+++ b/systests/microprofile/client/async/pom.xml
@@ -31,6 +31,7 @@
     <description>Apache CXF System Tests - MicroProfile Rest Client Async Tests</description>
     <url>http://cxf.apache.org</url>
     <properties>
+        <cxf.module.name>org.apache.cxf.systests.microprofile.async</cxf.module.name>
         <cxf.geronimo.config.version>1.0</cxf.geronimo.config.version>
         <cxf.microprofile.rest.client.version>1.1</cxf.microprofile.rest.client.version>
         <cxf.wiremock.params>--port=8765</cxf.wiremock.params>


[cxf] 03/08: [CXF-7673] MP Rest Client 1.1 Impl (continued)

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit b14c73fde58d8e300ab043381e24c9caa2cb4732
Author: Andy McCright <j....@gmail.com>
AuthorDate: Thu Jul 5 17:24:07 2018 -0500

    [CXF-7673] MP Rest Client 1.1 Impl (continued)
    
    Various changes to account for change to use CompletionStage and
    to pass the 1.1 TCK:
    * Remove changes for InvocationCallback - spec voted against it
    * Changed Future to CompletionStage
    * Ensure ResponseImpl.getLocation() returns a non-null URI
    * Using CompletableFuture in JaxrsClientCallback
    * Updates to pom.xml files to use public MP Rest Client API and TCK
    * Throw IllegalArgumentException if executorService is null
    * Show preference to baseURI config in CDI
    * Modify MP Rest Client tests to expect latest version of spec changes
---
 .../org/apache/cxf/jaxrs/impl/ResponseImpl.java    |   3 +
 .../apache/cxf/jaxrs/client/ClientProxyImpl.java   |   1 -
 .../cxf/jaxrs/client/JaxrsClientCallback.java      |   5 +-
 rt/rs/microprofile-client/pom.xml                  |   4 +-
 .../client/CxfTypeSafeClientBuilder.java           |   3 +
 .../apache/cxf/microprofile/client/Validator.java  |  16 +-
 .../microprofile/client/cdi/RestClientBean.java    |  36 ++--
 .../client/proxy/MicroProfileClientProxyImpl.java  |  55 ++----
 systests/microprofile/client/async/pom.xml         |   4 +-
 .../microprofile/rest/client/AsyncMethodTest.java  | 195 ++-------------------
 ...re.java => AsyncClientWithCompletionStage.java} |   6 +-
 .../mock/AsyncClientWithInvocationCallback.java    |  31 ----
 systests/microprofile/pom.xml                      |   2 +-
 13 files changed, 69 insertions(+), 292 deletions(-)

diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
index 617e8ee..0dfeec0 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
@@ -238,6 +238,9 @@ public final class ResponseImpl extends Response {
 
     public URI getLocation() {
         Object header = metadata.getFirst(HttpHeaders.LOCATION);
+        if (header == null) {
+            header = outMessage.get(Message.REQUEST_URI);
+        }
         return header == null || header instanceof URI ? (URI)header
             : URI.create(header.toString());
     }
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index ac0cace..cc5dfea 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -824,7 +824,6 @@ public class ClientProxyImpl extends AbstractClient implements
             }
         }
         return null;
-
     }
 
     private InvocationCallback<Object> doCheckAsyncCallback(OperationResourceInfo ori,
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
index 98443c5..227242f 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
@@ -22,6 +22,7 @@ package org.apache.cxf.jaxrs.client;
 import java.lang.reflect.Type;
 import java.util.Map;
 import java.util.concurrent.CancellationException;
+import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
@@ -64,7 +65,7 @@ public class JaxrsClientCallback<T> extends ClientCallback {
         return result;
     }
 
-    public Future<T> createFuture() {
+    public CompletableFuture<T> createFuture() {
         return new JaxrsResponseFuture<T>(this);
     }
 
@@ -96,7 +97,7 @@ public class JaxrsClientCallback<T> extends ClientCallback {
 
 
 
-    static class JaxrsResponseFuture<T> implements Future<T> {
+    static class JaxrsResponseFuture<T> extends CompletableFuture<T> implements Future<T> {
         JaxrsClientCallback<T> callback;
         JaxrsResponseFuture(JaxrsClientCallback<T> cb) {
             callback = cb;
diff --git a/rt/rs/microprofile-client/pom.xml b/rt/rs/microprofile-client/pom.xml
index 965da32..60a83ff 100644
--- a/rt/rs/microprofile-client/pom.xml
+++ b/rt/rs/microprofile-client/pom.xml
@@ -104,7 +104,7 @@
         <dependency>
             <groupId>org.eclipse.microprofile.rest.client</groupId>
             <artifactId>microprofile-rest-client-api</artifactId>
-            <version>1.1.0.20180323</version>
+            <version>1.1</version>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -119,7 +119,7 @@
         <dependency>
             <groupId>org.eclipse.microprofile.rest.client</groupId>
             <artifactId>microprofile-rest-client-tck</artifactId>
-            <version>1.1.0.20180323</version>
+            <version>1.1</version>
             <exclusions>
                 <exclusion>
                     <groupId>org.testng</groupId>
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
index 4ddf6a8..ed77152 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
@@ -50,6 +50,9 @@ public class CxfTypeSafeClientBuilder implements RestClientBuilder, Configurable
 
     @Override
     public RestClientBuilder executorService(ExecutorService executor) {
+        if (null == executor) {
+            throw new IllegalArgumentException("executor must not be null");
+        }
         this.executorService = executor;
         return this;
     }
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java
index 88de84c..3155164 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java
@@ -22,7 +22,6 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.lang.reflect.Parameter;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -34,7 +33,6 @@ import java.util.Set;
 import javax.ws.rs.HttpMethod;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.client.InvocationCallback;
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
@@ -47,6 +45,7 @@ final class Validator {
     private Validator() {
     }
 
+    
     public static void checkValid(Class<?> userType) throws RestClientDefinitionException {
         if (!userType.isInterface()) {
             throwException("VALIDATION_NOT_AN_INTERFACE", userType);
@@ -54,7 +53,6 @@ final class Validator {
         Method[] methods = userType.getMethods();
         checkMethodsForMultipleHTTPMethodAnnotations(methods);
         checkMethodsForInvalidURITemplates(userType, methods);
-        checkAsyncMethods(userType, methods);
     }
 
     private static void checkMethodsForMultipleHTTPMethodAnnotations(Method[] clientMethods)
@@ -131,18 +129,6 @@ final class Validator {
         }
     }
 
-    private static void checkAsyncMethods(Class<?> userType, Method[] clientMethods) {
-        for (Method method : clientMethods) {
-            boolean containsInvocationCallbackParm = Arrays.asList(method.getParameterTypes())
-                .contains(InvocationCallback.class);
-            Class<?> returnType = method.getReturnType();
-            if (containsInvocationCallbackParm && returnType != void.class) {
-                throwException("VALIDATION_ASYNC_METHOD_RETURNS_UNEXPECTED_TYPE", userType.getName(), 
-                               method.getName(), returnType.getName());
-            }
-        }
-    }
-
     private static void throwException(String msgKey, Object...msgParams) throws RestClientDefinitionException {
         Message msg = new Message(msgKey, BUNDLE, msgParams);
         throw new RestClientDefinitionException(msg.toString());
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/cdi/RestClientBean.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/cdi/RestClientBean.java
index 23868f6..d9f47e9 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/cdi/RestClientBean.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/cdi/RestClientBean.java
@@ -20,13 +20,13 @@ package org.apache.cxf.microprofile.client.cdi;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.NoSuchElementException;
 import java.util.Set;
 
 import javax.enterprise.context.Dependent;
@@ -45,6 +45,7 @@ import org.eclipse.microprofile.rest.client.inject.RestClient;
 
 public class RestClientBean implements Bean<Object>, PassivationCapable {
     public static final String REST_URL_FORMAT = "%s/mp-rest/url";
+    public static final String REST_URI_FORMAT = "%s/mp-rest/uri";
     public static final String REST_SCOPE_FORMAT = "%s/mp-rest/scope";
     private static final Default DEFAULT_LITERAL = new DefaultLiteral();
     private final Class<?> clientInterface;
@@ -79,12 +80,8 @@ public class RestClientBean implements Bean<Object>, PassivationCapable {
     @Override
     public Object create(CreationalContext<Object> creationalContext) {
         CxfTypeSafeClientBuilder builder = new CxfTypeSafeClientBuilder();
-        String baseUrl = getBaseUrl();
-        try {
-            return builder.baseUrl(new URL(baseUrl)).build(clientInterface);
-        } catch (MalformedURLException e) {
-            throw new IllegalArgumentException("The value of URL was invalid " + baseUrl);
-        }
+        String baseUri = getBaseUri();
+        return builder.baseUri(URI.create(baseUri)).build(clientInterface);
     }
 
     @Override
@@ -122,13 +119,24 @@ public class RestClientBean implements Bean<Object>, PassivationCapable {
         return false;
     }
 
-    private String getBaseUrl() {
-        String property = String.format(REST_URL_FORMAT, clientInterface.getName());
-        String baseURL = ConfigFacade.getValue(property, String.class);
-        if (baseURL == null) {
-            throw new IllegalStateException("Unable to determine base URL from configuration");
+    private String getBaseUri() {
+        String interfaceName = clientInterface.getName();
+        String property = String.format(REST_URI_FORMAT, interfaceName);
+        String baseURI = null;
+        try {
+            baseURI = ConfigFacade.getValue(property, String.class);
+        } catch (NoSuchElementException ex) {
+            // no-op - will revert to baseURL config value (as opposed to baseURI)
+        }
+        if (baseURI == null) {
+            // revert to baseUrl
+            property = String.format(REST_URL_FORMAT, interfaceName);
+            baseURI = ConfigFacade.getValue(property, String.class);
+            if (baseURI == null) {
+                throw new IllegalStateException("Unable to determine base URI from configuration");
+            }
         }
-        return baseURL;
+        return baseURI;
     }
 
     private Class<? extends Annotation> readScope() {
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
index 89dd84c..384b188 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
@@ -23,8 +23,8 @@ import java.lang.reflect.Type;
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CompletionStage;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
 
 import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.Response;
@@ -35,25 +35,19 @@ import org.apache.cxf.jaxrs.client.JaxrsClientCallback;
 import org.apache.cxf.jaxrs.client.LocalClientState;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.OperationResourceInfo;
-import org.apache.cxf.jaxrs.model.Parameter;
-import org.apache.cxf.jaxrs.model.ParameterType;
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.microprofile.client.MicroProfileClientProviderFactory;
 import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
 
 public class MicroProfileClientProxyImpl extends ClientProxyImpl {
-    private static final InvocationCallback<Object> MARKER_CALLBACK = new InvocationCallback<Object>() {
 
+    private static final InvocationCallback<Object> NO_OP_CALLBACK = new InvocationCallback<Object>() {
         @Override
-        public void completed(Object paramRESPONSE) {
-            // no-op
-        }
+        public void failed(Throwable t) { }
 
         @Override
-        public void failed(Throwable paramThrowable) {
-            // no-op
-        }
+        public void completed(Object o) { }
     };
 
     private final MPAsyncInvocationInterceptorImpl aiiImpl = new MPAsyncInvocationInterceptorImpl();
@@ -79,12 +73,19 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
     protected InvocationCallback<Object> checkAsyncCallback(OperationResourceInfo ori,
                                                             Map<String, Object> reqContext,
                                                             Message outMessage) {
-        if (Future.class.equals(ori.getMethodToInvoke().getReturnType())) {
-            return MARKER_CALLBACK;
+        InvocationCallback<Object> callback = outMessage.getContent(InvocationCallback.class);
+        if (callback == null && CompletionStage.class.equals(ori.getMethodToInvoke().getReturnType())) {
+            callback = NO_OP_CALLBACK;
+            outMessage.setContent(InvocationCallback.class, callback);
         }
-        return outMessage.getContent(InvocationCallback.class);
+        return callback;
     }
 
+    protected boolean checkAsyncReturnType(OperationResourceInfo ori,
+                                           Map<String, Object> reqContext,
+                                           Message outMessage) {
+        return CompletionStage.class.equals(ori.getMethodToInvoke().getReturnType());
+    }
 
     @Override
     protected Object doInvokeAsync(OperationResourceInfo ori, Message outMessage,
@@ -94,12 +95,8 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
 
         super.doInvokeAsync(ori, outMessage, asyncCallback);
 
-        Future<?> future = null;
-        if (asyncCallback == MARKER_CALLBACK) {
-            JaxrsClientCallback<?> cb = outMessage.getExchange().get(JaxrsClientCallback.class);
-            future = cb.createFuture();
-        }
-        return future;
+        JaxrsClientCallback<?> cb = outMessage.getExchange().get(JaxrsClientCallback.class);
+        return cb.createFuture();
     }
 
     @Override
@@ -127,29 +124,11 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
 
     @Override
     protected Class<?> getReturnType(Method method, Message outMessage) {
-        if (!outMessage.getExchange().isSynchronous()) {
-            InvocationCallback<?> callback = outMessage.getContent(InvocationCallback.class);
-            if (callback != null) {
-                Type t = getCallbackType(callback);
-                if (t instanceof Class) {
-                    return (Class<?>) t;
-                }
-            }
-        }
         Class<?> returnType = super.getReturnType(method, outMessage);
-        if (Future.class.isAssignableFrom(returnType)) {
+        if (CompletionStage.class.isAssignableFrom(returnType)) {
             Type t = method.getGenericReturnType();
             returnType = InjectionUtils.getActualType(t);
         }
         return returnType;
     }
-
-    @Override
-    protected boolean isIgnorableParameter(Method m, Parameter p) {
-        if (p.getType() == ParameterType.CONTEXT) {
-            return true;
-        }
-        return p.getType() == ParameterType.REQUEST_BODY
-            && m.getParameterTypes()[p.getIndex()] == InvocationCallback.class;
-    }
 }
diff --git a/systests/microprofile/client/async/pom.xml b/systests/microprofile/client/async/pom.xml
index b4e9167..1c854b4 100644
--- a/systests/microprofile/client/async/pom.xml
+++ b/systests/microprofile/client/async/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>cxf-microprofile-tck</artifactId>
         <groupId>org.apache.cxf.systests</groupId>
-        <version>3.2.5-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -32,7 +32,7 @@
     <url>http://cxf.apache.org</url>
     <properties>
         <cxf.geronimo.config.version>1.0</cxf.geronimo.config.version>
-        <cxf.microprofile.rest.client.version>1.1.0.20180323</cxf.microprofile.rest.client.version>
+        <cxf.microprofile.rest.client.version>1.1</cxf.microprofile.rest.client.version>
         <cxf.wiremock.params>--port=8765</cxf.wiremock.params>
         <cxf.weld.se.version>2.4.5.Final</cxf.weld.se.version>
         <cxf.arquillian.weld.container.version>2.0.0.Final</cxf.arquillian.weld.container.version>
diff --git a/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
index a25e865..19efc46 100644
--- a/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
+++ b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
@@ -19,24 +19,18 @@
 package org.apache.cxf.systest.microprofile.rest.client;
 
 import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CompletionStage;
 import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.TimeUnit;
 
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.Response;
 
 import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
 import com.github.tomakehurst.wiremock.junit.WireMockRule;
 
-import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncClientWithFuture;
-import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncClientWithInvocationCallback;
+import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncClientWithCompletionStage;
 import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncInvocationInterceptorFactoryTestImpl;
 import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncInvocationInterceptorFactoryTestImpl2;
 import org.apache.cxf.systest.microprofile.rest.client.mock.ThreadLocalClientFilter;
@@ -62,181 +56,16 @@ public class AsyncMethodTest extends Assert {
     @Rule
     public WireMockRule wireMockRule = new WireMockRule(WireMockConfiguration.options().dynamicPort());
 
-    private static class StringInvocationCallback implements InvocationCallback<String> {
-        private final List<Object> results;
-        private final CountDownLatch latch;
-
-        StringInvocationCallback(List<Object> results, CountDownLatch latch) {
-            this.results = results;
-            this.latch = latch;
-        }
-
-        /** {@inheritDoc}*/
-        @Override
-        public void completed(String response) {
-            results.add(response);
-            results.add(Thread.currentThread().getId());
-            latch.countDown();
-        }
-
-        /** {@inheritDoc}*/
-        @Override
-        public void failed(Throwable th) {
-            results.add(th);
-            results.add(Thread.currentThread().getId());
-            latch.countDown();
-        }
-    }
-
-    private static class ResponseInvocationCallback implements InvocationCallback<Response> {
-        final List<String> inboundList = new ArrayList<>();
-        Throwable throwable;
-        private final CountDownLatch latch;
-
-
-        ResponseInvocationCallback(CountDownLatch latch) {
-            this.latch = latch;
-        }
-
-        /** {@inheritDoc}*/
-        @Override
-        public void completed(Response response) {
-            inboundList.addAll(response.getStringHeaders().get("CXFTestResponse"));
-            latch.countDown();
-        }
-
-        /** {@inheritDoc}*/
-        @Override
-        public void failed(Throwable th) {
-            throwable = th;
-            latch.countDown();
-        }
-    }
-
-    @Test
-    public void testInvokesPostOperationWithRegisteredProvidersAsyncInvocationCallback() throws Exception {
-        wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
-                                .willReturn(aResponse()
-                                .withBody("this is the replaced writer input body will be removed")));
-        long mainThreadId = Thread.currentThread().getId();
-        String inputBody = "input body will be removed";
-        String expectedResponseBody = TestMessageBodyReader.REPLACED_BODY;
-
-        AsyncClientWithInvocationCallback api = RestClientBuilder.newBuilder()
-                .register(TestClientRequestFilter.class)
-                .register(TestClientResponseFilter.class)
-                .register(TestMessageBodyReader.class, 3)
-                .register(TestMessageBodyWriter.class)
-                .register(TestParamConverterProvider.class)
-                .register(TestReaderInterceptor.class)
-                .register(TestWriterInterceptor.class)
-                .baseUri(getBaseUri())
-                .build(AsyncClientWithInvocationCallback.class);
-
-        final List<Object> responseBodyList = new ArrayList<>();
-        final CountDownLatch latch = new CountDownLatch(1);
-
-        api.put(new StringInvocationCallback(responseBodyList, latch), inputBody);
-
-        latch.await(20, TimeUnit.SECONDS); // should need <1 second, but 20s timeout in case something goes wrong
-        assertEquals(2, responseBodyList.size());
-
-        assertEquals(expectedResponseBody, responseBodyList.get(0));
-        assertNotEquals(mainThreadId, responseBodyList.get(1));
-
-        assertEquals(TestClientResponseFilter.getAndResetValue(), 1);
-        assertEquals(TestClientRequestFilter.getAndResetValue(), 1);
-        assertEquals(TestReaderInterceptor.getAndResetValue(), 1);
-    }
-
-    @Test
-    public void testInvokesPostOperationWithRegisteredProvidersAsyncInvocationCallbackWithExecutor() throws Exception {
-        final String inputBody = "input body will be ignored";
-        wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
-                                .willReturn(aResponse()
-                                .withBody(inputBody)));
-        AsyncInvocationInterceptorFactoryTestImpl.INBOUND.remove();
-        AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.remove();
-        try {
-            final String asyncThreadName = "CXF-MPRestClientThread-1";
-
-            AsyncClientWithInvocationCallback api = RestClientBuilder.newBuilder()
-                .register(AsyncInvocationInterceptorFactoryTestImpl.class)
-                .register(AsyncInvocationInterceptorFactoryTestImpl2.class)
-                .register(ThreadLocalClientFilter.class)
-                .baseUri(getBaseUri())
-                .executorService(Executors.newSingleThreadExecutor(new ThreadFactory() {
-
-                    @Override
-                    public Thread newThread(Runnable r) {
-                        return new Thread(r, asyncThreadName);
-                    }
-                }))
-                .build(AsyncClientWithInvocationCallback.class);
-
-            final CountDownLatch latch = new CountDownLatch(1);
-
-            ResponseInvocationCallback callback = new ResponseInvocationCallback(latch);
-            api.put(callback, inputBody);
-            List<String> outboundList = AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.get();
-            assertEquals(4, outboundList.size());
-
-            // ensure filters and asyncInvocationInterceptors are executed in the correct order and the correct thread
-            // outbound:
-            assertEquals(ThreadLocalClientFilter.class.getSimpleName(), outboundList.get(0));
-            assertEquals(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName(), outboundList.get(1));
-            assertEquals(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName(), outboundList.get(2));
-            assertEquals(Thread.currentThread().getName(), outboundList.get(3));
-
-            // inbound:
-            latch.await(20, TimeUnit.SECONDS); // should need <1 second, but 20s timeout in case something goes wrong
-            assertNull(callback.throwable);
-            List<String> responseList = callback.inboundList;
-            assertEquals(4, responseList.size());
-
-            assertEquals(asyncThreadName, responseList.get(0));
-            assertEquals(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName(), responseList.get(1));
-            assertEquals(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName(), responseList.get(2));
-            assertEquals(ThreadLocalClientFilter.class.getSimpleName(), responseList.get(3));
-        } finally {
-            AsyncInvocationInterceptorFactoryTestImpl.INBOUND.remove();
-            AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.remove();
-        }
-    }
-
-    @Test
-    public void testInvokesPostOperationWithRegisteredProvidersAsyncInvocationCallbackWithException() throws Exception {
-        wireMockRule.stubFor(put(urlEqualTo("/Missing/test"))
-                                .willReturn(status(404)));
-        long mainThreadId = Thread.currentThread().getId();
-        String inputBody = "input body will be removed";
-
-        AsyncClientWithInvocationCallback api = RestClientBuilder.newBuilder()
-                .baseUrl(new URL("http://localhost:" + wireMockRule.port() + "/Missing"))
-                .build(AsyncClientWithInvocationCallback.class);
-
-        final List<Object> responseBodyList = new ArrayList<>();
-        final CountDownLatch latch = new CountDownLatch(1);
-
-        api.put(new StringInvocationCallback(responseBodyList, latch), inputBody);
-
-        latch.await(20, TimeUnit.SECONDS); // should need <1 second, but 20s timeout in case something goes wrong
-        assertEquals(2, responseBodyList.size());
-        Object body = responseBodyList.get(0);
-
-        assertTrue(body instanceof WebApplicationException);
-        assertNotEquals(mainThreadId, responseBodyList.get(1));
-    }
 
     @Test
-    public void testInvokesPostOperationWithRegisteredProvidersAsyncFuture() throws Exception {
+    public void testInvokesPostOperationWithRegisteredProvidersAsyncCompletionStage() throws Exception {
         wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
                                 .willReturn(aResponse()
                                 .withBody("this is the replaced writer input body will be removed")));
         String inputBody = "input body will be removed";
         String expectedResponseBody = TestMessageBodyReader.REPLACED_BODY;
 
-        AsyncClientWithFuture api = RestClientBuilder.newBuilder()
+        AsyncClientWithCompletionStage api = RestClientBuilder.newBuilder()
                 .register(TestClientRequestFilter.class)
                 .register(TestClientResponseFilter.class)
                 .register(TestMessageBodyReader.class, 3)
@@ -245,12 +74,12 @@ public class AsyncMethodTest extends Assert {
                 .register(TestReaderInterceptor.class)
                 .register(TestWriterInterceptor.class)
                 .baseUri(getBaseUri())
-                .build(AsyncClientWithFuture.class);
+                .build(AsyncClientWithCompletionStage.class);
 
-        Future<Response> future = api.put(inputBody);
+        CompletionStage<Response> cs = api.put(inputBody);
 
         // should need <1 second, but 20s timeout in case something goes wrong
-        Response response = future.get(20, TimeUnit.SECONDS);
+        Response response = cs.toCompletableFuture().get(20, TimeUnit.SECONDS);
         String actualResponseBody = response.readEntity(String.class);
 
         assertEquals(expectedResponseBody, actualResponseBody);
@@ -261,7 +90,7 @@ public class AsyncMethodTest extends Assert {
     }
 
     @Test
-    public void testInvokesPostOperationWithRegisteredProvidersAsyncFutureWithExecutor() throws Exception {
+    public void testInvokesPostOperationWithRegisteredProvidersAsyncCompletionStageWithExecutor() throws Exception {
         final String inputBody = "input body will be ignored";
         wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
                                 .willReturn(aResponse()
@@ -271,7 +100,7 @@ public class AsyncMethodTest extends Assert {
         try {
             final String asyncThreadName = "CXF-MPRestClientThread-2";
 
-            AsyncClientWithFuture api = RestClientBuilder.newBuilder()
+            AsyncClientWithCompletionStage api = RestClientBuilder.newBuilder()
                 .register(AsyncInvocationInterceptorFactoryTestImpl.class)
                 .register(AsyncInvocationInterceptorFactoryTestImpl2.class)
                 .register(ThreadLocalClientFilter.class)
@@ -283,9 +112,9 @@ public class AsyncMethodTest extends Assert {
                         return new Thread(r, asyncThreadName);
                     }
                 }))
-                .build(AsyncClientWithFuture.class);
+                .build(AsyncClientWithCompletionStage.class);
 
-            Future<Response> future = api.put(inputBody);
+            CompletionStage<Response> cs = api.put(inputBody);
             List<String> outboundList = AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.get();
             assertEquals(4, outboundList.size());
 
@@ -298,7 +127,7 @@ public class AsyncMethodTest extends Assert {
 
             // inbound:
             // should need <1 second, but 20s timeout in case something goes wrong
-            Response response = future.get(20, TimeUnit.SECONDS);
+            Response response = cs.toCompletableFuture().get(20, TimeUnit.SECONDS);
 
             List<String> responseList = response.getStringHeaders().get("CXFTestResponse");
             assertEquals(4, responseList.size());
diff --git a/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithCompletionStage.java
similarity index 87%
rename from systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java
rename to systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithCompletionStage.java
index b2408d1..d30a2d0 100644
--- a/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java
+++ b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithCompletionStage.java
@@ -19,15 +19,15 @@
 
 package org.apache.cxf.systest.microprofile.rest.client.mock;
 
-import java.util.concurrent.Future;
+import java.util.concurrent.CompletionStage;
 
 import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.core.Response;
 
-public interface AsyncClientWithFuture {
+public interface AsyncClientWithCompletionStage {
 
     @PUT
     @Path("/test")
-    Future<Response> put(String text);
+    CompletionStage<Response> put(String text);
 }
diff --git a/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java
deleted file mode 100644
index df0b352..0000000
--- a/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java
+++ /dev/null
@@ -1,31 +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.apache.cxf.systest.microprofile.rest.client.mock;
-
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.client.InvocationCallback;
-
-public interface AsyncClientWithInvocationCallback {
-
-    @PUT
-    @Path("/test")
-    void put(InvocationCallback<?> callback, String text);
-}
diff --git a/systests/microprofile/pom.xml b/systests/microprofile/pom.xml
index 90cc036..a2524c9 100644
--- a/systests/microprofile/pom.xml
+++ b/systests/microprofile/pom.xml
@@ -33,7 +33,7 @@
     <url>http://cxf.apache.org</url>
     <properties>
         <cxf.geronimo.config.version>1.0</cxf.geronimo.config.version>
-        <cxf.microprofile.rest.client.version>1.1.0.20180323</cxf.microprofile.rest.client.version>
+        <cxf.microprofile.rest.client.version>1.1</cxf.microprofile.rest.client.version>
         <cxf.wiremock.params>--port=8765</cxf.wiremock.params>
         <cxf.weld.se.version>2.4.5.Final</cxf.weld.se.version>
         <cxf.arquillian.weld.container.version>2.0.0.Final</cxf.arquillian.weld.container.version>


[cxf] 06/08: Reset pom version to 3.2.6

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit b04462f8c90e29ac0b9d118214c83807c5ed1299
Author: Andy McCright <j....@gmail.com>
AuthorDate: Tue Jul 17 17:50:22 2018 -0500

    Reset pom version to 3.2.6
---
 systests/microprofile/client/async/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/systests/microprofile/client/async/pom.xml b/systests/microprofile/client/async/pom.xml
index 0433018..c8477f8 100644
--- a/systests/microprofile/client/async/pom.xml
+++ b/systests/microprofile/client/async/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>cxf-microprofile-tck</artifactId>
         <groupId>org.apache.cxf.systests</groupId>
-        <version>3.3.0-SNAPSHOT</version>
+        <version>3.2.6-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>


[cxf] 01/08: [CXF-7673] MP Rest Client 1.1 Impl

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit b68becf2ff654ea5898f8c2cf5489a137507f2b3
Author: Andy McCright <j....@gmail.com>
AuthorDate: Thu Mar 22 16:53:35 2018 -0500

    [CXF-7673] MP Rest Client 1.1 Impl
    
    Includes async method support and tests, updated TCK, etc.
---
 .../apache/cxf/jaxrs/client/ClientProxyImpl.java   |  30 +-
 rt/rs/microprofile-client/pom.xml                  |   7 +
 .../client/CxfTypeSafeClientBuilder.java           |  17 +-
 .../cxf/microprofile/client/Messages.properties    |   6 +-
 .../client/MicroProfileClientFactoryBean.java      |  13 +-
 .../client/MicroProfileClientProviderFactory.java  |  13 +
 .../apache/cxf/microprofile/client/Validator.java  |  16 +-
 .../proxy/MPAsyncInvocationInterceptorImpl.java    |  73 +++++
 .../MPAsyncInvocationInterceptorPostAsyncImpl.java |  58 ++++
 .../client/proxy/MicroProfileClientProxyImpl.java  |  85 +++++-
 .../client/CxfTypeSafeClientBuilderTest.java       |   5 +-
 .../client/weld/pom.xml                            |   0
 .../{microprofile => microprofile-tck}/pom.xml     |  10 +-
 systests/microprofile/pom.xml                      |  34 ++-
 .../microprofile/rest/client/AsyncMethodTest.java  | 324 +++++++++++++++++++++
 .../rest/client/mock/AsyncClientWithFuture.java    |  33 +++
 .../mock/AsyncClientWithInvocationCallback.java    |  31 ++
 .../AsyncInvocationInterceptorFactoryTestImpl.java |  62 ++++
 ...AsyncInvocationInterceptorFactoryTestImpl2.java |  57 ++++
 .../rest/client/mock/ThreadLocalClientFilter.java  |  49 ++++
 20 files changed, 894 insertions(+), 29 deletions(-)

diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index 8ac8866..35bdbc2 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -285,7 +285,8 @@ public class ClientProxyImpl extends AbstractClient implements
             return true;
         }
         return p.getType() == ParameterType.REQUEST_BODY
-            && m.getParameterTypes()[p.getIndex()] == AsyncResponse.class;
+            && (m.getParameterTypes()[p.getIndex()] == AsyncResponse.class
+                || m.getParameterTypes()[p.getIndex()] == InvocationCallback.class);
     }
 
     private static int getBodyIndex(MultivaluedMap<ParameterType, Parameter> map,
@@ -767,15 +768,18 @@ public class ClientProxyImpl extends AbstractClient implements
             }
             outMessage.getInterceptorChain().add(bodyWriter);
 
+            int invocationCallbackIdx = Arrays.asList(ori.getInParameterTypes()).indexOf(InvocationCallback.class);
+            if (invocationCallbackIdx > -1) {
+                outMessage.setContent(InvocationCallback.class, methodParams[invocationCallbackIdx]);
+            }
             Map<String, Object> reqContext = getRequestContext(outMessage);
             reqContext.put(OperationResourceInfo.class.getName(), ori);
             reqContext.put(PROXY_METHOD_PARAM_BODY_INDEX, bodyIndex);
 
             // execute chain
-            InvocationCallback<Object> asyncCallback = checkAsyncCallback(ori, reqContext);
+            InvocationCallback<Object> asyncCallback = checkAsyncCallback(ori, reqContext, outMessage);
             if (asyncCallback != null) {
-                doInvokeAsync(ori, outMessage, asyncCallback);
-                return null;
+                return doInvokeAsync(ori, outMessage, asyncCallback);
             }
             doRunInterceptorChain(outMessage);
 
@@ -801,8 +805,9 @@ public class ClientProxyImpl extends AbstractClient implements
 
     }
 
-    private InvocationCallback<Object> checkAsyncCallback(OperationResourceInfo ori,
-                                                          Map<String, Object> reqContext) {
+    protected InvocationCallback<Object> checkAsyncCallback(OperationResourceInfo ori,
+                                                          Map<String, Object> reqContext,
+                                                          Message outMessage) {
         Object callbackProp = reqContext.get(InvocationCallback.class.getName());
         if (callbackProp != null) {
             if (callbackProp instanceof Collection) {
@@ -837,7 +842,7 @@ public class ClientProxyImpl extends AbstractClient implements
         return null;
     }
 
-    protected void doInvokeAsync(OperationResourceInfo ori, Message outMessage,
+    protected Object doInvokeAsync(OperationResourceInfo ori, Message outMessage,
                                  InvocationCallback<Object> asyncCallback) {
         outMessage.getExchange().setSynchronous(false);
         setAsyncMessageObserverIfNeeded(outMessage.getExchange());
@@ -846,7 +851,7 @@ public class ClientProxyImpl extends AbstractClient implements
         outMessage.getExchange().put(JaxrsClientCallback.class, cb);
         doRunInterceptorChain(outMessage);
 
-
+        return null;
     }
 
     @Override
@@ -873,7 +878,8 @@ public class ClientProxyImpl extends AbstractClient implements
 
             Method method = outMessage.getExchange().get(Method.class);
             checkResponse(method, r, outMessage);
-            if (method.getReturnType() == Void.class || method.getReturnType() == Void.TYPE) {
+            if (outMessage.getExchange().isSynchronous() && (method.getReturnType() == Void.class 
+                                                            || method.getReturnType() == Void.TYPE)) {
                 return null;
             }
             if (method.getReturnType() == Response.class
@@ -885,7 +891,7 @@ public class ClientProxyImpl extends AbstractClient implements
                 r.bufferEntity();
             }
 
-            Class<?> returnType = method.getReturnType();
+            Class<?> returnType = getReturnType(method, outMessage);
             Type genericType =
                 InjectionUtils.processGenericTypeIfNeeded(serviceCls,
                                                           returnType,
@@ -901,6 +907,10 @@ public class ClientProxyImpl extends AbstractClient implements
         }
     }
 
+    protected Class<?> getReturnType(Method method, Message outMessage) {
+        return method.getReturnType();
+    }
+
     public Object getInvocationHandler() {
         return this;
     }
diff --git a/rt/rs/microprofile-client/pom.xml b/rt/rs/microprofile-client/pom.xml
index 8b5608a..965da32 100644
--- a/rt/rs/microprofile-client/pom.xml
+++ b/rt/rs/microprofile-client/pom.xml
@@ -71,6 +71,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-local</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
@@ -99,6 +104,7 @@
         <dependency>
             <groupId>org.eclipse.microprofile.rest.client</groupId>
             <artifactId>microprofile-rest-client-api</artifactId>
+            <version>1.1.0.20180323</version>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -113,6 +119,7 @@
         <dependency>
             <groupId>org.eclipse.microprofile.rest.client</groupId>
             <artifactId>microprofile-rest-client-tck</artifactId>
+            <version>1.1.0.20180323</version>
             <exclusions>
                 <exclusion>
                     <groupId>org.testng</groupId>
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
index 5f62a56..4ddf6a8 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilder.java
@@ -18,9 +18,11 @@
  */
 package org.apache.cxf.microprofile.client;
 
+import java.net.URI;
 import java.net.URL;
 import java.util.Map;
 import java.util.Objects;
+import java.util.concurrent.ExecutorService;
 
 import javax.ws.rs.core.Configurable;
 import javax.ws.rs.core.Configuration;
@@ -30,6 +32,7 @@ import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
 
 public class CxfTypeSafeClientBuilder implements RestClientBuilder, Configurable<RestClientBuilder> {
     private String baseUri;
+    private ExecutorService executorService;
     private final MicroProfileClientConfigurableImpl<RestClientBuilder> configImpl =
             new MicroProfileClientConfigurableImpl<>(this);
 
@@ -40,6 +43,18 @@ public class CxfTypeSafeClientBuilder implements RestClientBuilder, Configurable
     }
 
     @Override
+    public RestClientBuilder baseUri(URI uri) {
+        this.baseUri = Objects.requireNonNull(uri).toString();
+        return this;
+    }
+
+    @Override
+    public RestClientBuilder executorService(ExecutorService executor) {
+        this.executorService = executor;
+        return this;
+    }
+
+    @Override
     public <T> T build(Class<T> aClass) {
         if (baseUri == null) {
             throw new IllegalStateException("baseUrl not set");
@@ -59,7 +74,7 @@ public class CxfTypeSafeClientBuilder implements RestClientBuilder, Configurable
             }
         }
         MicroProfileClientFactoryBean bean = new MicroProfileClientFactoryBean(configImpl,
-                baseUri, aClass);
+                baseUri, aClass, executorService);
         return bean.create(aClass);
     }
 
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Messages.properties b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Messages.properties
index 2280582..f4c7633 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Messages.properties
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Messages.properties
@@ -22,4 +22,8 @@
 VALIDATION_NOT_AN_INTERFACE=The type, {0},  passed in to the build method is not an interface.
 VALIDATION_METHOD_WITH_MULTIPLE_VERBS=The client interface contains a method, {0} annotated with more than one HTTP method: {1}
 VALIDATION_UNRESOLVED_PATH_PARAMS=The client interface, {0} has one or more methods with unresolved path template variables: {1}
-VALIDATION_EXTRA_PATH_PARAMS=The client interface, {0} has one or more extra path segments not in the template: {1}
\ No newline at end of file
+VALIDATION_EXTRA_PATH_PARAMS=The client interface, {0} has one or more extra path segments not in the template: {1}
+VALIDATION_ASYNC_METHOD_RETURNS_UNEXPECTED_TYPE=The client interface, {0} has an asynchronous method, {1} that returns an unexpected type, {2}. If the method has an InvocationCallback parameter, then it must be return void.
+
+ASYNC_INTERCEPTOR_EXCEPTION_PREPARE_CONTEXT=The AsyncInvocationInterceptor, {0} has thrown an exception during the invocation of the prepareContext method. This interceptor's applyContext method will not be invoked.
+ASYNC_INTERCEPTOR_EXCEPTION_APPLY_CONTEXT=The AsyncInvocationInterceptor, {0} has thrown an exception during the invocation of the applyContext method.
\ No newline at end of file
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientFactoryBean.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientFactoryBean.java
index a94af36..9abee1a 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientFactoryBean.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientFactoryBean.java
@@ -24,6 +24,7 @@ import java.util.Comparator;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.concurrent.ExecutorService;
 
 import javax.ws.rs.client.ClientRequestFilter;
 import javax.ws.rs.client.ClientResponseFilter;
@@ -48,12 +49,14 @@ public class MicroProfileClientFactoryBean extends JAXRSClientFactoryBean {
     private Configuration configuration;
     private ClassLoader proxyLoader;
     private boolean inheritHeaders;
+    private ExecutorService executorService;
 
     public MicroProfileClientFactoryBean(MicroProfileClientConfigurableImpl<RestClientBuilder> configuration,
-                                         String baseUri, Class<?> aClass) {
+                                         String baseUri, Class<?> aClass, ExecutorService executorService) {
         super();
         this.configuration = configuration.getConfiguration();
         this.comparator = MicroProfileClientProviderFactory.createComparator(this);
+        this.executorService = executorService;
         super.setAddress(baseUri);
         super.setServiceClass(aClass);
         super.setProviderComparator(comparator);
@@ -78,6 +81,10 @@ public class MicroProfileClientFactoryBean extends JAXRSClientFactoryBean {
         this.inheritHeaders = inheritHeaders;
     }
 
+    public ExecutorService getExecutorService() {
+        return executorService;
+    }
+
     @Override
     protected void initClient(AbstractClient client, Endpoint ep, boolean addHeaders) {
         super.initClient(client, ep, addHeaders);
@@ -92,10 +99,10 @@ public class MicroProfileClientFactoryBean extends JAXRSClientFactoryBean {
                                                 ClientState actualState, Object[] varValues) {
         if (actualState == null) {
             return new MicroProfileClientProxyImpl(URI.create(getAddress()), proxyLoader, cri, isRoot,
-                    inheritHeaders, varValues);
+                    inheritHeaders, executorService, varValues);
         } else {
             return new MicroProfileClientProxyImpl(actualState, proxyLoader, cri, isRoot,
-                    inheritHeaders, varValues);
+                    inheritHeaders, executorService, varValues);
         }
     }
 
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java
index 01d16fe..031892c 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java
@@ -33,12 +33,15 @@ import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.jaxrs.model.ProviderInfo;
 import org.apache.cxf.jaxrs.provider.ProviderFactory;
 import org.apache.cxf.message.Message;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory;
 import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
 
 public final class MicroProfileClientProviderFactory extends ProviderFactory {
     static final String CLIENT_FACTORY_NAME = MicroProfileClientProviderFactory.class.getName();
     private List<ProviderInfo<ResponseExceptionMapper<?>>> responseExceptionMappers =
             new ArrayList<ProviderInfo<ResponseExceptionMapper<?>>>(1);
+    private List<ProviderInfo<AsyncInvocationInterceptorFactory>> asyncInvocationInterceptorFactories =
+            new ArrayList<ProviderInfo<AsyncInvocationInterceptorFactory>>();
     private final Comparator<ProviderInfo<?>> comparator;
 
     private MicroProfileClientProviderFactory(Bus bus, Comparator<ProviderInfo<?>> comparator) {
@@ -82,11 +85,16 @@ public final class MicroProfileClientProviderFactory extends ProviderFactory {
             if (ResponseExceptionMapper.class.isAssignableFrom(providerCls)) {
                 addProviderToList(responseExceptionMappers, provider);
             }
+            if (AsyncInvocationInterceptorFactory.class.isAssignableFrom(providerCls)) {
+                addProviderToList(asyncInvocationInterceptorFactories, provider);
+            }
 
         }
         responseExceptionMappers.sort(comparator);
+        asyncInvocationInterceptorFactories.sort(comparator);
 
         injectContextProxies(responseExceptionMappers);
+        injectContextProxies(asyncInvocationInterceptorFactories);
     }
 
     public List<ResponseExceptionMapper<?>> createResponseExceptionMapper(Message m, Class<?> paramType) {
@@ -101,10 +109,15 @@ public final class MicroProfileClientProviderFactory extends ProviderFactory {
                                             .collect(Collectors.toList()));
     }
 
+    public List<ProviderInfo<AsyncInvocationInterceptorFactory>> getAsyncInvocationInterceptorFactories() {
+        return asyncInvocationInterceptorFactories;
+    }
+
     @Override
     public void clearProviders() {
         super.clearProviders();
         responseExceptionMappers.clear();
+        asyncInvocationInterceptorFactories.clear();
     }
 
     @Override
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java
index bcabd29..88de84c 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/Validator.java
@@ -22,6 +22,7 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.lang.reflect.Parameter;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -33,6 +34,7 @@ import java.util.Set;
 import javax.ws.rs.HttpMethod;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
+import javax.ws.rs.client.InvocationCallback;
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
@@ -45,7 +47,6 @@ final class Validator {
     private Validator() {
     }
 
-
     public static void checkValid(Class<?> userType) throws RestClientDefinitionException {
         if (!userType.isInterface()) {
             throwException("VALIDATION_NOT_AN_INTERFACE", userType);
@@ -53,6 +54,7 @@ final class Validator {
         Method[] methods = userType.getMethods();
         checkMethodsForMultipleHTTPMethodAnnotations(methods);
         checkMethodsForInvalidURITemplates(userType, methods);
+        checkAsyncMethods(userType, methods);
     }
 
     private static void checkMethodsForMultipleHTTPMethodAnnotations(Method[] clientMethods)
@@ -129,6 +131,18 @@ final class Validator {
         }
     }
 
+    private static void checkAsyncMethods(Class<?> userType, Method[] clientMethods) {
+        for (Method method : clientMethods) {
+            boolean containsInvocationCallbackParm = Arrays.asList(method.getParameterTypes())
+                .contains(InvocationCallback.class);
+            Class<?> returnType = method.getReturnType();
+            if (containsInvocationCallbackParm && returnType != void.class) {
+                throwException("VALIDATION_ASYNC_METHOD_RETURNS_UNEXPECTED_TYPE", userType.getName(), 
+                               method.getName(), returnType.getName());
+            }
+        }
+    }
+
     private static void throwException(String msgKey, Object...msgParams) throws RestClientDefinitionException {
         Message msg = new Message(msgKey, BUNDLE, msgParams);
         throw new RestClientDefinitionException(msg.toString());
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java
new file mode 100644
index 0000000..cb8ad6e
--- /dev/null
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java
@@ -0,0 +1,73 @@
+/**
+ * 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.apache.cxf.microprofile.client.proxy;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.jaxrs.model.ProviderInfo;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.microprofile.client.MicroProfileClientProviderFactory;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory;
+
+
+public class MPAsyncInvocationInterceptorImpl extends AbstractPhaseInterceptor<Message> {
+    private static final Logger LOG = LogUtils.getL7dLogger(MPAsyncInvocationInterceptorImpl.class);
+
+    private final List<AsyncInvocationInterceptor> interceptors = new ArrayList<>();
+
+    
+    MPAsyncInvocationInterceptorImpl() {
+        super(Phase.POST_MARSHAL);
+    }
+
+    List<AsyncInvocationInterceptor> getInterceptors() {
+        return interceptors;
+    }
+
+    /** {@inheritDoc}*/
+    @Override
+    public void handleMessage(Message message) throws Fault {
+        MicroProfileClientProviderFactory factory = MicroProfileClientProviderFactory.getInstance(message);
+        List<ProviderInfo<AsyncInvocationInterceptorFactory>> aiiProviderList = 
+            factory.getAsyncInvocationInterceptorFactories();
+        //interceptors.addAll(aiiProviderList.size());
+        for (ProviderInfo<AsyncInvocationInterceptorFactory> providerInfo: aiiProviderList) {
+            AsyncInvocationInterceptor aiInterceptor = providerInfo.getProvider().newInterceptor();
+            try {
+                aiInterceptor.prepareContext();
+                interceptors.add(0, aiInterceptor); // sort in reverse order
+            } catch (Throwable t) {
+                LOG.log(Level.WARNING, "ASYNC_INTERCEPTOR_EXCEPTION_PREPARE_CONTEXT", 
+                        new Object[]{aiInterceptor.getClass().getName(), t});
+            }
+        }
+        
+        //message.getInterceptorChain().add(new MPAsyncInvocationInterceptorPostAsyncImpl(interceptors));
+    }
+
+}
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorPostAsyncImpl.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorPostAsyncImpl.java
new file mode 100644
index 0000000..d5c653b
--- /dev/null
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorPostAsyncImpl.java
@@ -0,0 +1,58 @@
+/**
+ * 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.apache.cxf.microprofile.client.proxy;
+
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+
+/**
+ * 
+ */
+public class MPAsyncInvocationInterceptorPostAsyncImpl extends AbstractPhaseInterceptor<Message> {
+    private static final Logger LOG = LogUtils.getL7dLogger(MPAsyncInvocationInterceptorPostAsyncImpl.class);
+
+    private List<AsyncInvocationInterceptor> interceptors;
+
+    public MPAsyncInvocationInterceptorPostAsyncImpl(List<AsyncInvocationInterceptor> interceptors) {
+        super(Phase.PRE_PROTOCOL);
+        this.interceptors = interceptors;
+    }
+
+    /** {@inheritDoc}*/
+    @Override
+    public void handleMessage(Message message) throws Fault {
+        for (AsyncInvocationInterceptor interceptor : interceptors) {
+            try {
+                interceptor.applyContext();
+            } catch (Throwable t) {
+                LOG.log(Level.WARNING, "ASYNC_INTERCEPTOR_EXCEPTION_APPLY_CONTEXT", 
+                        new Object[]{interceptor.getClass().getName(), t});
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
index 617efec..5c5d103 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
@@ -19,27 +19,85 @@
 package org.apache.cxf.microprofile.client.proxy;
 
 import java.lang.reflect.Method;
+import java.lang.reflect.Type;
 import java.net.URI;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
 
+import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.Response;
 
 import org.apache.cxf.jaxrs.client.ClientProxyImpl;
 import org.apache.cxf.jaxrs.client.ClientState;
+import org.apache.cxf.jaxrs.client.JaxrsClientCallback;
+import org.apache.cxf.jaxrs.client.LocalClientState;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
+import org.apache.cxf.jaxrs.model.OperationResourceInfo;
+import org.apache.cxf.jaxrs.utils.InjectionUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.microprofile.client.MicroProfileClientProviderFactory;
 import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
 
 public class MicroProfileClientProxyImpl extends ClientProxyImpl {
+    private static final InvocationCallback<Object> MARKER_CALLBACK = new InvocationCallback<Object>() {
+
+        @Override
+        public void completed(Object paramRESPONSE) {
+            // no-op
+        }
+
+        @Override
+        public void failed(Throwable paramThrowable) {
+            // no-op
+        }
+    };
+    
+    private final MPAsyncInvocationInterceptorImpl aiiImpl = new MPAsyncInvocationInterceptorImpl();
+    
     public MicroProfileClientProxyImpl(URI baseURI, ClassLoader loader, ClassResourceInfo cri,
-                                       boolean isRoot, boolean inheritHeaders, Object... varValues) {
-        super(baseURI, loader, cri, isRoot, inheritHeaders, varValues);
+                                       boolean isRoot, boolean inheritHeaders, ExecutorService executorService,
+                                       Object... varValues) {
+        super(new LocalClientState(baseURI), loader, cri, isRoot, inheritHeaders, varValues);
+        cfg.getRequestContext().put(EXECUTOR_SERVICE_PROPERTY, executorService);
     }
 
     public MicroProfileClientProxyImpl(ClientState initialState, ClassLoader loader, ClassResourceInfo cri,
-                                       boolean isRoot, boolean inheritHeaders, Object... varValues) {
+                                       boolean isRoot, boolean inheritHeaders, ExecutorService executorService,
+                                       Object... varValues) {
         super(initialState, loader, cri, isRoot, inheritHeaders, varValues);
+        cfg.getRequestContext().put(EXECUTOR_SERVICE_PROPERTY, executorService);
+    }
+
+    
+
+    @SuppressWarnings("unchecked")
+    @Override
+    protected InvocationCallback<Object> checkAsyncCallback(OperationResourceInfo ori,
+                                                            Map<String, Object> reqContext,
+                                                            Message outMessage) {
+        if (Future.class.equals(ori.getMethodToInvoke().getReturnType())) {
+            return MARKER_CALLBACK;
+        }
+        return outMessage.getContent(InvocationCallback.class);
+    }
+
+    
+    @Override
+    protected Object doInvokeAsync(OperationResourceInfo ori, Message outMessage,
+                                   InvocationCallback<Object> asyncCallback) {
+        outMessage.getInterceptorChain().add(aiiImpl);
+        cfg.getInInterceptors().add(new MPAsyncInvocationInterceptorPostAsyncImpl(aiiImpl.getInterceptors()));
+        
+        super.doInvokeAsync(ori, outMessage, asyncCallback);
+        
+        Future<?> future = null;
+        if (asyncCallback == MARKER_CALLBACK) {
+            JaxrsClientCallback<?> cb = outMessage.getExchange().get(JaxrsClientCallback.class);
+            future = cb.createFuture();
+        }
+        return future;
     }
 
     @Override
@@ -64,4 +122,25 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
             }
         }
     }
+
+    @Override
+    protected Class<?> getReturnType(Method method, Message outMessage) {
+        if (!outMessage.getExchange().isSynchronous()) {
+            InvocationCallback<?> callback = outMessage.getContent(InvocationCallback.class);
+            if (callback != null) {
+                Type t = getCallbackType(callback);
+                if (t instanceof Class) {
+                    return (Class<?>) t;
+                }
+            }
+        }
+        Class<?> returnType = super.getReturnType(method, outMessage);
+        if (Future.class.isAssignableFrom(returnType)) {
+            Type t = method.getGenericReturnType();
+            returnType = InjectionUtils.getActualType(t);
+            System.out.println("returnType (from future) = " + returnType);
+        }
+        System.out.println("returnType = " + returnType);
+        return returnType;
+    }
 }
diff --git a/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java b/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java
index 16fb8a9..bc38d62 100644
--- a/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java
+++ b/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java
@@ -19,8 +19,11 @@
 package org.apache.cxf.microprofile.client;
 
 import java.net.URL;
-
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
 import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.Response;
 
 import org.apache.cxf.microprofile.client.mock.EchoClientReqFilter;
diff --git a/systests/microprofile/client/weld/pom.xml b/systests/microprofile-tck/client/weld/pom.xml
similarity index 100%
rename from systests/microprofile/client/weld/pom.xml
rename to systests/microprofile-tck/client/weld/pom.xml
diff --git a/systests/microprofile/pom.xml b/systests/microprofile-tck/pom.xml
similarity index 94%
copy from systests/microprofile/pom.xml
copy to systests/microprofile-tck/pom.xml
index 35e7aa4..3c29018 100644
--- a/systests/microprofile/pom.xml
+++ b/systests/microprofile-tck/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>cxf-parent</artifactId>
         <groupId>org.apache.cxf</groupId>
-        <version>3.2.6-SNAPSHOT</version>
+        <version>3.2.5-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -33,7 +33,7 @@
     <url>http://cxf.apache.org</url>
     <properties>
         <cxf.geronimo.config.version>1.0</cxf.geronimo.config.version>
-        <cxf.microprofile.rest.client.version>1.0</cxf.microprofile.rest.client.version>
+        <cxf.microprofile.rest.client.version>1.1.0.20180323</cxf.microprofile.rest.client.version>
         <cxf.wiremock.params>--port=8765</cxf.wiremock.params>
         <cxf.weld.se.version>2.4.5.Final</cxf.weld.se.version>
         <cxf.arquillian.weld.container.version>2.0.0.Final</cxf.arquillian.weld.container.version>
@@ -47,6 +47,12 @@
     <dependencyManagement>
         <dependencies>
             <dependency>
+                <groupId>org.testng</groupId>
+                <artifactId>testng</artifactId>
+                <version>6.14.2</version>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
                 <groupId>org.jboss.arquillian.testng</groupId>
                 <artifactId>arquillian-testng-container</artifactId>
                 <version>${cxf.arquillian.version}</version>
diff --git a/systests/microprofile/pom.xml b/systests/microprofile/pom.xml
index 35e7aa4..c70bdcf 100644
--- a/systests/microprofile/pom.xml
+++ b/systests/microprofile/pom.xml
@@ -27,13 +27,13 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.cxf.systests</groupId>
     <artifactId>cxf-microprofile-tck</artifactId>
-    <packaging>pom</packaging>
+    <!--packaging>jar</packaging -->
     <name>Apache CXF MicroProfile TCKs</name>
     <description>Apache CXF System Tests - MicroProfile TCKs</description>
     <url>http://cxf.apache.org</url>
     <properties>
         <cxf.geronimo.config.version>1.0</cxf.geronimo.config.version>
-        <cxf.microprofile.rest.client.version>1.0</cxf.microprofile.rest.client.version>
+        <cxf.microprofile.rest.client.version>1.1.0.20180323</cxf.microprofile.rest.client.version>
         <cxf.wiremock.params>--port=8765</cxf.wiremock.params>
         <cxf.weld.se.version>2.4.5.Final</cxf.weld.se.version>
         <cxf.arquillian.weld.container.version>2.0.0.Final</cxf.arquillian.weld.container.version>
@@ -43,14 +43,32 @@
         <cxf.slf4j.version>1.7.25</cxf.slf4j.version>
         <cxf.commons.logging.version>1.2</cxf.commons.logging.version>
         <cxf.javax.ws.rs.version>2.1</cxf.javax.ws.rs.version>
+        <cxf.wiremock.version>2.10.1</cxf.wiremock.version>
     </properties>
-    <dependencyManagement>
         <dependencies>
+            <!--<dependency>
+                <groupId>org.testng</groupId>
+                <artifactId>testng</artifactId>
+                <version>6.14.2</version>
+                <scope>test</scope>
+            </dependency>
             <dependency>
                 <groupId>org.jboss.arquillian.testng</groupId>
                 <artifactId>arquillian-testng-container</artifactId>
                 <version>${cxf.arquillian.version}</version>
                 <scope>test</scope>
+            </dependency> -->
+            <dependency>
+                <groupId>org.hamcrest</groupId>
+                <artifactId>hamcrest-all</artifactId>
+                <version>1.3</version>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-rt-rs-mp-client</artifactId>
+                <!--version>${cxf.commons.logging.version}</version-->
+                <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>commons-logging</groupId>
@@ -123,9 +141,11 @@
                 <version>${cxf.microprofile.rest.client.version}</version>
                 <scope>test</scope>
             </dependency>
+            <dependency>
+                <groupId>com.github.tomakehurst</groupId>
+                <artifactId>wiremock</artifactId>
+                <version>${cxf.wiremock.version}</version>
+                <scope>test</scope>
+            </dependency>
         </dependencies>
-    </dependencyManagement>
-    <modules>
-        <module>client/weld</module>
-    </modules>
 </project>
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
new file mode 100644
index 0000000..a25e865
--- /dev/null
+++ b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
@@ -0,0 +1,324 @@
+/**
+ * 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.apache.cxf.systest.microprofile.rest.client;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.InvocationCallback;
+import javax.ws.rs.core.Response;
+
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
+
+import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncClientWithFuture;
+import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncClientWithInvocationCallback;
+import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncInvocationInterceptorFactoryTestImpl;
+import org.apache.cxf.systest.microprofile.rest.client.mock.AsyncInvocationInterceptorFactoryTestImpl2;
+import org.apache.cxf.systest.microprofile.rest.client.mock.ThreadLocalClientFilter;
+import org.eclipse.microprofile.rest.client.RestClientBuilder;
+import org.eclipse.microprofile.rest.client.tck.providers.TestClientRequestFilter;
+import org.eclipse.microprofile.rest.client.tck.providers.TestClientResponseFilter;
+import org.eclipse.microprofile.rest.client.tck.providers.TestMessageBodyReader;
+import org.eclipse.microprofile.rest.client.tck.providers.TestMessageBodyWriter;
+import org.eclipse.microprofile.rest.client.tck.providers.TestParamConverterProvider;
+import org.eclipse.microprofile.rest.client.tck.providers.TestReaderInterceptor;
+import org.eclipse.microprofile.rest.client.tck.providers.TestWriterInterceptor;
+
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+
+//CHECKSTYLE:OFF
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+//CHECKSTYLE:ON
+
+public class AsyncMethodTest extends Assert {
+
+    @Rule
+    public WireMockRule wireMockRule = new WireMockRule(WireMockConfiguration.options().dynamicPort());
+
+    private static class StringInvocationCallback implements InvocationCallback<String> {
+        private final List<Object> results;
+        private final CountDownLatch latch;
+
+        StringInvocationCallback(List<Object> results, CountDownLatch latch) {
+            this.results = results;
+            this.latch = latch;
+        }
+
+        /** {@inheritDoc}*/
+        @Override
+        public void completed(String response) {
+            results.add(response);
+            results.add(Thread.currentThread().getId());
+            latch.countDown();
+        }
+
+        /** {@inheritDoc}*/
+        @Override
+        public void failed(Throwable th) {
+            results.add(th);
+            results.add(Thread.currentThread().getId());
+            latch.countDown();
+        }
+    }
+
+    private static class ResponseInvocationCallback implements InvocationCallback<Response> {
+        final List<String> inboundList = new ArrayList<>();
+        Throwable throwable;
+        private final CountDownLatch latch;
+
+
+        ResponseInvocationCallback(CountDownLatch latch) {
+            this.latch = latch;
+        }
+
+        /** {@inheritDoc}*/
+        @Override
+        public void completed(Response response) {
+            inboundList.addAll(response.getStringHeaders().get("CXFTestResponse"));
+            latch.countDown();
+        }
+
+        /** {@inheritDoc}*/
+        @Override
+        public void failed(Throwable th) {
+            throwable = th;
+            latch.countDown();
+        }
+    }
+
+    @Test
+    public void testInvokesPostOperationWithRegisteredProvidersAsyncInvocationCallback() throws Exception {
+        wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
+                                .willReturn(aResponse()
+                                .withBody("this is the replaced writer input body will be removed")));
+        long mainThreadId = Thread.currentThread().getId();
+        String inputBody = "input body will be removed";
+        String expectedResponseBody = TestMessageBodyReader.REPLACED_BODY;
+
+        AsyncClientWithInvocationCallback api = RestClientBuilder.newBuilder()
+                .register(TestClientRequestFilter.class)
+                .register(TestClientResponseFilter.class)
+                .register(TestMessageBodyReader.class, 3)
+                .register(TestMessageBodyWriter.class)
+                .register(TestParamConverterProvider.class)
+                .register(TestReaderInterceptor.class)
+                .register(TestWriterInterceptor.class)
+                .baseUri(getBaseUri())
+                .build(AsyncClientWithInvocationCallback.class);
+
+        final List<Object> responseBodyList = new ArrayList<>();
+        final CountDownLatch latch = new CountDownLatch(1);
+
+        api.put(new StringInvocationCallback(responseBodyList, latch), inputBody);
+
+        latch.await(20, TimeUnit.SECONDS); // should need <1 second, but 20s timeout in case something goes wrong
+        assertEquals(2, responseBodyList.size());
+
+        assertEquals(expectedResponseBody, responseBodyList.get(0));
+        assertNotEquals(mainThreadId, responseBodyList.get(1));
+
+        assertEquals(TestClientResponseFilter.getAndResetValue(), 1);
+        assertEquals(TestClientRequestFilter.getAndResetValue(), 1);
+        assertEquals(TestReaderInterceptor.getAndResetValue(), 1);
+    }
+
+    @Test
+    public void testInvokesPostOperationWithRegisteredProvidersAsyncInvocationCallbackWithExecutor() throws Exception {
+        final String inputBody = "input body will be ignored";
+        wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
+                                .willReturn(aResponse()
+                                .withBody(inputBody)));
+        AsyncInvocationInterceptorFactoryTestImpl.INBOUND.remove();
+        AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.remove();
+        try {
+            final String asyncThreadName = "CXF-MPRestClientThread-1";
+
+            AsyncClientWithInvocationCallback api = RestClientBuilder.newBuilder()
+                .register(AsyncInvocationInterceptorFactoryTestImpl.class)
+                .register(AsyncInvocationInterceptorFactoryTestImpl2.class)
+                .register(ThreadLocalClientFilter.class)
+                .baseUri(getBaseUri())
+                .executorService(Executors.newSingleThreadExecutor(new ThreadFactory() {
+
+                    @Override
+                    public Thread newThread(Runnable r) {
+                        return new Thread(r, asyncThreadName);
+                    }
+                }))
+                .build(AsyncClientWithInvocationCallback.class);
+
+            final CountDownLatch latch = new CountDownLatch(1);
+
+            ResponseInvocationCallback callback = new ResponseInvocationCallback(latch);
+            api.put(callback, inputBody);
+            List<String> outboundList = AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.get();
+            assertEquals(4, outboundList.size());
+
+            // ensure filters and asyncInvocationInterceptors are executed in the correct order and the correct thread
+            // outbound:
+            assertEquals(ThreadLocalClientFilter.class.getSimpleName(), outboundList.get(0));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName(), outboundList.get(1));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName(), outboundList.get(2));
+            assertEquals(Thread.currentThread().getName(), outboundList.get(3));
+
+            // inbound:
+            latch.await(20, TimeUnit.SECONDS); // should need <1 second, but 20s timeout in case something goes wrong
+            assertNull(callback.throwable);
+            List<String> responseList = callback.inboundList;
+            assertEquals(4, responseList.size());
+
+            assertEquals(asyncThreadName, responseList.get(0));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName(), responseList.get(1));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName(), responseList.get(2));
+            assertEquals(ThreadLocalClientFilter.class.getSimpleName(), responseList.get(3));
+        } finally {
+            AsyncInvocationInterceptorFactoryTestImpl.INBOUND.remove();
+            AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.remove();
+        }
+    }
+
+    @Test
+    public void testInvokesPostOperationWithRegisteredProvidersAsyncInvocationCallbackWithException() throws Exception {
+        wireMockRule.stubFor(put(urlEqualTo("/Missing/test"))
+                                .willReturn(status(404)));
+        long mainThreadId = Thread.currentThread().getId();
+        String inputBody = "input body will be removed";
+
+        AsyncClientWithInvocationCallback api = RestClientBuilder.newBuilder()
+                .baseUrl(new URL("http://localhost:" + wireMockRule.port() + "/Missing"))
+                .build(AsyncClientWithInvocationCallback.class);
+
+        final List<Object> responseBodyList = new ArrayList<>();
+        final CountDownLatch latch = new CountDownLatch(1);
+
+        api.put(new StringInvocationCallback(responseBodyList, latch), inputBody);
+
+        latch.await(20, TimeUnit.SECONDS); // should need <1 second, but 20s timeout in case something goes wrong
+        assertEquals(2, responseBodyList.size());
+        Object body = responseBodyList.get(0);
+
+        assertTrue(body instanceof WebApplicationException);
+        assertNotEquals(mainThreadId, responseBodyList.get(1));
+    }
+
+    @Test
+    public void testInvokesPostOperationWithRegisteredProvidersAsyncFuture() throws Exception {
+        wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
+                                .willReturn(aResponse()
+                                .withBody("this is the replaced writer input body will be removed")));
+        String inputBody = "input body will be removed";
+        String expectedResponseBody = TestMessageBodyReader.REPLACED_BODY;
+
+        AsyncClientWithFuture api = RestClientBuilder.newBuilder()
+                .register(TestClientRequestFilter.class)
+                .register(TestClientResponseFilter.class)
+                .register(TestMessageBodyReader.class, 3)
+                .register(TestMessageBodyWriter.class)
+                .register(TestParamConverterProvider.class)
+                .register(TestReaderInterceptor.class)
+                .register(TestWriterInterceptor.class)
+                .baseUri(getBaseUri())
+                .build(AsyncClientWithFuture.class);
+
+        Future<Response> future = api.put(inputBody);
+
+        // should need <1 second, but 20s timeout in case something goes wrong
+        Response response = future.get(20, TimeUnit.SECONDS);
+        String actualResponseBody = response.readEntity(String.class);
+
+        assertEquals(expectedResponseBody, actualResponseBody);
+
+        assertEquals(TestClientResponseFilter.getAndResetValue(), 1);
+        assertEquals(TestClientRequestFilter.getAndResetValue(), 1);
+        assertEquals(TestReaderInterceptor.getAndResetValue(), 1);
+    }
+
+    @Test
+    public void testInvokesPostOperationWithRegisteredProvidersAsyncFutureWithExecutor() throws Exception {
+        final String inputBody = "input body will be ignored";
+        wireMockRule.stubFor(put(urlEqualTo("/echo/test"))
+                                .willReturn(aResponse()
+                                .withBody(inputBody)));
+        AsyncInvocationInterceptorFactoryTestImpl.INBOUND.remove();
+        AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.remove();
+        try {
+            final String asyncThreadName = "CXF-MPRestClientThread-2";
+
+            AsyncClientWithFuture api = RestClientBuilder.newBuilder()
+                .register(AsyncInvocationInterceptorFactoryTestImpl.class)
+                .register(AsyncInvocationInterceptorFactoryTestImpl2.class)
+                .register(ThreadLocalClientFilter.class)
+                .baseUri(getBaseUri())
+                .executorService(Executors.newSingleThreadExecutor(new ThreadFactory() {
+
+                    @Override
+                    public Thread newThread(Runnable r) {
+                        return new Thread(r, asyncThreadName);
+                    }
+                }))
+                .build(AsyncClientWithFuture.class);
+
+            Future<Response> future = api.put(inputBody);
+            List<String> outboundList = AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.get();
+            assertEquals(4, outboundList.size());
+
+            // ensure filters and asyncInvocationInterceptors are executed in the correct order and the correct thread
+            // outbound:
+            assertEquals(ThreadLocalClientFilter.class.getSimpleName(), outboundList.get(0));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName(), outboundList.get(1));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName(), outboundList.get(2));
+            assertEquals(Thread.currentThread().getName(), outboundList.get(3));
+
+            // inbound:
+            // should need <1 second, but 20s timeout in case something goes wrong
+            Response response = future.get(20, TimeUnit.SECONDS);
+
+            List<String> responseList = response.getStringHeaders().get("CXFTestResponse");
+            assertEquals(4, responseList.size());
+
+            assertEquals(asyncThreadName, responseList.get(0));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName(), responseList.get(1));
+            assertEquals(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName(), responseList.get(2));
+            assertEquals(ThreadLocalClientFilter.class.getSimpleName(), responseList.get(3));
+        } finally {
+            AsyncInvocationInterceptorFactoryTestImpl.INBOUND.remove();
+            AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.remove();
+        }
+    }
+
+    private URI getBaseUri() {
+        return URI.create("http://localhost:" + wireMockRule.port() + "/echo");
+    }
+
+    private void fail(Response r, String failureMessage) {
+        System.out.println(r.getStatus());
+        fail(failureMessage);
+    }
+}
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java
new file mode 100644
index 0000000..b2408d1
--- /dev/null
+++ b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java
@@ -0,0 +1,33 @@
+/**
+ * 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.apache.cxf.systest.microprofile.rest.client.mock;
+
+import java.util.concurrent.Future;
+
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Response;
+
+public interface AsyncClientWithFuture {
+
+    @PUT
+    @Path("/test")
+    Future<Response> put(String text);
+}
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java
new file mode 100644
index 0000000..df0b352
--- /dev/null
+++ b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java
@@ -0,0 +1,31 @@
+/**
+ * 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.apache.cxf.systest.microprofile.rest.client.mock;
+
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.client.InvocationCallback;
+
+public interface AsyncClientWithInvocationCallback {
+
+    @PUT
+    @Path("/test")
+    void put(InvocationCallback<?> callback, String text);
+}
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java
new file mode 100644
index 0000000..242b161
--- /dev/null
+++ b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java
@@ -0,0 +1,62 @@
+/**
+ * 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.apache.cxf.systest.microprofile.rest.client.mock;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Priority;
+
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory;
+
+@Priority(3500)
+public class AsyncInvocationInterceptorFactoryTestImpl implements AsyncInvocationInterceptorFactory {
+
+    //CHECKSTYLE:OFF
+    public static ThreadLocal<List<String>> OUTBOUND = ThreadLocal.withInitial(() -> {return new ArrayList<>();});
+    public static ThreadLocal<List<String>> INBOUND = ThreadLocal.withInitial(() -> {return new ArrayList<>();});
+    //CHECKSTYLE:ON
+
+    static class AsyncInvocationInterceptorTestImpl implements AsyncInvocationInterceptor {
+
+        /** {@inheritDoc}*/
+        @Override
+        public void prepareContext() {
+            List<String> list = OUTBOUND.get();
+            list.add(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName());
+        }
+
+        /** {@inheritDoc}*/
+        @Override
+        public void applyContext() {
+            List<String> list = INBOUND.get();
+            list.add(Thread.currentThread().getName());
+            list.add(AsyncInvocationInterceptorFactoryTestImpl.class.getSimpleName());
+        }
+    }
+
+    /** {@inheritDoc}*/
+    @Override
+    public AsyncInvocationInterceptor newInterceptor() {
+        return new AsyncInvocationInterceptorTestImpl();
+    }
+
+}
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java
new file mode 100644
index 0000000..e4ceb6e
--- /dev/null
+++ b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java
@@ -0,0 +1,57 @@
+/**
+ * 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.apache.cxf.systest.microprofile.rest.client.mock;
+
+import java.util.List;
+
+import javax.annotation.Priority;
+
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptor;
+import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory;
+
+@Priority(3700)
+public class AsyncInvocationInterceptorFactoryTestImpl2 implements AsyncInvocationInterceptorFactory {
+
+    static class AsyncInvocationInterceptorTestImpl2 implements AsyncInvocationInterceptor {
+
+        /** {@inheritDoc}*/
+        @Override
+        public void prepareContext() {
+            List<String> list = AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.get();
+            list.add(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName());
+            list.add(Thread.currentThread().getName());
+        }
+
+        /** {@inheritDoc}*/
+        @Override
+        public void applyContext() {
+            List<String> list = AsyncInvocationInterceptorFactoryTestImpl.INBOUND.get();
+            list.add(Thread.currentThread().getName());
+            list.add(AsyncInvocationInterceptorFactoryTestImpl2.class.getSimpleName());
+        }
+    }
+
+    /** {@inheritDoc}*/
+    @Override
+    public AsyncInvocationInterceptor newInterceptor() {
+        return new AsyncInvocationInterceptorTestImpl2();
+    }
+
+}
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java
new file mode 100644
index 0000000..a93e4f0
--- /dev/null
+++ b/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java
@@ -0,0 +1,49 @@
+/**
+ * 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.apache.cxf.systest.microprofile.rest.client.mock;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientRequestFilter;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.client.ClientResponseFilter;
+
+public class ThreadLocalClientFilter implements ClientRequestFilter, ClientResponseFilter {
+
+    /** {@inheritDoc}*/
+    @Override
+    public void filter(ClientRequestContext requestContext) throws IOException {
+        List<String> list = AsyncInvocationInterceptorFactoryTestImpl.OUTBOUND.get();
+        list.add(ThreadLocalClientFilter.class.getSimpleName());
+    }
+
+    /** {@inheritDoc}*/
+    @Override
+    public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext)
+        throws IOException {
+        List<String> list = AsyncInvocationInterceptorFactoryTestImpl.INBOUND.get();
+        list.add(ThreadLocalClientFilter.class.getSimpleName());
+        responseContext.getHeaders().put("CXFTestResponse", list);
+
+    }
+
+}


[cxf] 07/08: Remove unnecessary changes for InvocationCallback

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit a1693399ff7635f90b029308073d143adf8b450a
Author: Andy McCright <j....@gmail.com>
AuthorDate: Tue Jul 17 20:22:12 2018 -0500

    Remove unnecessary changes for InvocationCallback
---
 .../apache/cxf/jaxrs/client/ClientProxyImpl.java   | 24 +++---
 .../cxf/jaxrs/client/JaxrsClientCallback.java      |  5 +-
 .../microprofile/client/MPRestClientCallback.java} | 87 +++++-----------------
 .../client/proxy/MicroProfileClientProxyImpl.java  |  8 ++
 4 files changed, 41 insertions(+), 83 deletions(-)

diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index cc5dfea..7993aae 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -767,10 +767,6 @@ public class ClientProxyImpl extends AbstractClient implements
             }
             outMessage.getInterceptorChain().add(bodyWriter);
 
-            int invocationCallbackIdx = Arrays.asList(ori.getInParameterTypes()).indexOf(InvocationCallback.class);
-            if (invocationCallbackIdx > -1) {
-                outMessage.setContent(InvocationCallback.class, methodParams[invocationCallbackIdx]);
-            }
             Map<String, Object> reqContext = getRequestContext(outMessage);
             reqContext.put(OperationResourceInfo.class.getName(), ori);
             reqContext.put(PROXY_METHOD_PARAM_BODY_INDEX, bodyIndex);
@@ -805,8 +801,8 @@ public class ClientProxyImpl extends AbstractClient implements
     }
 
     protected InvocationCallback<Object> checkAsyncCallback(OperationResourceInfo ori,
-                                                          Map<String, Object> reqContext,
-                                                          Message outMessage) {
+                                                            Map<String, Object> reqContext,
+                                                            Message outMessage) {
         Object callbackProp = reqContext.get(InvocationCallback.class.getName());
         if (callbackProp != null) {
             if (callbackProp instanceof Collection) {
@@ -840,11 +836,12 @@ public class ClientProxyImpl extends AbstractClient implements
         return null;
     }
 
-    protected Object doInvokeAsync(OperationResourceInfo ori, Message outMessage,
-                                 InvocationCallback<Object> asyncCallback) {
+    protected Object doInvokeAsync(OperationResourceInfo ori, 
+                                   Message outMessage,
+                                   InvocationCallback<Object> asyncCallback) {
         outMessage.getExchange().setSynchronous(false);
         setAsyncMessageObserverIfNeeded(outMessage.getExchange());
-        JaxrsClientCallback<?> cb = new JaxrsClientCallback<Object>(asyncCallback,
+        JaxrsClientCallback<?> cb = newJaxrsClientCallback(asyncCallback,
             ori.getMethodToInvoke().getReturnType(), ori.getMethodToInvoke().getGenericReturnType());
         outMessage.getExchange().put(JaxrsClientCallback.class, cb);
         doRunInterceptorChain(outMessage);
@@ -852,6 +849,12 @@ public class ClientProxyImpl extends AbstractClient implements
         return null;
     }
 
+    protected JaxrsClientCallback<?> newJaxrsClientCallback(InvocationCallback<Object> asyncCallback,
+                                                            Class<?> responseClass,
+                                                            Type outGenericType) {
+        return new JaxrsClientCallback<Object>(asyncCallback, responseClass, outGenericType);
+    }
+
     @Override
     protected Object retryInvoke(URI newRequestURI,
                                  MultivaluedMap<String, String> headers,
@@ -876,8 +879,7 @@ public class ClientProxyImpl extends AbstractClient implements
 
             Method method = outMessage.getExchange().get(Method.class);
             checkResponse(method, r, outMessage);
-            if (outMessage.getExchange().isSynchronous() && (method.getReturnType() == Void.class
-                                                            || method.getReturnType() == Void.TYPE)) {
+            if (method.getReturnType() == Void.class || method.getReturnType() == Void.TYPE) {
                 return null;
             }
             if (method.getReturnType() == Response.class
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
index 227242f..98443c5 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
@@ -22,7 +22,6 @@ package org.apache.cxf.jaxrs.client;
 import java.lang.reflect.Type;
 import java.util.Map;
 import java.util.concurrent.CancellationException;
-import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
@@ -65,7 +64,7 @@ public class JaxrsClientCallback<T> extends ClientCallback {
         return result;
     }
 
-    public CompletableFuture<T> createFuture() {
+    public Future<T> createFuture() {
         return new JaxrsResponseFuture<T>(this);
     }
 
@@ -97,7 +96,7 @@ public class JaxrsClientCallback<T> extends ClientCallback {
 
 
 
-    static class JaxrsResponseFuture<T> extends CompletableFuture<T> implements Future<T> {
+    static class JaxrsResponseFuture<T> implements Future<T> {
         JaxrsClientCallback<T> callback;
         JaxrsResponseFuture(JaxrsClientCallback<T> cb) {
             callback = cb;
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MPRestClientCallback.java
similarity index 52%
copy from rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
copy to rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MPRestClientCallback.java
index 227242f..a6863a3 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/JaxrsClientCallback.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MPRestClientCallback.java
@@ -17,11 +17,10 @@
  * under the License.
  */
 
-package org.apache.cxf.jaxrs.client;
+package org.apache.cxf.microprofile.client;
 
 import java.lang.reflect.Type;
 import java.util.Map;
-import java.util.concurrent.CancellationException;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -30,76 +29,24 @@ import java.util.concurrent.TimeoutException;
 
 import javax.ws.rs.client.InvocationCallback;
 
-import org.apache.cxf.endpoint.ClientCallback;
+import org.apache.cxf.jaxrs.client.JaxrsClientCallback;
 
-public class JaxrsClientCallback<T> extends ClientCallback {
-    private final InvocationCallback<T> handler;
-    private final Type outType;
-    private final Class<?> responseClass;
+public class MPRestClientCallback<T> extends JaxrsClientCallback {
 
-    public JaxrsClientCallback(final InvocationCallback<T> handler,
-                        Class<?> responseClass,
-                        Type outGenericType) {
-        this.handler = handler;
-        this.outType = outGenericType;
-        this.responseClass = responseClass;
-    }
-
-    public InvocationCallback<T> getHandler() {
-        return handler;
-    }
-
-    public Type getOutGenericType() {
-        return outType;
-    }
-    public Class<?> getResponseClass() {
-        return responseClass;
+    public MPRestClientCallback(InvocationCallback<T> handler,
+                                Class<?> responseClass,
+                                Type outGenericType) {
+        super(handler, responseClass, outGenericType);
     }
 
     @Override
-    public boolean cancel(boolean mayInterruptIfRunning) {
-        boolean result = super.cancel(mayInterruptIfRunning);
-        if (result && handler != null) {
-            handler.failed(new CancellationException());
-        }
-        return result;
-    }
-
-    public CompletableFuture<T> createFuture() {
-        return new JaxrsResponseFuture<T>(this);
+    public Future<T> createFuture() {
+        return new MPRestClientResponseFuture<T>(this);
     }
 
-    @SuppressWarnings("unchecked")
-    public void handleResponse(Map<String, Object> ctx, Object[] res) {
-        context = ctx;
-        result = res;
-        if (handler != null) {
-            handler.completed((T)res[0]);
-        }
-        done = true;
-        synchronized (this) {
-            notifyAll();
-        }
-    }
-
-    @Override
-    public void handleException(Map<String, Object> ctx, final Throwable ex) {
-        context = ctx;
-        exception = ex;
-        if (handler != null) {
-            handler.failed(exception);
-        }
-        done = true;
-        synchronized (this) {
-            notifyAll();
-        }
-    }
-
-
-
-    static class JaxrsResponseFuture<T> extends CompletableFuture<T> implements Future<T> {
-        JaxrsClientCallback<T> callback;
-        JaxrsResponseFuture(JaxrsClientCallback<T> cb) {
+    static class MPRestClientResponseFuture<T> extends CompletableFuture<T> implements Future<T> {
+        MPRestClientCallback<T> callback;
+        MPRestClientResponseFuture(MPRestClientCallback<T> cb) {
             callback = cb;
         }
 
@@ -118,8 +65,9 @@ public class JaxrsClientCallback<T> extends ClientCallback {
             try {
                 return getObject(callback.get()[0]);
             } catch (InterruptedException ex) {
-                if (callback.handler != null) {
-                    callback.handler.failed(ex);
+                InvocationCallback<T> handler = callback.getHandler();
+                if (handler != null) {
+                    handler.failed(ex);
                 }
                 throw ex;
             }
@@ -129,8 +77,9 @@ public class JaxrsClientCallback<T> extends ClientCallback {
             try {
                 return getObject(callback.get(timeout, unit)[0]);
             } catch (InterruptedException ex) {
-                if (callback.handler != null) {
-                    callback.handler.failed(ex);
+                InvocationCallback<T> handler = callback.getHandler();
+                if (handler != null) {
+                    handler.failed(ex);
                 }
                 throw ex;
             }
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
index 384b188..9038f2b 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
@@ -37,6 +37,7 @@ import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.OperationResourceInfo;
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.microprofile.client.MPRestClientCallback;
 import org.apache.cxf.microprofile.client.MicroProfileClientProviderFactory;
 import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
 
@@ -100,6 +101,13 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
     }
 
     @Override
+    protected JaxrsClientCallback<?> newJaxrsClientCallback(InvocationCallback<Object> asyncCallback,
+                                                            Class<?> responseClass,
+                                                            Type outGenericType) {
+        return new MPRestClientCallback<Object>(asyncCallback, responseClass, outGenericType);
+    }
+
+    @Override
     protected void checkResponse(Method m, Response r, Message inMessage) throws Throwable {
         MicroProfileClientProviderFactory factory = MicroProfileClientProviderFactory.getInstance(inMessage);
         List<ResponseExceptionMapper<?>> mappers = factory.createResponseExceptionMapper(inMessage,


[cxf] 02/08: Code Review Changes

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 0bebe29758ebca6e7d6032d2e13de5848b3a0518
Author: Andy McCright <j....@gmail.com>
AuthorDate: Sat Mar 24 08:31:10 2018 -0500

    Code Review Changes
    
    * Isolate changes around handling InvocationCallback parameter
    * Combine MP Rest Client systests under one directory
    * Minor changes in class/method names, etc.
---
 .../apache/cxf/jaxrs/client/ClientProxyImpl.java   | 11 +++----
 .../client/proxy/MicroProfileClientProxyImpl.java  | 25 ++++++++++-----
 .../client/CxfTypeSafeClientBuilderTest.java       |  9 ++----
 .../client/async}/pom.xml                          | 36 +++++++++++-----------
 .../microprofile/rest/client/AsyncMethodTest.java  |  0
 .../rest/client/mock/AsyncClientWithFuture.java    |  0
 .../mock/AsyncClientWithInvocationCallback.java    |  0
 .../AsyncInvocationInterceptorFactoryTestImpl.java |  0
 ...AsyncInvocationInterceptorFactoryTestImpl2.java |  0
 .../rest/client/mock/ThreadLocalClientFilter.java  |  1 -
 .../client/weld/pom.xml                            |  0
 systests/microprofile/pom.xml                      | 29 +++++------------
 12 files changed, 51 insertions(+), 60 deletions(-)

diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index 35bdbc2..ac0cace 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -245,7 +245,7 @@ public class ClientProxyImpl extends AbstractClient implements
         }
     }
 
-    private static MultivaluedMap<ParameterType, Parameter> getParametersInfo(Method m,
+    private MultivaluedMap<ParameterType, Parameter> getParametersInfo(Method m,
         Object[] params, OperationResourceInfo ori) {
         MultivaluedMap<ParameterType, Parameter> map =
             new MetadataMap<ParameterType, Parameter>();
@@ -280,13 +280,12 @@ public class ClientProxyImpl extends AbstractClient implements
         return map;
     }
 
-    private static boolean isIgnorableParameter(Method m, Parameter p) {
+    protected boolean isIgnorableParameter(Method m, Parameter p) {
         if (p.getType() == ParameterType.CONTEXT) {
             return true;
         }
         return p.getType() == ParameterType.REQUEST_BODY
-            && (m.getParameterTypes()[p.getIndex()] == AsyncResponse.class
-                || m.getParameterTypes()[p.getIndex()] == InvocationCallback.class);
+            && m.getParameterTypes()[p.getIndex()] == AsyncResponse.class;
     }
 
     private static int getBodyIndex(MultivaluedMap<ParameterType, Parameter> map,
@@ -593,7 +592,7 @@ public class ClientProxyImpl extends AbstractClient implements
         }
         return jaxrsParamAnnAvailable;
     }
-    
+
     private void handleMatrixes(Method m,
                                 Object[] params,
                                 MultivaluedMap<ParameterType, Parameter> map,
@@ -878,7 +877,7 @@ public class ClientProxyImpl extends AbstractClient implements
 
             Method method = outMessage.getExchange().get(Method.class);
             checkResponse(method, r, outMessage);
-            if (outMessage.getExchange().isSynchronous() && (method.getReturnType() == Void.class 
+            if (outMessage.getExchange().isSynchronous() && (method.getReturnType() == Void.class
                                                             || method.getReturnType() == Void.TYPE)) {
                 return null;
             }
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
index 5c5d103..89dd84c 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MicroProfileClientProxyImpl.java
@@ -35,6 +35,8 @@ import org.apache.cxf.jaxrs.client.JaxrsClientCallback;
 import org.apache.cxf.jaxrs.client.LocalClientState;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.OperationResourceInfo;
+import org.apache.cxf.jaxrs.model.Parameter;
+import org.apache.cxf.jaxrs.model.ParameterType;
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.microprofile.client.MicroProfileClientProviderFactory;
@@ -53,9 +55,9 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
             // no-op
         }
     };
-    
+
     private final MPAsyncInvocationInterceptorImpl aiiImpl = new MPAsyncInvocationInterceptorImpl();
-    
+
     public MicroProfileClientProxyImpl(URI baseURI, ClassLoader loader, ClassResourceInfo cri,
                                        boolean isRoot, boolean inheritHeaders, ExecutorService executorService,
                                        Object... varValues) {
@@ -70,7 +72,7 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
         cfg.getRequestContext().put(EXECUTOR_SERVICE_PROPERTY, executorService);
     }
 
-    
+
 
     @SuppressWarnings("unchecked")
     @Override
@@ -83,15 +85,15 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
         return outMessage.getContent(InvocationCallback.class);
     }
 
-    
+
     @Override
     protected Object doInvokeAsync(OperationResourceInfo ori, Message outMessage,
                                    InvocationCallback<Object> asyncCallback) {
         outMessage.getInterceptorChain().add(aiiImpl);
         cfg.getInInterceptors().add(new MPAsyncInvocationInterceptorPostAsyncImpl(aiiImpl.getInterceptors()));
-        
+
         super.doInvokeAsync(ori, outMessage, asyncCallback);
-        
+
         Future<?> future = null;
         if (asyncCallback == MARKER_CALLBACK) {
             JaxrsClientCallback<?> cb = outMessage.getExchange().get(JaxrsClientCallback.class);
@@ -138,9 +140,16 @@ public class MicroProfileClientProxyImpl extends ClientProxyImpl {
         if (Future.class.isAssignableFrom(returnType)) {
             Type t = method.getGenericReturnType();
             returnType = InjectionUtils.getActualType(t);
-            System.out.println("returnType (from future) = " + returnType);
         }
-        System.out.println("returnType = " + returnType);
         return returnType;
     }
+
+    @Override
+    protected boolean isIgnorableParameter(Method m, Parameter p) {
+        if (p.getType() == ParameterType.CONTEXT) {
+            return true;
+        }
+        return p.getType() == ParameterType.REQUEST_BODY
+            && m.getParameterTypes()[p.getIndex()] == InvocationCallback.class;
+    }
 }
diff --git a/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java b/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java
index bc38d62..5aa7c61 100644
--- a/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java
+++ b/rt/rs/microprofile-client/src/test/java/org/apache/cxf/microprofile/client/CxfTypeSafeClientBuilderTest.java
@@ -19,11 +19,8 @@
 package org.apache.cxf.microprofile.client;
 
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
+
 import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.core.Response;
 
 import org.apache.cxf.microprofile.client.mock.EchoClientReqFilter;
@@ -122,7 +119,7 @@ public class CxfTypeSafeClientBuilderTest extends Assert {
         Response r = client.getEntity();
         fail(r, "Did not throw expected mapped exception: NoSuchEntityException");
     }
-    
+
     @Test(expected = WebApplicationException.class)
     public void testDefaultResponseExceptionMapper() throws Exception {
         ExceptionMappingClient client = new CxfTypeSafeClientBuilder()
@@ -133,7 +130,7 @@ public class CxfTypeSafeClientBuilderTest extends Assert {
         Response r = client.getEntity();
         fail(r, "Did not throw expected mapped exception: WebApplicationException");
     }
-    
+
     private void fail(Response r, String failureMessage) {
         System.out.println(r.getStatus());
         fail(failureMessage);
diff --git a/systests/microprofile-tck/pom.xml b/systests/microprofile/client/async/pom.xml
similarity index 85%
rename from systests/microprofile-tck/pom.xml
rename to systests/microprofile/client/async/pom.xml
index 3c29018..b4e9167 100644
--- a/systests/microprofile-tck/pom.xml
+++ b/systests/microprofile/client/async/pom.xml
@@ -19,17 +19,16 @@
   -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <parent>
-        <artifactId>cxf-parent</artifactId>
-        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-microprofile-tck</artifactId>
+        <groupId>org.apache.cxf.systests</groupId>
         <version>3.2.5-SNAPSHOT</version>
-        <relativePath>../../parent/pom.xml</relativePath>
+        <relativePath>../../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.cxf.systests</groupId>
-    <artifactId>cxf-microprofile-tck</artifactId>
-    <packaging>pom</packaging>
-    <name>Apache CXF MicroProfile TCKs</name>
-    <description>Apache CXF System Tests - MicroProfile TCKs</description>
+    <artifactId>cxf-microprofile-async</artifactId>
+    <name>Apache CXF MicroProfile Async Sys Tests</name>
+    <description>Apache CXF System Tests - MicroProfile Rest Client Async Tests</description>
     <url>http://cxf.apache.org</url>
     <properties>
         <cxf.geronimo.config.version>1.0</cxf.geronimo.config.version>
@@ -43,19 +42,18 @@
         <cxf.slf4j.version>1.7.25</cxf.slf4j.version>
         <cxf.commons.logging.version>1.2</cxf.commons.logging.version>
         <cxf.javax.ws.rs.version>2.1</cxf.javax.ws.rs.version>
+        <cxf.wiremock.version>2.10.1</cxf.wiremock.version>
     </properties>
-    <dependencyManagement>
         <dependencies>
             <dependency>
-                <groupId>org.testng</groupId>
-                <artifactId>testng</artifactId>
-                <version>6.14.2</version>
+                <groupId>org.hamcrest</groupId>
+                <artifactId>hamcrest-all</artifactId>
+                <version>1.3</version>
                 <scope>test</scope>
             </dependency>
             <dependency>
-                <groupId>org.jboss.arquillian.testng</groupId>
-                <artifactId>arquillian-testng-container</artifactId>
-                <version>${cxf.arquillian.version}</version>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-rt-rs-mp-client</artifactId>
                 <scope>test</scope>
             </dependency>
             <dependency>
@@ -129,9 +127,11 @@
                 <version>${cxf.microprofile.rest.client.version}</version>
                 <scope>test</scope>
             </dependency>
+            <dependency>
+                <groupId>com.github.tomakehurst</groupId>
+                <artifactId>wiremock</artifactId>
+                <version>${cxf.wiremock.version}</version>
+                <scope>test</scope>
+            </dependency>
         </dependencies>
-    </dependencyManagement>
-    <modules>
-        <module>client/weld</module>
-    </modules>
 </project>
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
similarity index 100%
rename from systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
rename to systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/AsyncMethodTest.java
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java
similarity index 100%
rename from systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java
rename to systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithFuture.java
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java
similarity index 100%
rename from systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java
rename to systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncClientWithInvocationCallback.java
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java
similarity index 100%
rename from systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java
rename to systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl.java
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java
similarity index 100%
rename from systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java
rename to systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/AsyncInvocationInterceptorFactoryTestImpl2.java
diff --git a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java
similarity index 99%
rename from systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java
rename to systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java
index a93e4f0..bd83d64 100644
--- a/systests/microprofile/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java
+++ b/systests/microprofile/client/async/src/test/java/org/apache/cxf/systest/microprofile/rest/client/mock/ThreadLocalClientFilter.java
@@ -43,7 +43,6 @@ public class ThreadLocalClientFilter implements ClientRequestFilter, ClientRespo
         List<String> list = AsyncInvocationInterceptorFactoryTestImpl.INBOUND.get();
         list.add(ThreadLocalClientFilter.class.getSimpleName());
         responseContext.getHeaders().put("CXFTestResponse", list);
-
     }
 
 }
diff --git a/systests/microprofile-tck/client/weld/pom.xml b/systests/microprofile/client/weld/pom.xml
similarity index 100%
rename from systests/microprofile-tck/client/weld/pom.xml
rename to systests/microprofile/client/weld/pom.xml
diff --git a/systests/microprofile/pom.xml b/systests/microprofile/pom.xml
index c70bdcf..90cc036 100644
--- a/systests/microprofile/pom.xml
+++ b/systests/microprofile/pom.xml
@@ -27,7 +27,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.cxf.systests</groupId>
     <artifactId>cxf-microprofile-tck</artifactId>
-    <!--packaging>jar</packaging -->
+    <packaging>pom</packaging>
     <name>Apache CXF MicroProfile TCKs</name>
     <description>Apache CXF System Tests - MicroProfile TCKs</description>
     <url>http://cxf.apache.org</url>
@@ -43,10 +43,10 @@
         <cxf.slf4j.version>1.7.25</cxf.slf4j.version>
         <cxf.commons.logging.version>1.2</cxf.commons.logging.version>
         <cxf.javax.ws.rs.version>2.1</cxf.javax.ws.rs.version>
-        <cxf.wiremock.version>2.10.1</cxf.wiremock.version>
     </properties>
+    <dependencyManagement>
         <dependencies>
-            <!--<dependency>
+            <dependency>
                 <groupId>org.testng</groupId>
                 <artifactId>testng</artifactId>
                 <version>6.14.2</version>
@@ -57,18 +57,6 @@
                 <artifactId>arquillian-testng-container</artifactId>
                 <version>${cxf.arquillian.version}</version>
                 <scope>test</scope>
-            </dependency> -->
-            <dependency>
-                <groupId>org.hamcrest</groupId>
-                <artifactId>hamcrest-all</artifactId>
-                <version>1.3</version>
-                <scope>test</scope>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.cxf</groupId>
-                <artifactId>cxf-rt-rs-mp-client</artifactId>
-                <!--version>${cxf.commons.logging.version}</version-->
-                <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>commons-logging</groupId>
@@ -141,11 +129,10 @@
                 <version>${cxf.microprofile.rest.client.version}</version>
                 <scope>test</scope>
             </dependency>
-            <dependency>
-                <groupId>com.github.tomakehurst</groupId>
-                <artifactId>wiremock</artifactId>
-                <version>${cxf.wiremock.version}</version>
-                <scope>test</scope>
-            </dependency>
         </dependencies>
+    </dependencyManagement>
+    <modules>
+        <module>client/async</module>
+        <module>client/weld</module>
+    </modules>
 </project>


[cxf] 04/08: Use testng.xml

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit d60aecb7d669d435171299f7cb12d0f344fdddb5
Author: Andy McCright <j....@gmail.com>
AuthorDate: Mon Jul 9 17:12:03 2018 -0500

    Use testng.xml
---
 systests/microprofile/client/weld/pom.xml    |  3 +++
 systests/microprofile/client/weld/testng.xml | 27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/systests/microprofile/client/weld/pom.xml b/systests/microprofile/client/weld/pom.xml
index d2cceae..9f2999b 100644
--- a/systests/microprofile/client/weld/pom.xml
+++ b/systests/microprofile/client/weld/pom.xml
@@ -114,6 +114,9 @@
                     <dependenciesToScan>
                         <dependency>org.eclipse.microprofile.rest.client:microprofile-rest-client-tck</dependency>
                     </dependenciesToScan>
+                    <suiteXmlFiles>
+                        <suiteXmlFile>testng.xml</suiteXmlFile>
+                    </suiteXmlFiles>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/systests/microprofile/client/weld/testng.xml b/systests/microprofile/client/weld/testng.xml
new file mode 100644
index 0000000..cae8450
--- /dev/null
+++ b/systests/microprofile/client/weld/testng.xml
@@ -0,0 +1,27 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+ 
+<suite name="MPRestClientTCK1.1">
+    <test name="All tests except Executor Service Test">
+        <packages>
+            <package name="org.eclipse.microprofile.rest.client.tck" />
+            <package name="org.eclipse.microprofile.rest.client.tck.cditests" />
+        </packages>
+        <classes>
+            <class name="org.eclipse.microprofile.rest.client.tck.asynctests.CDIInvokeSimpleGetOperationTest" />
+            <class name="org.eclipse.microprofile.rest.client.tck.asynctests.AsyncMethodTest">
+                <methods>
+                    <exclude name="testExecutorService" />
+                </methods>
+            </class>
+        </classes>
+    </test>
+    <test name="Solo Executor Service Test">
+        <classes>
+            <class name="org.eclipse.microprofile.rest.client.tck.asynctests.AsyncMethodTest">
+                <methods>
+                    <include name="testExecutorService" />
+                </methods>
+            </class>
+        </classes>
+    </test>
+</suite>


[cxf] 08/08: Avoid direct dependency on 1.1-specific APIs for 1.0 compat

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 704dc75e76a97b96c7913a02e1401c5a70822708
Author: Andy McCright <j....@gmail.com>
AuthorDate: Mon Jul 30 11:42:54 2018 -0500

    Avoid direct dependency on 1.1-specific APIs for 1.0 compat
---
 .../client/MicroProfileClientProviderFactory.java  | 22 ++++++++++++++--------
 .../proxy/MPAsyncInvocationInterceptorImpl.java    |  9 +++++----
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java
index 031892c..f02739e 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java
@@ -28,20 +28,18 @@ import javax.ws.rs.core.Configuration;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.util.ClassHelper;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.jaxrs.model.ProviderInfo;
 import org.apache.cxf.jaxrs.provider.ProviderFactory;
 import org.apache.cxf.message.Message;
-import org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory;
 import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
 
 public final class MicroProfileClientProviderFactory extends ProviderFactory {
     static final String CLIENT_FACTORY_NAME = MicroProfileClientProviderFactory.class.getName();
-    private List<ProviderInfo<ResponseExceptionMapper<?>>> responseExceptionMappers =
-            new ArrayList<ProviderInfo<ResponseExceptionMapper<?>>>(1);
-    private List<ProviderInfo<AsyncInvocationInterceptorFactory>> asyncInvocationInterceptorFactories =
-            new ArrayList<ProviderInfo<AsyncInvocationInterceptorFactory>>();
+    private List<ProviderInfo<ResponseExceptionMapper<?>>> responseExceptionMappers = new ArrayList<>(1);
+    private List<ProviderInfo<Object>> asyncInvocationInterceptorFactories = new ArrayList<>();
     private final Comparator<ProviderInfo<?>> comparator;
 
     private MicroProfileClientProviderFactory(Bus bus, Comparator<ProviderInfo<?>> comparator) {
@@ -85,8 +83,16 @@ public final class MicroProfileClientProviderFactory extends ProviderFactory {
             if (ResponseExceptionMapper.class.isAssignableFrom(providerCls)) {
                 addProviderToList(responseExceptionMappers, provider);
             }
-            if (AsyncInvocationInterceptorFactory.class.isAssignableFrom(providerCls)) {
-                addProviderToList(asyncInvocationInterceptorFactories, provider);
+            String className = "org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory";
+            try {
+                
+                Class<?> asyncIIFactoryClass = ClassLoaderUtils.loadClass(className,
+                                                                          MicroProfileClientProviderFactory.class);
+                if (asyncIIFactoryClass.isAssignableFrom(providerCls)) {
+                    addProviderToList(asyncInvocationInterceptorFactories, provider);
+                }
+            } catch (ClassNotFoundException ex) {
+                // expected if using the MP Rest Client 1.0 APIs
             }
 
         }
@@ -109,7 +115,7 @@ public final class MicroProfileClientProviderFactory extends ProviderFactory {
                                             .collect(Collectors.toList()));
     }
 
-    public List<ProviderInfo<AsyncInvocationInterceptorFactory>> getAsyncInvocationInterceptorFactories() {
+    public List<ProviderInfo<Object>> getAsyncInvocationInterceptorFactories() {
         return asyncInvocationInterceptorFactories;
     }
 
diff --git a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java
index cb8ad6e..13ecf18 100644
--- a/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java
+++ b/rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/proxy/MPAsyncInvocationInterceptorImpl.java
@@ -53,11 +53,12 @@ public class MPAsyncInvocationInterceptorImpl extends AbstractPhaseInterceptor<M
     @Override
     public void handleMessage(Message message) throws Fault {
         MicroProfileClientProviderFactory factory = MicroProfileClientProviderFactory.getInstance(message);
-        List<ProviderInfo<AsyncInvocationInterceptorFactory>> aiiProviderList = 
+        List<ProviderInfo<Object>> aiiProviderList = 
             factory.getAsyncInvocationInterceptorFactories();
-        //interceptors.addAll(aiiProviderList.size());
-        for (ProviderInfo<AsyncInvocationInterceptorFactory> providerInfo: aiiProviderList) {
-            AsyncInvocationInterceptor aiInterceptor = providerInfo.getProvider().newInterceptor();
+
+        for (ProviderInfo<Object> providerInfo: aiiProviderList) {
+            AsyncInvocationInterceptor aiInterceptor = 
+                ((AsyncInvocationInterceptorFactory) providerInfo.getProvider()).newInterceptor();
             try {
                 aiInterceptor.prepareContext();
                 interceptors.add(0, aiInterceptor); // sort in reverse order