Search in sources :

Example 26 with AsyncInvoker

use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method optionsWithGenericTypeStringWhileServerWaitTest.

/*
   * @testName: optionsWithGenericTypeStringWhileServerWaitTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:395;
   * 
   * @test_Strategy: Invoke HTTP options method for the current request
   * asynchronously.
   */
@Test
public void optionsWithGenericTypeStringWhileServerWaitTest() throws Fault {
    AsyncInvoker async = startAsyncInvokerForMethod("optionsandwait");
    GenericType<String> generic = createGeneric(String.class);
    Future<String> future = async.options(generic);
    checkFutureString(future, "options");
// return future;
}
Also used : AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Example 27 with AsyncInvoker

use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method methodWithClassWithEntityThrowsProcessingExceptionTest.

/*
   * @testName: methodWithClassWithEntityThrowsProcessingExceptionTest
   * 
   * @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 an
   * jakarta.ws.rs.ProcessingException thrown in case of an invocation processing
   * failure.
   */
@Test
public void methodWithClassWithEntityThrowsProcessingExceptionTest() throws Fault {
    _hostname = NONEXISTING_SITE;
    Future<String> future = null;
    for (String method : ENTITY_METHODS) {
        AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase());
        Entity<String> entity = Entity.entity(method, MediaType.WILDCARD_TYPE);
        future = async.method(method, entity, String.class);
        assertExceptionWithProcessingExceptionIsThrownAndLog(future);
    }
}
Also used : AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Example 28 with AsyncInvoker

use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method optionsWithClassThrowsProcessingExceptionTest.

/*
   * @testName: optionsWithClassThrowsProcessingExceptionTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:394;
   * 
   * @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 optionsWithClassThrowsProcessingExceptionTest() throws Fault {
    _hostname = NONEXISTING_SITE;
    AsyncInvoker async = startAsyncInvokerForMethod("options");
    Future<String> future = async.options(String.class);
    assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
Also used : AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Example 29 with AsyncInvoker

use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method deleteWithGenericTypeThrowsProcessingExceptionTest.

/*
   * @testName: deleteWithGenericTypeThrowsProcessingExceptionTest
   * 
   * @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 an
   * jakarta.ws.rs.ProcessingException thrown in case of an invocation processing
   * failure.
   */
@Test
public void deleteWithGenericTypeThrowsProcessingExceptionTest() throws Fault {
    _hostname = NONEXISTING_SITE;
    AsyncInvoker async = startAsyncInvokerForMethod("delete");
    GenericType<String> generic = createGeneric(String.class);
    Future<String> future = async.delete(generic);
    assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
Also used : AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Example 30 with AsyncInvoker

use of jakarta.ws.rs.client.AsyncInvoker in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method getThrowsProcessingExceptionTest.

/*
   * @testName: getThrowsProcessingExceptionTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:379;
   * 
   * @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 getThrowsProcessingExceptionTest() throws Fault {
    _hostname = NONEXISTING_SITE;
    AsyncInvoker async = startAsyncInvokerForMethod("get");
    Future<Response> future = async.get();
    assertExceptionWithProcessingExceptionIsThrownAndLog(future);
}
Also used : Response(jakarta.ws.rs.core.Response) AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Aggregations

AsyncInvoker (jakarta.ws.rs.client.AsyncInvoker)151 Test (org.junit.jupiter.api.Test)148 Response (jakarta.ws.rs.core.Response)78 Client (jakarta.ws.rs.client.Client)3 WebTarget (jakarta.ws.rs.client.WebTarget)3 JdkLoggingFilter (ee.jakarta.tck.ws.rs.common.client.JdkLoggingFilter)2 Invocation (jakarta.ws.rs.client.Invocation)2 JaxrsCommonClient (ee.jakarta.tck.ws.rs.common.client.JaxrsCommonClient)1 SyncInvoker (jakarta.ws.rs.client.SyncInvoker)1 ThrottledClient (jaxrs.examples.client.custom.ThrottledClient)1