Package org.zanata.rest.client

Examples of org.zanata.rest.client.IProjectIterationResource


        ClientResponse response = projectResource.put(project);
        checkStatusAndReleaseConnection(response);

        ProjectIteration iteration = new ProjectIteration();
        iteration.setId(iterationSlug);
        IProjectIterationResource projectIteration =
                zanataProxyFactory.getProjectIteration(projectSlug,
                        iterationSlug);

        ClientResponse iterationResponse = projectIteration.put(iteration);
        checkStatusAndReleaseConnection(iterationResponse);
    }
View Full Code Here


        resources.add(projectIterationService);
    }

    @Test
    public void retrieveNonExistingIteration() {
        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve("1.0.0"));

        ClientResponse<ProjectIteration> response = resource.get();
        assertThat(response.getStatus(), is(404));
    }
View Full Code Here

        assertThat(response.getStatus(), is(404));
    }

    @Test
    public void retrieveExistingProject() {
        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve("1.0"));

        ClientResponse<ProjectIteration> response = resource.get();
        assertThat(response.getStatus(), lessThan(400));
    }
View Full Code Here

    @Test
    public void create() {

        ProjectIteration iteration = new ProjectIteration(SLUG);

        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve(SLUG));

        Response response = resource.put(iteration);

        assertThat(response.getStatus(), is(Status.CREATED.getStatusCode()));

        String location = (String) response.getMetadata().getFirst("Location");

        assertThat(location, endsWith("/iterations/i/" + SLUG));

        ClientResponse<ProjectIteration> response1 = resource.get();
        assertThat(response1.getStatus(), is(Status.OK.getStatusCode()));

        ProjectIteration iterationRes = response1.getEntity();

        assertThat(iterationRes, notNullValue());
View Full Code Here

    @Test
    public void createWithInvalidSlug() {
        ProjectIteration iteration = new ProjectIteration(SLUG_INVALID);

        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve(SLUG_INVALID));

        Response response = resource.put(iteration);

        assertThat(response.getStatus(), is(Status.NOT_FOUND.getStatusCode()));
    }
View Full Code Here

    @Test
    public void putSameProjectIteration() {
        ProjectIteration iteration = new ProjectIteration(SLUG);

        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve(SLUG));

        Response response = resource.put(iteration);
        assertThat(response.getStatus(), is(Status.CREATED.getStatusCode()));

        iteration = new ProjectIteration(SLUG);
        response = resource.put(iteration);
        assertThat(response.getStatus(), is(Status.OK.getStatusCode()));
    }
View Full Code Here

    @Test
    public void update() {
        create();
        ProjectIteration iteration = new ProjectIteration(SLUG);

        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve(SLUG));

        Response response = resource.put(iteration);
        assertThat(response.getStatus(), is(Status.OK.getStatusCode()));

        ClientResponse<ProjectIteration> gotResponse = resource.get();
        assertThat(gotResponse.getStatus(), is(Status.OK.getStatusCode()));

    }
View Full Code Here

TOP

Related Classes of org.zanata.rest.client.IProjectIterationResource

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.