use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithResponseClassWhileServerWaitTest.
/*
* @testName: getWithResponseClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:380;
*
* @test_Strategy: Invoke HTTP GET method for the current request
* asynchronously.
*/
@Test
public void getWithResponseClassWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("getandwait");
Future<Response> future = async.get(Response.class);
checkFutureOkResponse(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithGenericTypeStringWhileServerWaitTest.
/*
* @testName: traceWithGenericTypeStringWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:407;
*
* @test_Strategy: Invoke HTTP trace method for the current request
* asynchronously.
*/
@Test
public void traceWithGenericTypeStringWhileServerWaitTest() throws Fault {
GenericType<String> generic = createGeneric(String.class);
AsyncInvoker async = startAsyncInvokerForMethod("traceandwait");
Future<String> future = async.trace(generic);
checkFutureString(future, "trace");
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithCallbackWithEntityThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName:
* methodWithCallbackWithEntityThrowsNoWebApplicationExceptionForResponseTest
*
* @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 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 methodWithCallbackWithEntityThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Future<Response> future = null;
InvocationCallback<Response> callback = createCallback(false);
for (String method : ENTITY_METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "notok");
Entity<String> entity = Entity.entity(method, MediaType.WILDCARD_TYPE);
future = async.method(method, 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 methodWithCallbackWhileServerWaitTest.
/*
* @testName: methodWithCallbackWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:388;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* asynchronously.
*/
@Test
public void methodWithCallbackWhileServerWaitTest() throws Fault {
InvocationCallback<Response> callback = createCallback(true);
Future<Response> future = null;
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "andwait");
future = async.method(method, callback);
checkFutureOkResponse(future);
assertCallbackCall();
}
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWhileServerWaitTest.
/*
* @testName: optionsWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:393;
*
* @test_Strategy: Invoke HTTP options method for the current request
* asynchronously.
*/
@Test
public void optionsWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("optionsandwait");
Future<Response> future = async.options();
checkFutureOkResponse(future);
// return future;
}
Aggregations