Examples of RestClient


Examples of org.apache.wink.client.RestClient

            }
        };

        conf.applications(app);

        RestClient client = new RestClient(conf);
        Resource resource = client.resource(serviceURL + "/testResourcePut");
        Foo response =
            resource.contentType("text/plain").accept("text/plain").post(Foo.class,
                                                                         new Foo(SENT_MESSAGE));
        assertEquals(RECEIVED_MESSAGE, response.foo);

        // Negative test - Foo Provider not registered
        try {
            client = new RestClient();
            resource = client.resource(serviceURL + "/testResourcePut");
            response =
                resource.contentType("text/plain").accept("text/plain").post(Foo.class,
                                                                             new Foo(SENT_MESSAGE));
            fail("ClientRuntimeException must be thrown");
        } catch (ClientRuntimeException e) {
View Full Code Here

Examples of org.apache.wink.client.RestClient

    protected RestClient client;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        client = new RestClient();
    }
View Full Code Here

Examples of org.apache.wink.client.RestClient

                providers.add(new DataBindingJAXRSWriter(registry));
                return providers;
            }

        });
        RestClient client = new RestClient(config);
       
        // Default to GET for RPC
        httpMethod = HttpMethod.GET;

        for (Map.Entry<Class<?>, String> e : mapping.entrySet()) {
View Full Code Here

Examples of org.apache.wink.client.RestClient

    protected RestClient client;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        client = new RestClient();
    }
View Full Code Here

Examples of org.apache.wink.client.RestClient

    @RunAsClient
    public void simpleClientToServerCall() throws URISyntaxException, MalformedURLException {
        Assert.assertNotNull(url);
        String resourcePath = TEST_SERVLET_PATH + TestController.PATH;

        RestClient restClient = new RestClient(new ClientConfig());

        URL resourceURL = new URL(url.toExternalForm() + resourcePath);
        Resource resource = restClient.resource(resourceURL.toURI());

        // invoke GET on the resource and check the result
        Assert.assertEquals("Hello CDI", resource.get(SyndFeed.class).getTitle().getValue());
    }
View Full Code Here

Examples of org.apache.wink.client.RestClient

//        "geronimo-servlet_2.5_spec").versionAsInProject()));
  }

  @Test
  public void testRestServletResolves() {
    new RestClient();
  }
View Full Code Here

Examples of org.apache.wink.client.RestClient

                                                     .toString())).start();
    }

    @Test
    public void testDummy() {
        RestClient client = new RestClient();
        ClientResponse response = client.resource("http://localhost:8080/world").get();
        String out = response.getEntity(String.class);
        System.out.println(out);
        Assert.assertEquals(200, response.getStatusCode());
    }
View Full Code Here

Examples of org.apache.wink.client.RestClient

            }

        });
       
        config.readTimeout(binding.getReadTimeout());
        RestClient client = new RestClient(config);
       
        // Default to GET for RPC
        httpMethod = HttpMethod.GET;

        for (Map.Entry<Class<?>, String> e : mapping.entrySet()) {
View Full Code Here

Examples of org.apache.wink.client.RestClient

    protected RestClient client;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        client = new RestClient();
    }
View Full Code Here

Examples of org.apache.wink.client.RestClient

    @Override
    public void setUp() throws Exception {
        super.setUp();
        client =
            new RestClient(new ClientConfig().acceptHeaderAutoSet(false)
                .applications(new Application() {

                    @Override
                    public Set<Class<?>> getClasses() {
                        Set<Class<?>> classes = new HashSet<Class<?>>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.