use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithGenericTypeThrowsWebApplicationExceptionTest.
/*
* @testName: deleteWithGenericTypeThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:377;
*
* @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 deleteWithGenericTypeThrowsWebApplicationExceptionTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("deletenotok");
GenericType<String> generic = createGeneric(String.class);
Future<String> future = async.delete(generic);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method deleteWithCallbackStringThrowsWebApplicationExceptionTest.
/*
* @testName: deleteWithCallbackStringThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:378;
*
* @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 deleteWithCallbackStringThrowsWebApplicationExceptionTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("deletenotok");
InvocationCallback<String> callback = createStringCallback(false);
Future<String> future = async.delete(callback);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithStringClassWithEntityWhileServerWaitTest.
/*
* @testName: methodWithStringClassWithEntityWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:390;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* asynchronously.
*/
@Test
public void methodWithStringClassWithEntityWhileServerWaitTest() throws Fault {
Future<String> future = null;
for (String method : ENTITY_METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "andwait");
Entity<String> entity = Entity.entity(method, MediaType.WILDCARD_TYPE);
future = async.method(method, entity, String.class);
checkFutureString(future, method);
}
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithClassWithEntityThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName:
* methodWithClassWithEntityThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:390;
*
* @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 methodWithClassWithEntityThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Future<Response> future = null;
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, 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 methodWithClassThrowsProcessingExceptionTest.
/*
* @testName: methodWithClassThrowsProcessingExceptionTest
*
* @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 an
* jakarta.ws.rs.ProcessingException thrown in case of an invocation processing
* failure.
*/
@Test
public void methodWithClassThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
Future<String> future = null;
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase());
future = async.method(method, String.class);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
}
Aggregations