Search in sources :

Example 16 with ResponseBuilder

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

the class JAXRSClientIT method setGenericTypeTest.

/*
   * @testName: setGenericTypeTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:911; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
   * 
   * @test_Strategy: Update type of the object to be produced or written.
   * 
   * ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
   * aborted
   */
@Test
public void setGenericTypeTest() throws Fault {
    ResponseBuilder builder = createResponse(ContextOperation.SETGENERICTYPE);
    Response fake = builder.build();
    addProviders(fake);
    setProperty(Property.SEARCH_STRING, "[B");
    invoke();
}
Also used : Response(jakarta.ws.rs.core.Response) ResponseBuilder(jakarta.ws.rs.core.Response.ResponseBuilder) Test(org.junit.jupiter.api.Test)

Example 17 with ResponseBuilder

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

the class JAXRSClientIT method getHeadersOperationSetTest.

/*
   * @testName: getHeadersOperationSetTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:923; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
   * 
   * @test_Strategy: Get mutable map of HTTP headers.
   * 
   * ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
   * aborted
   */
@Test
public void getHeadersOperationSetTest() throws Fault {
    ResponseBuilder builder = createResponse(ContextOperation.GETHEADERS);
    Response fake = builder.build();
    addProviders(fake);
    setProperty(Property.SEARCH_STRING_IGNORE_CASE, TemplateInterceptorBody.OPERATION);
    invoke();
}
Also used : Response(jakarta.ws.rs.core.Response) ResponseBuilder(jakarta.ws.rs.core.Response.ResponseBuilder) Test(org.junit.jupiter.api.Test)

Example 18 with ResponseBuilder

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

the class JAXRSClientIT method getInputStreamTest.

/*
   * @testName: getInputStreamTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:924; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
   * 
   * @test_Strategy: Get the input stream of the object to be read.
   * 
   * ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
   * aborted
   */
@Test
public void getInputStreamTest() throws Fault {
    String entity = "getInputStreamEntity";
    ResponseBuilder builder = createResponse(ContextOperation.GETINPUTSTREAM);
    Response fake = builder.entity(entity).build();
    addProviders(fake);
    setProperty(Property.SEARCH_STRING, entity);
    invoke();
}
Also used : Response(jakarta.ws.rs.core.Response) ResponseBuilder(jakarta.ws.rs.core.Response.ResponseBuilder) Test(org.junit.jupiter.api.Test)

Example 19 with ResponseBuilder

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

the class JAXRSClientIT method proceedThrowsIOExceptionTest.

/*
   * @testName: proceedThrowsIOExceptionTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:925; JAXRS:JAVADOC:926; JAXRS:JAVADOC:920;
   * JAXRS:SPEC:85;
   * 
   * @test_Strategy: Throws: IOException - if an IO error arises
   * 
   * Proceed is tested in any of the interceptor tests.
   * 
   * ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
   * aborted
   */
@Test
public void proceedThrowsIOExceptionTest() throws Fault {
    ResponseBuilder builder = createResponse(ContextOperation.PROCEEDTHROWSIOEXCEPTION);
    Response fake = builder.build();
    addProviders(fake);
    setProperty(Property.SEARCH_STRING, TemplateInterceptorBody.IOE);
    invoke();
}
Also used : Response(jakarta.ws.rs.core.Response) ResponseBuilder(jakarta.ws.rs.core.Response.ResponseBuilder) Test(org.junit.jupiter.api.Test)

Example 20 with ResponseBuilder

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

the class JAXRSClientIT method getHeadersIsMutableTest.

/* Run test */
/*
   * @testName: getHeadersIsMutableTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:923; JAXRS:JAVADOC:920; JAXRS:SPEC:85;
   * 
   * @test_Strategy: Get mutable map of HTTP headers.
   * 
   * ReaderInterceptor.aroundReadFrom If abortWith is invoked, execution is
   * aborted
   */
@Test
public void getHeadersIsMutableTest() throws Fault {
    ResponseBuilder builder = createResponse(ContextOperation.GETHEADERSISMUTABLE);
    Response fake = builder.build();
    addProviders(fake);
    setProperty(Property.SEARCH_STRING, TemplateInterceptorBody.PROPERTY);
    invoke();
}
Also used : Response(jakarta.ws.rs.core.Response) ResponseBuilder(jakarta.ws.rs.core.Response.ResponseBuilder) Test(org.junit.jupiter.api.Test)

Aggregations

ResponseBuilder (jakarta.ws.rs.core.Response.ResponseBuilder)80 Response (jakarta.ws.rs.core.Response)69 Path (jakarta.ws.rs.Path)41 Test (org.junit.jupiter.api.Test)34 POST (jakarta.ws.rs.POST)27 GET (jakarta.ws.rs.GET)14 Date (java.util.Date)6 ByteArrayInputStream (java.io.ByteArrayInputStream)4 Annotation (java.lang.annotation.Annotation)4 VerificationResult (ee.jakarta.tck.ws.rs.api.rs.core.responseclient.VerificationResult)3 StringBean (ee.jakarta.tck.ws.rs.common.provider.StringBean)3 NewCookie (jakarta.ws.rs.core.NewCookie)3 RuntimeDelegate (jakarta.ws.rs.ext.RuntimeDelegate)3 IOException (java.io.IOException)3 StringBeanWithAnnotation (ee.jakarta.tck.ws.rs.common.provider.StringBeanWithAnnotation)2 Produces (jakarta.ws.rs.Produces)2 WebApplicationException (jakarta.ws.rs.WebApplicationException)2 EntityTag (jakarta.ws.rs.core.EntityTag)2 Link (jakarta.ws.rs.core.Link)2 InputStreamReader (java.io.InputStreamReader)2