use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsThrowsProcessingExceptionTest.
/*
* @testName: optionsThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:393;
*
* @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 optionsThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
AsyncInvoker async = startAsyncInvokerForMethod("options");
Future<Response> future = async.options();
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithGenericTypeThrowsWebApplicationExceptionTest.
/*
* @testName: methodWithGenericTypeThrowsWebApplicationExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:387;
*
* @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 methodWithGenericTypeThrowsWebApplicationExceptionTest() throws Fault {
Future<String> future = null;
GenericType<String> generic = createGeneric(String.class);
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "notok");
future = async.method(method, generic);
assertExceptionWithWebApplicationExceptionIsThrownAndLog(future);
}
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsTest.
// ------------------------------------------------------------------
// ---------------------------OPTIONS--------------------------------
// ------------------------------------------------------------------
/*
* @testName: optionsTest
*
* @assertion_ids: JAXRS:JAVADOC:393;
*
* @test_Strategy: Invoke HTTP options method for the current request
* asynchronously.
*/
@Test
public void optionsTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("options");
Future<Response> future = async.options();
checkFutureOkResponseNoTime(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceWithClassThrowsProcessingExceptionTest.
/*
* @testName: traceWithClassThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:406;
*
* @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 traceWithClassThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
AsyncInvoker async = startAsyncInvokerForMethod("trace");
Future<String> future = async.trace(String.class);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: putWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest
*
* @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 putWithGenericTypeThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("putnotok");
GenericType<Response> generic = createGeneric(Response.class);
Future<Response> future = async.put(entity, generic);
checkFutureStatusResponseNoTime(future, Status.NOT_ACCEPTABLE);
}
Aggregations