use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithCallbackWhileServerWaitTest.
/*
* @testName: postWithCallbackWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:400;
*
* @test_Strategy: Invoke HTTP post method for the current request
* asynchronously.
*/
@Test
public void postWithCallbackWhileServerWaitTest() throws Fault {
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
InvocationCallback<Response> callback = createCallback(true);
AsyncInvoker async = startAsyncInvokerForMethod("postandwait");
Future<Response> future = async.post(entity, callback);
checkFutureOkResponse(future);
assertCallbackCall();
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithClassThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: putWithClassThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:402;
*
* @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 putWithClassThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("putnotok");
Future<Response> future = async.put(entity, 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 deleteWithCallbackStringWhileServerWaitTest.
/*
* @testName: deleteWithCallbackStringWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:378;
*
* @test_Strategy: Invoke HTTP DELETE method for the current request
* asynchronously.
*/
@Test
public void deleteWithCallbackStringWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("deleteandwait");
InvocationCallback<String> callback = createStringCallback(true);
Future<String> future = async.delete(callback);
checkFutureString(future, "delete");
assertCallbackCall();
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getTest.
// ------------------------------------------------------------------
// ---------------------------GET------------------------------------
// ------------------------------------------------------------------
/*
* @testName: getTest
*
* @assertion_ids: JAXRS:JAVADOC:379;
*
* @test_Strategy: Invoke HTTP GET method for the current request
* asynchronously.
*/
@Test
public void getTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("get");
Future<Response> future = async.get();
checkFutureOkResponseNoTime(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithGenericTypeResponseWhileServerWaitTest.
/*
* @testName: optionsWithGenericTypeResponseWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:395;
*
* @test_Strategy: Invoke HTTP options method for the current request
* asynchronously.
*/
@Test
public void optionsWithGenericTypeResponseWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("optionsandwait");
GenericType<Response> generic = createGeneric(Response.class);
Future<Response> future = async.options(generic);
checkFutureOkResponse(future);
// return future;
}
Aggregations