use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithCallbackStringThrowsProcessingExceptionTest.
/*
* @testName: deleteWithCallbackStringThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:378;
*
* @test_Strategy: Note that calling the Future.get() method on the returned
* Future instance may throw an ExecutionException that wraps an
* jakarta.ws.rs.ProcessingException thrown in case of an invocation processing
* failure.
*/
@Test
public void deleteWithCallbackStringThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
AsyncInvoker async = startAsyncInvokerForMethod("deleteandwait");
InvocationCallback<String> callback = createStringCallback(false);
Future<String> future = async.delete(callback);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postThrowsProcessingExceptionTest.
/*
* @testName: postThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:397;
*
* @test_Strategy: Note that calling the Future.get() method on the returned
* Future instance may throw an ExecutionException that wraps an
* jakarta.ws.rs.ProcessingException thrown in case of an invocation processing
* failure.
*/
@Test
public void postThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
AsyncInvoker async = startAsyncInvokerForMethod("post");
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
Future<Response> future = async.post(entity);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithStringClassWhileServerWaitTest.
/*
* @testName: postWithStringClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:398;
*
* @test_Strategy: Invoke HTTP post method for the current request
* asynchronously.
*/
@Test
public void postWithStringClassWhileServerWaitTest() throws Fault {
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("postandwait");
Future<String> future = async.post(entity, String.class);
checkFutureString(future, "post");
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithGenericTypeResponseWhileServerWaitTest.
/*
* @testName: postWithGenericTypeResponseWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:399;
*
* @test_Strategy: Invoke HTTP post method for the current request
* asynchronously.
*/
@Test
public void postWithGenericTypeResponseWhileServerWaitTest() throws Fault {
GenericType<Response> generic = createGeneric(Response.class);
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("postandwait");
Future<Response> future = async.post(entity, generic);
checkFutureOkResponse(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method startAsyncInvokerForMethod.
/**
* Create AsyncInvoker for given resource method and start time
*/
protected AsyncInvoker startAsyncInvokerForMethod(String methodName) {
Client client = ClientBuilder.newClient();
client.register(new JdkLoggingFilter(false));
WebTarget target = client.target(getUrl(methodName));
AsyncInvoker async = target.request().async();
setStartTime();
return async;
}
Aggregations