use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithGenericTypeResponseWhileServerWaitTest.
/*
* @testName: putWithGenericTypeResponseWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:403;
*
* @test_Strategy: Invoke HTTP put method for the current request
* asynchronously.
*/
@Test
public void putWithGenericTypeResponseWhileServerWaitTest() throws Fault {
GenericType<Response> generic = createGeneric(Response.class);
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("putandwait");
Future<Response> future = async.put(entity, generic);
checkFutureOkResponse(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithGenericTypeStringWhileServerWaitTest.
/*
* @testName: getWithGenericTypeStringWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:381;
*
* @test_Strategy: Invoke HTTP GET method for the current request
* asynchronously.
*/
@Test
public void getWithGenericTypeStringWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("getandwait");
GenericType<String> generic = createGeneric(String.class);
Future<String> future = async.get(generic);
checkFutureString(future, "get");
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithCallbackThrowsWebApplicationExceptionTest.
/*
* @testName: optionsWithCallbackThrowsWebApplicationExceptionTest
*
* @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 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 optionsWithCallbackThrowsWebApplicationExceptionTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("optionsnotok");
InvocationCallback<String> callback = createStringCallback(false);
Future<String> future = async.options(callback);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method headWithCallbackWhileServerWaitTest.
/*
* @testName: headWithCallbackWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:384;
*
* @test_Strategy: Invoke HTTP HEAD method for the current request
* asynchronously.
*/
@Test
public void headWithCallbackWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("headandwait");
InvocationCallback<Response> callback = createCallback(true);
Future<Response> future = async.head(callback);
checkFutureOkResponse(future);
assertCallbackCall();
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithGenericTypeThrowsProcessingExceptionTest.
/*
* @testName: putWithGenericTypeThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:403;
*
* @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 putWithGenericTypeThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
GenericType<String> generic = createGeneric(String.class);
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("put");
Future<String> future = async.put(entity, generic);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
Aggregations