Search in sources :

Example 11 with ReadableWritableEntity

use of ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity in project jaxrs-api by eclipse-ee4j.

the class JAXRSProvidersClientIT method readEntityFromBodyTest.

/*
   * @testName: readEntityFromBodyTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:271; JAXRS:JAVADOC:272; JAXRS:JAVADOC:138;
   * JAXRS:JAVADOC:304; JAXRS:JAVADOC:282;
   * 
   * @test_Strategy: Put entity to body and read it using reader
   */
@Test
public void readEntityFromBodyTest() throws Fault {
    ReadableWritableEntity entity;
    entity = new ReadableWritableEntity(EnumProvider.JAXRS.name());
    setProperty(Property.REQUEST_HEADERS, "Content-Type: " + MediaType.TEXT_XML);
    setProperty(Property.REQUEST, buildRequest("POST", "readEntityFromBody"));
    setProperty(Property.CONTENT, entity.toXmlString());
    setProperty(Property.STATUS_CODE, getStatusCode(Status.OK));
    invoke();
}
Also used : ReadableWritableEntity(ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity) Test(org.junit.jupiter.api.Test)

Example 12 with ReadableWritableEntity

use of ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity in project jaxrs-api by eclipse-ee4j.

the class TSAppConfig method getSingletons.

@Override
public Set<Object> getSingletons() {
    Set<Object> singletons = new HashSet<Object>();
    singletons.add(EnumProvider.CTS);
    singletons.add(new ReadableWritableEntity(""));
    singletons.add(new ApplicationHolderSingleton(this));
    return singletons;
}
Also used : ReadableWritableEntity(ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity) ApplicationHolderSingleton(ee.jakarta.tck.ws.rs.ee.rs.core.application.ApplicationHolderSingleton) HashSet(java.util.HashSet)

Aggregations

ReadableWritableEntity (ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity)12 Test (org.junit.jupiter.api.Test)6 GET (jakarta.ws.rs.GET)5 Path (jakarta.ws.rs.Path)5 Status (jakarta.ws.rs.core.Response.Status)4 ApplicationHolderSingleton (ee.jakarta.tck.ws.rs.ee.rs.core.application.ApplicationHolderSingleton)1 ResponseBuilder (jakarta.ws.rs.core.Response.ResponseBuilder)1 RuntimeDelegate (jakarta.ws.rs.ext.RuntimeDelegate)1 HashSet (java.util.HashSet)1