Package org.zanata.model

Examples of org.zanata.model.HLocale


            List<HLocale> iterationLocales =
                    localeServiceImpl.getSupportedLanguageByProjectIteration(
                        projectSlug, iterationSlug);
            localeIds = new LocaleId[iterationLocales.size()];
            for (int i = 0, iterationLocalesSize = iterationLocales.size(); i < iterationLocalesSize; i++) {
                HLocale loc = iterationLocales.get(i);
                localeIds[i] = loc.getLocaleId();
            }
        } else {
            localeIds = new LocaleId[locales.length];
            for (int i = 0; i < locales.length; i++) {
                localeIds[i] = new LocaleId(locales[i]);
View Full Code Here


        from.getExtensions(true).add(poHeader);
        from.setLang(LocaleId.ES);
        from.setName("name");
        from.setType(ResourceType.FILE);

        HLocale hLocale = new HLocale(LocaleId.EN_US);

        HDocument to = new HDocument("fullPath", ContentType.PO, hLocale);

        Set<String> commentExt = new HashSet<String>();
        commentExt.add(SimpleComment.ID);
View Full Code Here

    @Test(enabled = false, description = "This should be executed manually in IDE")
    @SlowTest
    @PerformanceProfiling
    // ideally change persistence.xml to use a local mysql database and monitor general log etc.
    public void transferFromResource() {
        HLocale locale = EntityMakerBuilder.builder().addConstructorParameterMaker(HLocale.class, 0, FixedValueMaker.fix(LocaleId.ES)).build()
                .makeAndPersist(getEm(), HLocale.class);
        HProjectIteration iteration =
                EntityMakerBuilder
                        .builder()
                        .addFieldOrPropertyMaker(
                                HProject.class, "sourceViewURL",
                                FixedValueMaker.EMPTY_STRING_MAKER).build()
                        .makeAndPersist(getEm(),
                                HProjectIteration.class);
        Resource from = new Resource("message");
        from.setContentType(ContentType.PO);
        LocaleId localeId = locale.getLocaleId();
        // adjust this number to suit testing purpose
        int numOfTextFlows = 50;
        for (int i = 0; i < numOfTextFlows; i++) {
            addSampleTextFlow(from, localeId, i);
        }
View Full Code Here

                new PermissionGranter(getStaticMethod(
                        SimpleTestEvaluators.class,
                        "evaluatesForMultiTarget"));

        assertThat(granter.shouldInvokeGranter(
                "multi-target-action", new HProject(), new HLocale()
        )).isTrue();
    }
View Full Code Here

        };

        autocomplete.setQuery("en");
        assertThat(autocomplete.suggest()).hasSize(3);
        // ENglish, ENglish-us and frENch
        assertThat(autocomplete.suggest()).contains(new HLocale(LocaleId.EN),
                new HLocale(LocaleId.EN_US), new HLocale(LocaleId.FR));

        autocomplete.setQuery("e");
        assertThat(autocomplete.suggest()).hasSize(5);
        // Everything
        assertThat(autocomplete.suggest()).contains(new HLocale(LocaleId.DE),
                new HLocale(LocaleId.EN), new HLocale(LocaleId.EN_US),
                new HLocale(LocaleId.ES), new HLocale(LocaleId.FR));

        autocomplete.setQuery("no-results-expected");
        assertThat(autocomplete.suggest()).hasSize(0);
        // Nothing
    }
View Full Code Here

                new PermissionGranter(getStaticMethod(
                        SimpleTestEvaluators.class,
                        "evaluatesForMultiTarget"));

        assertThat(granter.shouldInvokeGranter(
                "multi-target-action", new HLocale(), new HProject()
        )).isTrue();
    }
View Full Code Here

                new PermissionGranter(
                        getStaticMethod(SimpleTestEvaluators.class,
                                "evaluatesForMultiTarget"));

        assertThat(granter.shouldInvokeGranter(
                "multi-target-action", new HLocale()
        )).isFalse();
    }
View Full Code Here

                        getStaticMethod(SimpleTestEvaluators.class,
                                "evaluatesForMultiTarget"));

        assertThat(
                granter.shouldInvokeGranter(
                        "multi-target-action", new HLocale(), new HProject(),
                        new HProjectIteration(), new StringBuilder()
                        )).isTrue();
    }
View Full Code Here

    public void allowWhenAllArgsPresentInOrder() {
        assertThat(
                complexPermissionEvaluator
                        .checkPermission("only-when-all-args-present",
                                new HProject(),
                                new HProjectIteration(), new HLocale()))
                .isTrue();
    }
View Full Code Here

    @Test
    public void allowWhenAllArgsPresentInDisorder() {
        assertThat(
                complexPermissionEvaluator
                        .checkPermission("only-when-all-args-present",
                                new HLocale(),
                                new HProjectIteration(), new HProject()))
                .isTrue();
    }
View Full Code Here

TOP

Related Classes of org.zanata.model.HLocale

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.