use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithCallbackThrowsProcessingExceptionTest.
/*
* @testName: optionsWithCallbackThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:396;
*
* @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 optionsWithCallbackThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
AsyncInvoker async = startAsyncInvokerForMethod("options");
InvocationCallback<String> callback = createStringCallback(false);
Future<String> future = async.options(callback);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithResponseClassWhileServerWaitTest.
/*
* @testName: postWithResponseClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:398;
*
* @test_Strategy: Invoke HTTP post method for the current request
* asynchronously.
*/
@Test
public void postWithResponseClassWhileServerWaitTest() throws Fault {
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("postandwait");
Future<Response> future = async.post(entity, Response.class);
checkFutureOkResponse(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithCallbackWithEntityThrowsProcessingExceptionTest.
/*
* @testName: methodWithCallbackWithEntityThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:392;
*
* @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 methodWithCallbackWithEntityThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
InvocationCallback<String> callback = createStringCallback(false);
Future<String> future = null;
for (String method : ENTITY_METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase());
Entity<String> entity = Entity.entity(method, MediaType.WILDCARD_TYPE);
future = async.method(method, entity, callback);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithClassThrowsWebApplicationExceptionTest.
/*
* @testName: deleteWithClassThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:376;
*
* @test_Strategy: Note that calling the Future.get() method on the returned
* Future instance may throw an ExecutionException that wraps a
* WebApplicationException or one of its subclasses thrown in case the
* received response status code is not successful and the specified response
* type is not Response.
*/
@Test
public void deleteWithClassThrowsWebApplicationExceptionTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("deletenotok");
Future<String> future = async.delete(String.class);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithCallbackStringWhileServerWaitTest.
/*
* @testName: methodWithCallbackStringWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:388;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* asynchronously.
*/
@Test
public void methodWithCallbackStringWhileServerWaitTest() throws Fault {
InvocationCallback<String> callback = createStringCallback(true);
Future<String> future = null;
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "andwait");
future = async.method(method, callback);
checkFutureString(future, method);
assertCallbackCall();
}
// return future;
}
Aggregations