use of ee.jakarta.tck.ws.rs.common.client.JdkLoggingFilter in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method invocationFromLinkWithMediaType.
// /////////////////////////////////////////////////////////////////////////
protected Response invocationFromLinkWithMediaType(String mediaType) throws Fault {
String url = "mediatype";
Client client = ClientBuilder.newClient();
client.register(new JdkLoggingFilter(false));
URI uri = UriBuilder.fromPath(getUrl(url)).build();
Link link = Link.fromUri(uri).type(mediaType).build();
Invocation i = client.invocation(link).buildGet();
Response response = i.invoke();
return response;
}
use of ee.jakarta.tck.ws.rs.common.client.JdkLoggingFilter in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method startBuilderForMethod.
protected Invocation.Builder startBuilderForMethod(String methodName) {
Client client = ClientBuilder.newClient();
client.register(new JdkLoggingFilter(false));
WebTarget target = client.target(getAbsoluteUrl(methodName));
Invocation.Builder ib = target.request();
return ib;
}
use of ee.jakarta.tck.ws.rs.common.client.JdkLoggingFilter in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method startAsyncInvokerForMethod.
/**
* Create AsyncInvoker for given resource method and start time
*/
protected AsyncInvoker startAsyncInvokerForMethod(String methodName) {
Client client = ClientBuilder.newClient();
client.register(new JdkLoggingFilter(false));
WebTarget target = client.target(getUrl(methodName));
AsyncInvoker async = target.request().async();
setStartTime();
return async;
}
use of ee.jakarta.tck.ws.rs.common.client.JdkLoggingFilter in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method createSyncInvokerForMethod.
/**
* Create SyncInvoker for given resource method and start time
*/
protected SyncInvoker createSyncInvokerForMethod(String methodName) {
Client client = ClientBuilder.newClient();
client.register(new JdkLoggingFilter(false));
WebTarget target = client.target(getUrl(methodName));
SyncInvoker sync = target.request();
return sync;
}
use of ee.jakarta.tck.ws.rs.common.client.JdkLoggingFilter in project jaxrs-api by eclipse-ee4j.
the class JAXRSClientIT method completionStageReturnedTest.
/* Run test */
/*
* @testName: completionStageReturnedTest
*
* @assertion_ids: JAXRS:SPEC:128;
*
* @test_Strategy:
*/
@Test
public void completionStageReturnedTest() throws Fault {
Future<Response> f = ClientBuilder.newClient().register(new JdkLoggingFilter(false)).target(getAbsoluteUrl("async")).request().async().get();
assertFalse(f.isDone());
try (Response r = f.get()) {
String msg = r.readEntity(String.class);
assertEquals(CompletionStageResource.MESSAGE, msg);
} catch (Exception e) {
fault(e);
}
}
Aggregations