use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method checkFutureStatusResponseNoTime.
protected void checkFutureStatusResponseNoTime(Future<Response> future, Status status) throws Fault {
Response response = null;
try {
response = future.get();
} catch (Exception e) {
throw new Fault(e);
}
assertOkAndLog(response, status);
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method optionsWithResponseClassWhileServerWaitTest.
/*
* @testName: optionsWithResponseClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:394;
*
* @test_Strategy: Invoke HTTP options method for the current request
* asynchronously.
*/
@Test
public void optionsWithResponseClassWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("optionsandwait");
Future<Response> future = async.options(Response.class);
checkFutureOkResponse(future);
// return future;
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method headThrowsProcessingExceptionTest.
/*
* @testName: headThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:383;
*
* @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 headThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
AsyncInvoker async = startAsyncInvokerForMethod("head");
Future<Response> future = async.head();
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getWithCallbackThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: getWithCallbackThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:382;
*
* @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 getWithCallbackThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("getnotok");
InvocationCallback<Response> callback = createCallback(false);
Future<Response> future = async.get(callback);
checkFutureStatusResponseNoTime(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method headTest.
// ------------------------------------------------------------------
// ---------------------------HEAD-----------------------------------
// ------------------------------------------------------------------
/*
* @testName: headTest
*
* @assertion_ids: JAXRS:JAVADOC:383;
*
* @test_Strategy: Invoke HTTP HEAD method for the current request
* asynchronously.
*/
@Test
public void headTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("head");
Future<Response> future = async.head();
checkFutureOkResponseNoTime(future);
// return future;
}
Aggregations