Package org.zanata.rest

Examples of org.zanata.rest.ResourceRequest


        final Account account =
                new Account("test@testing.com", "Test Account", "testuser",
                        "Eyox7xbNQ09MkIfRyH+rjg==");
        account.setEnabled(false);

        new ResourceRequest(getRestEndpointUrl("/accounts/u/testuser"), "PUT",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.body(MediaTypes.APPLICATION_ZANATA_ACCOUNT_JSON,
                        jsonMarshal(account).getBytes());
View Full Code Here


        final Account account =
                new Account("test@testing.com", "Test Account", "testuser",
                        "Eyox7xbNQ09MkIfRyH+rjg==");
        account.setEnabled(false);

        new ResourceRequest(getRestEndpointUrl("/accounts/u/testuser"), "PUT") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.body(MediaTypes.APPLICATION_ZANATA_ACCOUNT_JSON,
                        jsonMarshal(account).getBytes());
            }
View Full Code Here

    }

    @Test
    @RunAsClient
    public void getJson() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/version"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_VERSION_JSON);
            }
View Full Code Here

    }

    @Test
    @RunAsClient
    public void getXml() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/version"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_VERSION_XML);
            }
View Full Code Here

    }

    @Test
    @RunAsClient
    public void head() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/projects/p/sample-project"),
                "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
            }
View Full Code Here

    }

    @Test
    @RunAsClient
    public void getXml() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/projects/p/sample-project"),
                "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_PROJECT_XML);
View Full Code Here

    }

    @Test
    @RunAsClient
    public void getJson() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/projects/p/sample-project"),
                "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_PROJECT_JSON);
View Full Code Here

                        "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) {
                request.body(MediaTypes.APPLICATION_ZANATA_PROJECT_XML,
                        jaxbMarhsal(project).getBytes());
View Full Code Here

                        "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
            protected void prepareRequest(ClientRequest request) {
                request.body(MediaTypes.APPLICATION_ZANATA_PROJECT_JSON,
View Full Code Here

    }

    @Test
    @RunAsClient
    public void getAllXml() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/projects"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_PROJECTS_XML);
            }
View Full Code Here

TOP

Related Classes of org.zanata.rest.ResourceRequest

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.