Package com.sun.jersey.api.client.filter

Examples of com.sun.jersey.api.client.filter.LoggingFilter


    //Shows injection of context objects into the fields of a managed bean
    @Test
    public void testManagedBeanWithUseOfInjectionOfContextObjectsIntoFieldsResource() throws Exception {
        WebResource webResource = resource().path("/simple");
        webResource.addFilter(new LoggingFilter());
        String responseMsg = webResource.get(String.class);
        //grab port from environment when running inside hudson and port is changed
        // otherwise, fall back to default port 8080
        String httpPort = System.getProperty("jersey.test.port");
        if (httpPort.equals(null)) {
View Full Code Here


    //Shows injection of context objects and path parameters into the fields of a managed
    @Test
    public void testManagedBeanWithUseOfInjectionOfContextObjectsAndPathParamsIntoFieldsResource() throws Exception {
        WebResource webResource = resource().path("other/c/d");
        webResource.addFilter(new LoggingFilter());
        String responseMsg = webResource.get(String.class);
        assertEquals("OTHER c d", responseMsg);
    }
View Full Code Here

    //Shows constructor injection of a path parameter in a managed bean.
    @Test
    public void testConstructorInjectionOfAPathParamInAManagedBeanResource() throws Exception {
        WebResource webResource = resource().path("echoconstructor/a");
        webResource.addFilter(new LoggingFilter());
        String responseMsg = webResource.get(String.class);
        assertEquals("ECHO a", responseMsg);
    }
View Full Code Here

    //Shows injection of path and query parameters into the fields of a managed bean
    @Test
    public void testManagedBeanWithUseOfInjectionOfPathAndQueryParamsIntoFieldsResource() throws Exception {
        WebResource webResource = resource().path("echofield/b");
        webResource.addFilter(new LoggingFilter());
        String responseMsg = webResource.get(String.class);
        assertEquals("ECHO null b", responseMsg);
    }
View Full Code Here

    //A managed bean that uses (but does not inject) a path parameter.
    @Test
    public void testManagedBeanThatUsesButDoesNotInjectAPathParamResource() throws Exception {
        WebResource webResource = resource().path("echo/a");
        webResource.addFilter(new LoggingFilter());
        String responseMsg = webResource.get(String.class);
        assertEquals("ECHO a", responseMsg);
    }
View Full Code Here

        client.setConnectTimeout(Config.getConnectTimeout());
        client.setReadTimeout(Config.getReadTimeout());
        client.setChunkedEncodingSize(8*1024);
        userAgent.install(client);
        if (Config.useLoggingFilter()) {
            client.addFilter(new LoggingFilter());
        }
        return client;
    }
View Full Code Here

              String watchPassword = config.getString("watch.rest.password");
           
        final ClientConfig cc = new DefaultClientConfig();
        cc.getClasses().add(JacksonJsonProvider.class);
        final Client clientWithJacksonSerializer = Client.create(cc);
        clientWithJacksonSerializer.addFilter(new LoggingFilter());
        clientWithJacksonSerializer.addFilter(new HTTPBasicAuthFilter(watchUser, watchPassword));
        WebResource resource = clientWithJacksonSerializer.resource(watchEndpoint);

        final AsyncRequest areq = new AsyncRequest("monitor plan: " + plan.getPlanProperties().getName(), triggers);
        final AsyncRequest areq2 = resource.path(KBUtils.ASYNC_REQUEST + ".json/new").accept(MediaType.APPLICATION_JSON)
View Full Code Here

        this.signer = new Signer(config.getSecretKey());
        this.jerseyClient = JerseyClientFactory.createClient(config);
    }

    public void setDebugOn() {
        this.jerseyClient.addFilter(new LoggingFilter(System.out));
    }
View Full Code Here

        //check if logging is required
        boolean enableLogging = System.getProperty("enableLogging") != null;

        if (enableLogging) {
            c.addFilter(new LoggingFilter());
        }

        return c;
    }
View Full Code Here

  private Client getClient(String host) {
    if(!hostMap.containsKey(host)) {
      Client client = Client.create();
      if(isDebug)
        client.addFilter(new LoggingFilter());
      hostMap.put(host, client);
    }
    return hostMap.get(host);
  }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.client.filter.LoggingFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.