Package com.sun.jersey.api.client

Examples of com.sun.jersey.api.client.Client.resource()


            createDistribution(c, w, "dist-" + i);
            createAssociationD2T(c, w, "distribution2target", "dist-" + i, "t1");
            w.post();
            w.delete();
        }
        WebResource t1versions = c.resource("http://localhost:8080/deployment/t1/versions");
        assertEquals("1.0.0\n", t1versions.get(String.class));
    }   
   
    /** Asserts that a list of entities exist by trying to GET them. */
    private void assertEntitiesExist(WebResource... entities) throws Exception {
View Full Code Here


    serverExceptionFilter = new ServerExceptionFilter();
  }

  protected Builder getBuilder(String url) {
    Client client = Client.create();
    WebResource resource = client.resource(url);

    // Provide filter that will rebuild exception that is sent from server
    resource.addFilter(serverExceptionFilter);

    return resource
View Full Code Here

     * deletes the workspace again and ensures it's no longer available.
     */
    public void testCreateAndDestroyRESTSession() throws Exception {
        Client c = Client.create();
        c.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false);
        WebResource r = c.resource("http://localhost:8080/client/work");
        try {
            r.post(String.class, "");
            fail("We should have been redirected to a new workspace.");
        }
        catch (UniformInterfaceException e) {
View Full Code Here

        }
        catch (UniformInterfaceException e) {
            ClientResponse response = e.getResponse();
            URI location = response.getLocation();
            assertTrue(location.toString().startsWith("http://localhost:8080/client/work/rest-"));
            WebResource r2 = c.resource(location);
            r2.get(String.class);           
            r2.delete();
            try {
                r2.get(String.class);
            }
View Full Code Here

        assertResources(gson, w2, "distribution", 1);
        assertResources(gson, w2, "distribution2target", 1);
        assertResources(gson, w2, "target", 1);
        w2.delete();
       
        WebResource t1versions = c.resource("http://localhost:8080/deployment/t1/versions");
        assertEquals("1.0.0\n", t1versions.get(String.class));
    }

    public void testDeployConfigurationTemplateToTargets() throws Exception {
        try {
View Full Code Here

            // just for debugging
            showLog();
            showBundles();
           
            WebResource t1versions = c.resource("http://localhost:8080/deployment/t4/versions");
            assertEquals("1.0.0\n", t1versions.get(String.class));
        }
        catch (Exception e) {
            showLog();
            throw e;
View Full Code Here

            createDistribution(c, w, "dist-" + i);
            createAssociationD2T(c, w, "distribution2target", "dist-" + i, "t1");
            w.post();
            w.delete();
        }
        WebResource t1versions = c.resource("http://localhost:8080/deployment/t1/versions");
        assertEquals("1.0.0\n", t1versions.get(String.class));
    }   
   
    /** Asserts that a list of entities exist by trying to GET them. */
    private void assertEntitiesExist(WebResource... entities) throws Exception {
View Full Code Here

    serverExceptionFilter = new ServerExceptionFilter();
  }

  protected Builder getBuilder(String url) {
    Client client = Client.create();
    WebResource resource = client.resource(url);

    // Provide filter that will rebuild exception that is sent from server
    resource.addFilter(serverExceptionFilter);

    return resource
View Full Code Here

    private WebResource getProjectRegistryBaseResource() {
        ClientConfig config = new DefaultClientConfig();
        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
                Boolean.TRUE);
        Client client = Client.create(config);
        WebResource baseWebResource = client.resource(getBaseURI());
        webResource = baseWebResource.path(
                ResourcePathConstants.ProjectResourcePathConstants.REGISTRY_API_PROJECTREGISTRY);
        return webResource;
    }
View Full Code Here

    private WebResource getExperimentRegistryBaseResource() {
        ClientConfig config = new DefaultClientConfig();
        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
                Boolean.TRUE);
        Client client = Client.create(config);
        WebResource baseWebResource = client.resource(getBaseURI());
        webResource = baseWebResource.path(
                ResourcePathConstants.ExperimentResourcePathConstants.EXP_RESOURCE_PATH);
        return webResource;
    }
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.