Package org.zanata.rest.dto

Examples of org.zanata.rest.dto.Project


    }

    @Test
    @RunAsClient
    public void putXml() throws Exception {
        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


    }

    @Test
    @RunAsClient
    public void putJson() throws Exception {
        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

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

                Project project = jaxbUnmarshal(response, Project.class);
                assertThat(project.getId(), is("sample-project"));
                assertThat(project.getDescription(), is("An example Project"));
                assertThat(project.getStatus(), is(EntityStatus.ACTIVE));
                assertThat(project.getName(), is("Sample Project"));
                // 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

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

                Project project = jsonUnmarshal(response, Project.class);
                assertThat(project.getId(), is("sample-project"));
                assertThat(project.getDescription(), is("An example Project"));
                assertThat(project.getStatus(), is(EntityStatus.ACTIVE));
                assertThat(project.getName(), is("Sample Project"));
                // 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

Related Classes of org.zanata.rest.dto.Project

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.