Search in sources :

Example 1 with StringStreamingOutput

use of ee.jakarta.tck.ws.rs.common.impl.StringStreamingOutput in project jaxrs-api by eclipse-ee4j.

the class MBWCheckResource method sendStreamingOutput.

@GET
@Path("streamingoutput")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void sendStreamingOutput(@Context SseEventSink sink, @Context Sse sse) {
    try (SseEventSink s = sink) {
        StringStreamingOutput output = new StringStreamingOutput(MESSAGE);
        s.send(sse.newEventBuilder().data(output).mediaType(MediaType.WILDCARD_TYPE).build());
    }
}
Also used : SseEventSink(jakarta.ws.rs.sse.SseEventSink) StringStreamingOutput(ee.jakarta.tck.ws.rs.common.impl.StringStreamingOutput) Path(jakarta.ws.rs.Path) Produces(jakarta.ws.rs.Produces) GET(jakarta.ws.rs.GET)

Example 2 with StringStreamingOutput

use of ee.jakarta.tck.ws.rs.common.impl.StringStreamingOutput in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method clientStreamingOutputWriterTest.

/*
   * @testName: clientStreamingOutputWriterTest
   * 
   * @assertion_ids: JAXRS:SPEC:70;
   * 
   * @test_Strategy: See Section 4.2.4 for a list of entity providers that MUST
   * be supported by all JAX-RS implementations
   */
@Test
public void clientStreamingOutputWriterTest() throws Fault {
    setProperty(Property.REQUEST_HEADERS, buildContentType(MediaType.APPLICATION_FORM_URLENCODED_TYPE));
    StreamingOutput output = new StringStreamingOutput(entity);
    standardWriterInvocation(output);
}
Also used : StringStreamingOutput(ee.jakarta.tck.ws.rs.common.impl.StringStreamingOutput) StreamingOutput(jakarta.ws.rs.core.StreamingOutput) StringStreamingOutput(ee.jakarta.tck.ws.rs.common.impl.StringStreamingOutput) Test(org.junit.jupiter.api.Test)

Aggregations

StringStreamingOutput (ee.jakarta.tck.ws.rs.common.impl.StringStreamingOutput)2 GET (jakarta.ws.rs.GET)1 Path (jakarta.ws.rs.Path)1 Produces (jakarta.ws.rs.Produces)1 StreamingOutput (jakarta.ws.rs.core.StreamingOutput)1 SseEventSink (jakarta.ws.rs.sse.SseEventSink)1 Test (org.junit.jupiter.api.Test)1