use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method headTest.
// ------------------------------------------------------------------
// ---------------------------HEAD-----------------------------------
// ------------------------------------------------------------------
/*
* @testName: headTest
*
* @assertion_ids: JAXRS:JAVADOC:383;
*
* @test_Strategy: Invoke HTTP HEAD method for the current request
* asynchronously.
*/
@Test
public void headTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("head");
Future<Response> future = async.head();
checkFutureOkResponseNoTime(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithCallbackThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: postWithCallbackThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:400;
*
* @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 postWithCallbackThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("postnotok");
InvocationCallback<Response> callback = createCallback(false);
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
Future<Response> future = async.post(entity, callback);
checkFutureStatusResponseNoTime(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithGenericTypeResponseWhileServerWaitTest.
/*
* @testName: methodWithGenericTypeResponseWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:387;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* asynchronously.
*/
@Test
public void methodWithGenericTypeResponseWhileServerWaitTest() throws Fault {
GenericType<Response> generic = createGeneric(Response.class);
Future<Response> future = null;
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "andwait");
future = async.method(method, generic);
checkFutureOkResponse(future);
}
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithClassThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: optionsWithClassThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:394;
*
* @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 optionsWithClassThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("optionsnotok");
Future<Response> future = async.options(Response.class);
checkFutureStatusResponseNoTime(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithCallbackThrowsWebApplicationExceptionTest.
/*
* @testName: traceWithCallbackThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:408;
*
* @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 traceWithCallbackThrowsWebApplicationExceptionTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("tracenotok");
InvocationCallback<String> callback = createStringCallback(false);
Future<String> future = async.trace(callback);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
Aggregations