Examples of ProjectIteration


Examples of org.zanata.rest.dto.ProjectIteration

        final Project project =
                new Project("test-project", "Test Project",
                        ProjectType.Gettext.toString(),
                        "This is a Test project");
        project.setStatus(EntityStatus.ACTIVE);
        project.getIterations(true).add(new ProjectIteration("test-1.0"));
        project.getIterations(true).add(new ProjectIteration("test-2.0"));

        new ResourceRequest(getRestEndpointUrl("/projects/p/test-project"),
                "PUT", getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

        final Project project =
                new Project("test-project", "Test Project",
                        ProjectType.Gettext.toString(),
                        "This is a Test project");
        project.setStatus(EntityStatus.ACTIVE);
        project.getIterations(true).add(new ProjectIteration("test-1.0"));
        project.getIterations(true).add(new ProjectIteration("test-2.0"));

        new ResourceRequest(
                getRestEndpointUrl("/projects/p/test-project-json"), "PUT",
                getAuthorizedEnvironment()) {
            @Override
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

            @Override
            protected void onResponse(ClientResponse response) {
                assertThat(response.getStatus(), is(200)); // Ok
                assertJaxbUnmarshal(response, ProjectIteration.class);

                ProjectIteration iteration =
                        jaxbUnmarshal(response, ProjectIteration.class);
                assertThat(iteration.getId(), is("1.0"));
                assertThat(iteration.getStatus(), is(EntityStatus.ACTIVE));
            }
        }.run();
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

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

                ProjectIteration iteration =
                        jsonUnmarshal(response, ProjectIteration.class);
                assertThat(iteration.getId(), is("1.0"));
                assertThat(iteration.getStatus(), is(EntityStatus.ACTIVE));
            }
        }.run();
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

    }

    @Test
    @RunAsClient
    public void putXml() throws Exception {
        final ProjectIteration iteration =
                new ProjectIteration("test-iteration");
        iteration.setStatus(EntityStatus.ACTIVE);

        new ResourceRequest(
                getRestEndpointUrl("/projects/p/sample-project/iterations/i/test-iteration"),
                "PUT", getAuthorizedEnvironment()) {
            @Override
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

    }

    @Test
    @RunAsClient
    public void putJson() throws Exception {
        final ProjectIteration iteration =
                new ProjectIteration("test-iteration");
        iteration.setStatus(EntityStatus.ACTIVE);

        new ResourceRequest(
                getRestEndpointUrl("/projects/p/sample-project/iterations/i/test-iteration-json"),
                "PUT", getAuthorizedEnvironment()) {
            @Override
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

    private static final String SLUG = "my-new-iteration";

    @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());
        assertThat(iterationRes.getId(), is(SLUG));
    }
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

    private static final String SLUG_INVALID = "my,new,iteration";

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

        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve(SLUG_INVALID));
View Full Code Here

Examples of org.zanata.rest.dto.ProjectIteration

        assertThat(response.getStatus(), is(Status.NOT_FOUND.getStatusCode()));
    }

    @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

Examples of org.zanata.rest.dto.ProjectIteration

    }

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

        IProjectIterationResource resource =
                getClientRequestFactory().createProxy(
                        IProjectIterationResource.class,
                        createBaseURI(RESOURCE_PATH).resolve(SLUG));
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.