Search in sources :

Example 76 with Response

use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method optionsWithGenericTypeResponseWhileServerWaitTest.

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

Example 77 with Response

use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method methodWhileServerWaitTest.

/*
   * @testName: methodWhileServerWaitTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:385;
   * 
   * @test_Strategy: Invoke an arbitrary method for the current request
   * asynchronously.
   */
@Test
public void methodWhileServerWaitTest() throws Fault {
    Future<Response> future = null;
    for (String method : METHODS) {
        AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "andwait");
        future = async.method(method);
        checkFutureOkResponse(future);
    }
// return future;
}
Also used : Response(jakarta.ws.rs.core.Response) AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Example 78 with Response

use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method traceWithGenericTypeResponseWhileServerWaitTest.

/*
   * @testName: traceWithGenericTypeResponseWhileServerWaitTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:407;
   * 
   * @test_Strategy: Invoke HTTP trace method for the current request
   * asynchronously.
   */
@Test
public void traceWithGenericTypeResponseWhileServerWaitTest() throws Fault {
    GenericType<Response> generic = createGeneric(Response.class);
    AsyncInvoker async = startAsyncInvokerForMethod("traceandwait");
    Future<Response> future = async.trace(generic);
    checkFutureOkResponse(future);
// return future;
}
Also used : Response(jakarta.ws.rs.core.Response) AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Example 79 with Response

use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method headWhileServerWaitTest.

/*
   * @testName: headWhileServerWaitTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:383;
   * 
   * @test_Strategy: Invoke HTTP HEAD method for the current request
   * asynchronously.
   */
@Test
public void headWhileServerWaitTest() throws Fault {
    AsyncInvoker async = startAsyncInvokerForMethod("headandwait");
    Future<Response> future = async.head();
    checkFutureOkResponse(future);
// return future;
}
Also used : Response(jakarta.ws.rs.core.Response) AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Example 80 with Response

use of jakarta.ws.rs.core.Response in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method methodWithResponseClassWhileServerWaitTest.

/*
   * @testName: methodWithResponseClassWhileServerWaitTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:386;
   * 
   * @test_Strategy: Invoke an arbitrary method for the current request
   * asynchronously.
   */
@Test
public void methodWithResponseClassWhileServerWaitTest() throws Fault {
    Future<Response> future = null;
    for (String method : METHODS) {
        AsyncInvoker async = startAsyncInvokerForMethod(method.toLowerCase() + "andwait");
        future = async.method(method, Response.class);
        checkFutureOkResponse(future);
    }
// return future;
}
Also used : Response(jakarta.ws.rs.core.Response) AsyncInvoker(jakarta.ws.rs.client.AsyncInvoker) Test(org.junit.jupiter.api.Test)

Aggregations

Response (jakarta.ws.rs.core.Response)665 Test (org.junit.jupiter.api.Test)551 AsyncInvoker (jakarta.ws.rs.client.AsyncInvoker)78 ClientRequestContext (jakarta.ws.rs.client.ClientRequestContext)71 ResponseBuilder (jakarta.ws.rs.core.Response.ResponseBuilder)67 Invocation (jakarta.ws.rs.client.Invocation)65 CompletionStageRxInvoker (jakarta.ws.rs.client.CompletionStageRxInvoker)51 Path (jakarta.ws.rs.Path)44 IOException (java.io.IOException)43 SyncInvoker (jakarta.ws.rs.client.SyncInvoker)41 ClientResponseContext (jakarta.ws.rs.client.ClientResponseContext)33 POST (jakarta.ws.rs.POST)27 Client (jakarta.ws.rs.client.Client)25 WebTarget (jakarta.ws.rs.client.WebTarget)24 Link (jakarta.ws.rs.core.Link)23 Status (jakarta.ws.rs.core.Response.Status)23 MediaType (jakarta.ws.rs.core.MediaType)22 Annotation (java.lang.annotation.Annotation)22 Date (java.util.Date)21 GET (jakarta.ws.rs.GET)18