Search in sources :

Example 1 with StringDataSource

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

the class JAXRSClientIT method clientDataSourceWriterTest.

/*
   * @testName: clientDataSourceWriterTest
   * 
   * @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 clientDataSourceWriterTest() throws Fault {
    DataSource ds = new StringDataSource(entity, MediaType.WILDCARD_TYPE);
    standardWriterInvocation(ds);
}
Also used : StringDataSource(ee.jakarta.tck.ws.rs.common.impl.StringDataSource) StringDataSource(ee.jakarta.tck.ws.rs.common.impl.StringDataSource) DataSource(jakarta.activation.DataSource) Test(org.junit.jupiter.api.Test)

Example 2 with StringDataSource

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

the class JAXRSClientIT method dataSourceWriterClientInterceptorTest.

/*
   * @testName: dataSourceWriterClientInterceptorTest
   * 
   * @assertion_ids: JAXRS:SPEC:84;
   * 
   * @test_Strategy: JAX-RS implementations are REQUIRED to call registered
   * interceptors when mapping representations to Java types and vice versa.
   */
@Test
@Tag("xml_binding")
public void dataSourceWriterClientInterceptorTest() throws Fault {
    StringDataSource source = new StringDataSource(content, MediaType.WILDCARD_TYPE);
    addProvider(EntityWriterInterceptor.class);
    addInterceptors(EntityWriterInterceptor.class);
    setRequestContentEntity(source);
    setProperty(Property.REQUEST, buildRequest(Request.POST, "postdatasource"));
    setProperty(Property.SEARCH_STRING, EntityWriterInterceptor.class.getName());
    setProperty(Property.UNEXPECTED_RESPONSE_MATCH, Resource.DIRECTION);
    invoke();
    logMsg("JAXRS called registered writer interceptor for dataSource provider");
}
Also used : StringDataSource(ee.jakarta.tck.ws.rs.common.impl.StringDataSource) Test(org.junit.jupiter.api.Test) Tag(org.junit.jupiter.api.Tag)

Aggregations

StringDataSource (ee.jakarta.tck.ws.rs.common.impl.StringDataSource)2 Test (org.junit.jupiter.api.Test)2 DataSource (jakarta.activation.DataSource)1 Tag (org.junit.jupiter.api.Tag)1