Search in sources :

Example 31 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class NoEntityTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(HttpMethodResource.class);
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 32 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class GZIPContentEncodingTest method testPostChunked.

@Test
public void testPostChunked() {
    ClientConfig config = new ClientConfig();
    config.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024);
    config.connectorProvider(new JettyConnectorProvider());
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    Client client = ClientBuilder.newClient(config);
    WebTarget r = client.target(getBaseUri());
    byte[] content = new byte[1024 * 1024];
    assertTrue(Arrays.equals(content, r.request().post(Entity.entity(content, MediaType.APPLICATION_OCTET_STREAM_TYPE)).readEntity(byte[].class)));
    Response cr = r.request().post(Entity.text("POST"));
    assertTrue(cr.hasEntity());
    cr.close();
    client.close();
}
Also used : Response(javax.ws.rs.core.Response) LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) WebTarget(javax.ws.rs.client.WebTarget) ClientConfig(org.glassfish.jersey.client.ClientConfig) Client(javax.ws.rs.client.Client) Test(org.junit.Test) JerseyTest(org.glassfish.jersey.test.JerseyTest)

Example 33 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class GZIPContentEncodingTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(Resource.class);
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 34 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class ManagedClientTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(PublicResource.class, InternalResource.class, CustomHeaderFeature.class).property(ClientA.class.getName() + ".baseUri", this.getBaseUri().toString() + "internal");
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 35 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class AsyncTest method configureClient.

@Override
protected void configureClient(final ClientConfig config) {
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    config.connectorProvider(new NettyConnectorProvider());
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature)

Aggregations

LoggingFeature (org.glassfish.jersey.logging.LoggingFeature)45 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)33 Response (javax.ws.rs.core.Response)6 Client (javax.ws.rs.client.Client)4 WebTarget (javax.ws.rs.client.WebTarget)4 ContainerRequestContext (javax.ws.rs.container.ContainerRequestContext)4 ContainerRequest (org.glassfish.jersey.server.ContainerRequest)4 Resource (org.glassfish.jersey.server.model.Resource)4 ClientConfig (org.glassfish.jersey.client.ClientConfig)2 MultiPartFeature (org.glassfish.jersey.media.multipart.MultiPartFeature)2 Test (org.junit.Test)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 UserPrincipal (com.sun.security.auth.UserPrincipal)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 Principal (java.security.Principal)1 HashSet (java.util.HashSet)1 ExecutorService (java.util.concurrent.ExecutorService)1 Logger (java.util.logging.Logger)1 ClientBuilder (javax.ws.rs.client.ClientBuilder)1