Package org.zanata.rest.dto

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


    }

    @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

    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

    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

        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

    }

    @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

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

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.