Examples of ProjectIteration


Examples of org.zanata.apicompat.rest.dto.ProjectIteration

            @Override
            protected void onResponse(ClientResponse response) {
                assertThat(response.getStatus(), is(Status.OK.getStatusCode())); // 200
                assertJsonUnmarshal(response, ProjectIteration.class);

                ProjectIteration it =
                        jsonUnmarshal(response, ProjectIteration.class);
                assertThat(it.getId(), is("1.0"));
            }

        }.run();
    }
View Full Code Here

Examples of org.zanata.apicompat.rest.dto.ProjectIteration

    }

    @Test
    @RunAsClient
    public void putJsonProjectIteration() throws Exception {
        final ProjectIteration newIteration =
                new ProjectIteration("new-iteration");

        new ResourceRequest(
                getRestEndpointUrl("/projects/p/sample-project/iterations/i/"
                        + newIteration.getId()), "PUT",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.body(
                        MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON,
                        jsonMarshal(newIteration));
            };

            @Override
            protected void onResponse(ClientResponse response) {
                assertThat(response.getStatus(),
                        is(Status.CREATED.getStatusCode())); // 201
            }

        }.run();

        // Retreive it again
        IProjectIterationResource iterationClient =
                super.createProxy(
                        createClientProxyFactory(TRANSLATOR, TRANSLATOR_KEY),
                        IProjectIterationResource.class,
                        "/projects/p/sample-project/iterations/i/"
                                + newIteration.getId());

        ClientResponse<ProjectIteration> getResponse = iterationClient.get();

        assertThat(getResponse.getStatus(), is(Status.OK.getStatusCode())); // 200

        ProjectIteration it = getResponse.getEntity();
        assertThat(it.getId(), is("new-iteration"));
    }
View Full Code Here

Examples of org.zanata.apicompat.rest.dto.ProjectIteration

                        "/projects/p/sample-project/iterations/i/1.0");
        ClientResponse<ProjectIteration> response = iterationClient.get();

        assertThat(response.getStatus(), is(Status.OK.getStatusCode())); // 200

        ProjectIteration it = response.getEntity();
        assertThat(it.getId(), is("1.0"));
    }
View Full Code Here

Examples of org.zanata.apicompat.rest.dto.ProjectIteration

    }

    @Test
    @RunAsClient
    public void putXmlProjectIteration() throws Exception {
        ProjectIteration newIteration = new ProjectIteration("new-iteration");

        IProjectIterationResource iterationClient =
                super.createProxy(createClientProxyFactory(ADMIN, ADMIN_KEY),
                        IProjectIterationResource.class,
                        "/projects/p/sample-project/iterations/i/"
                                + newIteration.getId());
        ClientResponse response = iterationClient.put(newIteration);

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

        // Retreive it again
        ClientResponse<ProjectIteration> getResponse = iterationClient.get();

        assertThat(getResponse.getStatus(), is(Status.OK.getStatusCode())); // 200

        ProjectIteration it = getResponse.getEntity();
        assertThat(it.getId(), is("new-iteration"));
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

                projectIterationDAO.getBySlug(projectSlug, versionSlug);
        if (hProjectIteration == null) {
            return Response.status(Response.Status.NOT_FOUND).build();
        }

        ProjectIteration it = new ProjectIteration();
        ProjectIterationService.transfer(hProjectIteration, it);

        return Response.ok(it).tag(etag).build();
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

        project.setName(projectSlug);

        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);
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

                        getIterationSlug());
        if (hProjectIteration == null) {
            return Response.status(Status.NOT_FOUND).build();
        }

        ProjectIteration it = new ProjectIteration();
        transfer(hProjectIteration, it);

        return Response.ok(it).tag(etag).build();
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

    public static Project toResource(HProject hProject, MediaType mediaType) {
        Project project = new Project();
        transfer(hProject, project);
        for (HProjectIteration pIt : hProject.getProjectIterations()) {
            ProjectIteration iteration = new ProjectIteration();
            ProjectIterationService.transfer(pIt, iteration);

            iteration
                    .getLinks(true)
                    .add(new Link(
                            URI.create("iterations/i/" + pIt.getSlug()),
                            "self",
                            MediaTypes
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

                // assertThat(project.getType(),
                // is(ProjectType.IterationProject));
                assertThat(project.getIterations().size(), is(3));

                // Iteration 1
                ProjectIteration iteration = project.getIterations().get(0);
                assertThat(iteration.getId(), is("1.0"));
                assertThat(iteration.getStatus(), is(EntityStatus.ACTIVE));

                // Iteration 2
                iteration = project.getIterations().get(1);
                assertThat(iteration.getId(), is("1.1"));
                assertThat(iteration.getStatus(), is(EntityStatus.ACTIVE));
            }
        }.run();
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

                // assertThat(project.getType(),
                // is(ProjectType.IterationProject));
                assertThat(project.getIterations().size(), is(3));

                // Iteration 1
                ProjectIteration iteration = project.getIterations().get(0);
                assertThat(iteration.getId(), is("1.0"));
                assertThat(iteration.getStatus(), is(EntityStatus.ACTIVE));

                // Iteration 2
                iteration = project.getIterations().get(1);
                assertThat(iteration.getId(), is("1.1"));
                assertThat(iteration.getStatus(), is(EntityStatus.ACTIVE));
            }
        }.run();
    }
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.