use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method methodWithStringClassWhileServerWaitTest.
/*
* @testName: methodWithStringClassWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:386;
*
* @test_Strategy: Invoke an arbitrary method for the current request
* asynchronously.
*/
@Test
public void methodWithStringClassWhileServerWaitTest() throws Fault {
Future<String> future = null;
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "andwait");
future = async.method(method, 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 methodWithCallbackThrowsProcessingExceptionTest.
/*
* @testName: methodWithCallbackThrowsProcessingExceptionTest
*
* @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 an
* jakarta.ws.rs.ProcessingException thrown in case of an invocation processing
* failure.
*/
@Test
public void methodWithCallbackThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
Future<String> future = null;
InvocationCallback<String> callback = createStringCallback(false);
for (String method : METHODS) {
AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase());
future = async.method(method, callback);
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method putWithStringCallbackWhileServerWaitTest.
/*
* @testName: putWithStringCallbackWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:404;
*
* @test_Strategy: Invoke HTTP put method for the current request
* asynchronously.
*/
@Test
public void putWithStringCallbackWhileServerWaitTest() throws Fault {
Entity<String> entity = Entity.entity("put", MediaType.WILDCARD_TYPE);
InvocationCallback<String> callback = createStringCallback(true);
AsyncInvoker async = startAsyncInvokerForMethod("putandwait");
Future<String> future = async.put(entity, callback);
checkFutureString(future, "put");
assertCallbackCall();
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method postWhileServerWaitTest.
/*
* @testName: postWhileServerWaitTest
*
* @assertion_ids: JAXRS:JAVADOC:397;
*
* @test_Strategy: Invoke HTTP post method for the current request
* asynchronously.
*/
@Test
public void postWhileServerWaitTest() throws Fault {
AsyncInvoker async = startAsyncInvokerForMethod("postandwait");
Entity<String> entity = Entity.entity("post", MediaType.WILDCARD_TYPE);
Future<Response> future = async.post(entity);
checkFutureOkResponse(future);
// return future;
}
use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method traceThrowsProcessingExceptionTest.
/*
* @testName: traceThrowsProcessingExceptionTest
*
* @assertion_ids: JAXRS:JAVADOC:405;
*
* @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 traceThrowsProcessingExceptionTest() throws Fault {
_hostname = NONEXISTING_SITE;
AsyncInvoker async = startAsyncInvokerForMethod("trace");
Future<Response> future = async.trace();
assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
Aggregations