Package org.zanata.rest

Examples of org.zanata.rest.StringSet


        LocaleId de_DE = new LocaleId("de");
        getZero();
        publishTranslations(); // push some translations (with no headers)
        // Get the translations with PO headers
        ClientResponse<TranslationsResource> response =
                transResource.getTranslations("my.txt", de_DE, new StringSet(
                        "gettext"), true, null);

        TranslationsResource translations = response.getEntity();
        assertThat(translations.getExtensions().size(), greaterThan(0));
View Full Code Here


        // Push a document with no translations
        createResourceWithContentUsingPut();

        // Get the translations with PO headers
        ClientResponse<TranslationsResource> response =
                transResource.getTranslations("my.txt", de_DE, new StringSet(
                        "gettext"), true, null);

        TranslationsResource translations = response.getEntity();
        assertThat(translations.getTextFlowTargets().size(), is(0)); // Expecting
                                                                     // no
View Full Code Here

        entity.getExtensions(true).add(transHeader);

        // Push the translations
        ClientResponse<String> putResponse =
                transResource.putTranslations("my.txt", de_DE, entity,
                        new StringSet("gettext"));
        assertThat(putResponse.getResponseStatus(), is(Status.OK));
        getEm().flush();
        getEm().clear();

        // Get the translations with PO headers
        ClientResponse<TranslationsResource> transResponse =
                transResource.getTranslations("my.txt", de_DE, new StringSet(
                        "gettext"));
        TranslationsResource translations = transResponse.getEntity();

        // Make sure the headers are populated
        PoTargetHeader header =
View Full Code Here

                transResource.putTranslations("my.txt", de_DE, entity, null);
        assertThat(putResponse.getResponseStatus(), is(Status.OK));

        // Get the translations with PO headers
        ClientResponse<TranslationsResource> response =
                transResource.getTranslations("my.txt", de_DE, new StringSet(
                        "gettext"));

        TranslationsResource translations = response.getEntity();
        assertThat(translations.getTextFlowTargets().size(), greaterThan(0));

        // Now translate and push them again
        for (TextFlowTarget tft : translations.getTextFlowTargets()) {
            tft.setContents("Translated");
            tft.setState(ContentState.Approved);
        }

        putResponse =
                transResource.putTranslations("my.txt", de_DE, translations,
                        null);
        assertThat(putResponse.getStatus(),
                is(Response.Status.OK.getStatusCode()));

        // Fetch the translations again
        response =
                transResource.getTranslations("my.txt", de_DE, new StringSet(
                        "gettext"));

        translations = response.getEntity();
        assertThat(translations.getTextFlowTargets().size(), greaterThan(0));
View Full Code Here

        this.prepareResources(); // Reset Seam as part of new transaction
                                 // simulation

        // Fetch the translations again
        ClientResponse<TranslationsResource> response =
                transResource.getTranslations("my.txt", de_de, new StringSet(
                        "gettext"));

        TranslationsResource translations = response.getEntity();
        assertThat(translations.getTextFlowTargets().size(), greaterThan(0));
View Full Code Here

TOP

Related Classes of org.zanata.rest.StringSet

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.