Package org.zanata.rest

Examples of org.zanata.rest.ResourceRequest


    }

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


    @Test
    @RunAsClient
    public void getAccountJson() throws Exception {
        // No client method for Json Get, so testing raw compatibility
        new ResourceRequest(getRestEndpointUrl("/accounts/u/demo"), "GET",
                getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_ACCOUNT_JSON);
View Full Code Here

    @Test
    @RunAsClient
    public void getAccountJsonUnauthorized() throws Exception {
        // No client method for Json Get, so testing raw compatibility
        new ResourceRequest(getRestEndpointUrl("/accounts/u/demo"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_ACCOUNT_JSON);
            }
View Full Code Here

     * @see org.zanata.rest.service.VersionResource
     */
    @Test
    @RunAsClient
    public void getVersionXml() throws Exception {
        new ResourceRequest(getRestEndpointUrl("/version"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.accept("application/vnd.zanata.Version+xml");
            }

View Full Code Here

    }

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

    @Test
    @RunAsClient
    public void getProjectJson() throws Exception {
        // No client method for Json Get, so testing raw compatibility
        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

    @Test
    @RunAsClient
    public void getAllProjectsJson() throws Exception {
        // No client method for Json Get, so testing raw compatibility
        new ResourceRequest(getRestEndpointUrl("/projects/"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_PROJECTS_JSON);
            }
View Full Code Here

    @RunAsClient
    public void getAllProjectsXml() throws Exception {
        // testing raw compatibility. The 1.4.4 client interface was not working
        // correctly
        // for this endpoint. Hence, just testing the server portion
        new ResourceRequest(getRestEndpointUrl("/projects/"), "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT,
                        MediaTypes.APPLICATION_ZANATA_PROJECTS_XML);
            }
View Full Code Here

    @Test
    @RunAsClient
    public void putProjectJson() throws Exception {
        // No client method for Json Put, so testing raw compatibility
        new ResourceRequest(getRestEndpointUrl("/projects/p/new-project"),
                "PUT", getAuthorizedEnvironment()) {
            @Override
            protected void prepareRequest(ClientRequest request) {
                // New Project
                Project p =
View Full Code Here

    }

    @Test
    @RunAsClient
    public void getJsonResource() throws Exception {
        new ResourceRequest(
                getRestEndpointUrl("/projects/p/sample-project/iterations/i/1.0/r/my,path,document-2.txt"),
                "GET") {
            @Override
            protected void prepareRequest(ClientRequest request) {
                request.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
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.