Package org.zanata.common

Examples of org.zanata.common.LocaleId


    }

    @Test
    public void multiTargetDenyWithWrongAction() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("please-deny", new LocaleId("de-DE"),
                        new HProject())).isFalse();
    }
View Full Code Here


    }

    @Test
    public void multiTargetDenyWithDifferentTargetTypes() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("please-allow", new LocaleId("de-DE"),
                        new HProjectIteration())).isFalse();
    }
View Full Code Here

    @Test
    public void multiTargetDenyCheckFailed() throws Exception {
        // Only allows German
        assertThat(complexPermissionEvaluator
                .checkPermission("please-allow", new LocaleId("es-ES"),
                        new HProject())).isFalse();
    }
View Full Code Here

    @Test
    public void multiTargetAllowWithTargetsInDifferentOrder() {
        assertThat(complexPermissionEvaluator
                .checkPermission("please-allow", new HProject(),
                        new LocaleId("de-DE"))).isTrue();
    }
View Full Code Here

        TranslationUpdatedManager spyManager = Mockito.spy(manager);

        Long docId = 1L;
        Long tfId = 1L;
        Long versionId = 1L;
        LocaleId localeId = LocaleId.DE;
        int wordCount = 10;
        ContentState oldState = ContentState.New;
        ContentState newState = ContentState.Translated;

        WordStatistic stats = new WordStatistic(10, 10, 10, 10, 10);
View Full Code Here

    @Override
    public LocaleId fromString(String string) {
        if (string == null) {
            return null;
        } else {
            return new LocaleId(string);
        }
    }
View Full Code Here

    public <X> LocaleId wrap(X value, WrapperOptions options) {
        if (value == null) {
            return null;
        }
        if (String.class.isInstance(value)) {
            return new LocaleId((String) value);
        }
        throw unknownWrap(value.getClass());
    }
View Full Code Here

                new TranslationsTMXExportStrategy(targetLocale));
    }

    private @Nonnull
    Iterator<ITextFlow> createTestData() {
        LocaleId fr = LocaleId.FR;
        LocaleId de = LocaleId.DE;
        return Lists.<ITextFlow> newArrayList(
                new SimpleTextFlow("doc0:resId0", toMap(
                        new SimpleTextFlowTarget(fr, Approved, "targetFR0",
                                "targetFR1"), new SimpleTextFlowTarget(de,
                                Approved, "targetDE0", "targetDE1")),
View Full Code Here

    }

    @Test
    public void testNewReviewActivityInserted() throws Exception {
        activityService.logTextFlowStateUpdate(new TextFlowTargetStateEvent(
                personId, versionId, documentId, null, new LocaleId("as"),
                textFlowTargetId, ContentState.Approved,
                ContentState.NeedReview));
        Activity activity =
                activityService.findActivity(personId,
                        EntityType.HProjectIteration, projectVersionId,
View Full Code Here

    }

    @Test
    public void testNewReviewActivityUpdated() throws Exception {
        activityService.logTextFlowStateUpdate(new TextFlowTargetStateEvent(
                personId, versionId, documentId, null, new LocaleId("as"),
                textFlowTargetId, ContentState.Approved,
                ContentState.NeedReview));

        List<Activity> activities =
                activityService.findLatestActivitiesForContext(personId,
                        projectVersionId, 0, 10);
        assertThat(activities.size(), equalTo(1));

        activityService.logTextFlowStateUpdate(new TextFlowTargetStateEvent(
                personId, versionId, documentId, null, new LocaleId("as"),
                textFlowTargetId, ContentState.Rejected,
                ContentState.NeedReview));

        activities =
                activityService.findLatestActivitiesForContext(personId,
View Full Code Here

TOP

Related Classes of org.zanata.common.LocaleId

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.