Package org.zanata.apicompat.rest.client

Examples of org.zanata.apicompat.rest.client.IProjectResource


    }

    @Test
    @RunAsClient
    public void getProjectXml() throws Exception {
        IProjectResource projectClient =
                super.createProxy(
                        createClientProxyFactory(TRANSLATOR, TRANSLATOR_KEY),
                        IProjectResource.class, "/projects/p/sample-project");
        ClientResponse<Project> projectResponse = projectClient.get();
        Project project = projectResponse.getEntity();

        // Assert correct parsing of all properties
        assertThat(project.getId(), is("sample-project"));
        assertThat(project.getName(), is("Sample Project"));
View Full Code Here


        Project p =
                new Project("new-project", "New Project",
                        ProjectType.Podir.toString(),
                        "This is a New Sample Project");

        IProjectResource projectClient =
                super.createProxy(createClientProxyFactory(ADMIN, ADMIN_KEY),
                        IProjectResource.class, "/projects/p/new-project");
        ClientResponse putResponse = projectClient.put(p);

        // Assert initial put
        assertThat(putResponse.getStatus(), is(Status.CREATED.getStatusCode()));
        putResponse.releaseConnection();

        // Modified Project
        p.setDescription("This is an updated project");
        putResponse = projectClient.put(p);

        // Assert modification
        assertThat(putResponse.getStatus(), is(Status.OK.getStatusCode()));
        putResponse.releaseConnection();

        // Retrieve again
        Project p2 = projectClient.get().getEntity();
        assertThat(p2.getId(), is(p.getId()));
        assertThat(p2.getName(), is(p.getName()));
        assertThat(p2.getDescription(), is(p.getDescription()));
        assertThat(p2.getIterations(), nullValue());
    }
View Full Code Here

TOP

Related Classes of org.zanata.apicompat.rest.client.IProjectResource

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.