use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithResponseClassWithEntityWhileServerWaitTest.
/*
* @testName: methodWithResponseClassWithEntityWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:390;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* asynchronously.
*/
@Test
public void methodWithResponseClassWithEntityWhileServerWaitTest() throws Fault {
Future<Response> 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, Response.class);
checkFutureOkResponse(future);
}
// return future;
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithResponseClassWhileServerWaitTest.
/*
* @testName: postWithResponseClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:398;
*
* @test_Strategy: Invoke HTTP post method for the current request
* asynchronously.
*/
@Test
public void postWithResponseClassWhileServerWaitTest() throws Fault {
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("postandwait");
Future<Response> future = async.post(entity, Response.class);
checkFutureOkResponse(future);
// return future;
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWithCallbackWhileServerWaitTest.
/*
* @testName: postWithCallbackWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:400;
*
* @test_Strategy: Invoke HTTP post method for the current request
* asynchronously.
*/
@Test
public void postWithCallbackWhileServerWaitTest() throws Fault {
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
InvocationCallback<Response> callback = createCallback(true);
AsyncInvoker async = startAsyncInvokerForMethod("postandwait");
Future<Response> future = async.post(entity, callback);
checkFutureOkResponse(future);
assertCallbackCall();
// return future;
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithClassThrowsNoWebApplicationExceptionForResponseTest.
/*
* @testName: putWithClassThrowsNoWebApplicationExceptionForResponseTest
*
* @assertion_ids: JAXRS:JAVADOC:402;
*
* @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 putWithClassThrowsNoWebApplicationExceptionForResponseTest() throws Fault {
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
AsyncInvoker async = startAsyncInvokerForMethod("putnotok");
Future<Response> future = async.put(entity, Response.class);
checkFutureStatusResponseNoTime(future, Status.NOT_ACCEPTABLE);
}
use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method getTest.
// ------------------------------------------------------------------
// ---------------------------GET------------------------------------
// ------------------------------------------------------------------
/*
* @testName: getTest
*
* @assertion_ids: JAXRS:JAVADOC:379;
*
* @test_Strategy: Invoke HTTP GET method for the current request
* asynchronously.
*/
@Test
public void getTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("get");
Future<Response> future = async.get();
checkFutureOkResponseNoTime(future);
// return future;
}
Aggregations