use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithCallbackThrowsProcessingExceptionTest.
/*
* @testName: traceWithCallbackThrowsProcessingExceptionTest
*
* @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 an
* jakarta.ws.rs.ProcessingException thrown in case of an invocation processing
* failure.
*/
@Test
public void traceWithCallbackThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
InvocationCallback<String> callback = createStringCallback(false);
AsyncInvoker async = startAsyncInvokerForMethod("trace");
Future<String> future = async.trace(callback);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName:
* postWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:399;
*
* @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 postWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("postnotok");
GenericType<Response> generic = createGeneric(Response.class);
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
Future<Response> future = async.post(entity, generic);
checkFutureStatusResponseNoTime(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithClassThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: methodWithClassThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:386;
*
* @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 methodWithClassThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Future<Response> future = null;
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "notok");
future = async.method(method, 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 getWithGenericTypeThrowsWebApplicationExceptionTest.
/*
* @testName: getWithGenericTypeThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:381;
*
* @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 getWithGenericTypeThrowsWebApplicationExceptionTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("getnotok");
GenericType<String> generic = createGeneric(String.class);
Future<String> future = async.get(generic);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithStringClassWhileServerWaitTest.
/*
* @testName: traceWithStringClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:406;
*
* @test_Strategy: Invoke HTTP trace method for the current request
* asynchronously.
*/
@Test
public void traceWithStringClassWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("traceandwait");
Future<String> future = async.trace(String.class);
checkFutureString(future, "trace");
// return future;
}
Aggregations