use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithCallbackThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: traceWithCallbackThrowsNoWebApplicationExceptionForResponseTest
*
* @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 traceWithCallbackThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("tracenotok");
InvocationCallback<Response> callback = createCallback(false);
Future<Response> future = async.trace(callback);
checkFutureStatusResponseNoTime(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithStringClassWhileServerWaitTest.
/*
* @testName: getWithStringClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:380;
*
* @test_Strategy: Invoke HTTP GET method for the current request
* asynchronously.
*/
@Test
public void getWithStringClassWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("getandwait");
Future<String> future = async.get(String.class);
checkFutureString(future, "get");
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithGenericTypeThrowsWebApplicationExceptionTest.
/*
* @testName: putWithGenericTypeThrowsWebApplicationExceptionTest
*
* @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 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 putWithGenericTypeThrowsWebApplicationExceptionTest() throws Fault {
GenericType<String> generic = createGeneric(String.class);
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("putnotok");
Future<String> future = async.put(entity, generic);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithCallbackThrowsWebApplicationExceptionTest.
/*
* @testName: methodWithCallbackThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:388;
*
* @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 methodWithCallbackThrowsWebApplicationExceptionTest() throws Fault {
Future<String> future = null;
InvocationCallback<String> callback = createStringCallback(false);
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "notok");
future = async.method(method, callback);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithGenericTypeWithEntityThrowsProcessingExceptionTest.
/*
* @testName: methodWithGenericTypeWithEntityThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:391;
*
* @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 methodWithGenericTypeWithEntityThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
GenericType<String> generic = createGeneric(String.class);
Future<String> future = null;
for (String method : ENTITY_METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase());
Entity<String> entity = Entity.entity(method, MediaType.WILDCARD_TYPE);
future = async.method(method, entity, generic);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
}
Aggregations