use of ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method clientAnyReaderUsageTest.
/* Run test */
/*
* @testName: clientAnyReaderUsageTest
*
* @assertion_ids: JAXRS:SPEC:69;
*
* @test_Strategy: JAX-RS implementations are REQUIRED to use entity providers
*/
@Test
public void clientAnyReaderUsageTest() throws Fault {
addProvider(new EntityMessageReader());
setProperty(Property.REQUEST, buildRequest(Request.GET, "readerprovider"));
setProperty(Property.REQUEST_HEADERS, buildAccept(MediaType.TEXT_XML_TYPE));
setProperty(Property.SEARCH_STRING, Resource.class.getName());
bufferEntity(true);
invoke();
ReadableWritableEntity entity = getResponse().readEntity(ReadableWritableEntity.class);
assertTrue(entity != null, "Returned Entity is null!");
assertTrue(entity.toString().equals(Resource.class.getName()), "Returned Entity" + entity.toString() + "is unexpected");
}
use of ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity in project jaxrs-api by eclipse-ee4j.
the class ReturnTypeTest method entityResponseTest.
@GET
@Path("entitybodyresponsetest")
public Response entityResponseTest() {
RuntimeDelegate rd = RuntimeDelegate.getInstance();
ResponseBuilder rb = rd.createResponseBuilder();
ReadableWritableEntity rwe = entityTest();
return rb.entity(rwe).build();
}
use of ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity in project jaxrs-api by eclipse-ee4j.
the class ProvidersServlet method isRegisteredEntityMessageReaderXml.
@GET
@Path("isRegisteredMessageReaderXml")
public Response isRegisteredEntityMessageReaderXml() {
MessageBodyReader<ReadableWritableEntity> reader;
reader = providers.getMessageBodyReader(ReadableWritableEntity.class, null, getArgumentAnnotations("readEntityFromBody"), MediaType.TEXT_XML_TYPE);
Status status = reader == null ? Status.NOT_ACCEPTABLE : Status.OK;
return Response.status(status).build();
}
use of ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity in project jaxrs-api by eclipse-ee4j.
the class ProvidersServlet method isRegisteredWriterWildCard.
@GET
@Path("isRegisteredWriterWildcard")
public Response isRegisteredWriterWildCard() {
MessageBodyWriter<ReadableWritableEntity> writer;
writer = providers.getMessageBodyWriter(ReadableWritableEntity.class, null, getMethodAnnotations("writeBodyEntityUsingWriter"), MediaType.WILDCARD_TYPE);
Status status = writer == null ? Status.NOT_ACCEPTABLE : Status.OK;
return Response.status(status).build();
}
use of ee.jakarta.tck.ws.rs.ee.rs.ext.messagebodyreaderwriter.ReadableWritableEntity in project jaxrs-api by eclipse-ee4j.
the class ProvidersServlet method isRegisteredEntityMessageReaderWildcard.
@GET
@Path("isRegisteredMessageReaderWildCard")
public Response isRegisteredEntityMessageReaderWildcard() {
MessageBodyReader<ReadableWritableEntity> reader;
reader = providers.getMessageBodyReader(ReadableWritableEntity.class, null, getArgumentAnnotations("readEntityFromBody"), MediaType.WILDCARD_TYPE);
Status status = reader == null ? Status.NOT_ACCEPTABLE : Status.OK;
return Response.status(status).build();
}
Aggregations