Package org.zanata.common

Examples of org.zanata.common.LocaleId


    }

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

        Activity activity =
                activityService.findActivity(personId,
                        EntityType.HProjectIteration, projectVersionId,
                        ActivityType.UPDATE_TRANSLATION, new Date());
        assertThat(activity, not(nullValue()));

        Long id = activity.getId();

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

        activity =
                activityService.findActivity(personId,
                        EntityType.HProjectIteration, projectVersionId,
View Full Code Here


    }

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

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

        activityService.onDocumentUploaded(new DocumentUploadedEvent(personId,
                documentId, false, new LocaleId("as")));

        List<Activity> activities =
                activityService.findLatestActivitiesForContext(personId,
                        projectVersionId, 0, 5);
        assertThat(activities.size(), equalTo(3));
View Full Code Here

        newSelectedStats.addStats(new TranslationStatistics(new TransUnitCount(
                1, 2, 3), LocaleId.EN_US.toString()));
        newSelectedStats.addStats(new TranslationStatistics(new TransUnitWords(
                4, 5, 6), LocaleId.EN_US.toString()));
        DocumentInfo documentInfo =
                new DocumentInfo(docId, "a.po", "pot/", new LocaleId("en-US"),
                        newSelectedStats, new AuditInfo(new Date(),
                                "Translator"), new HashMap<String, String>(),
                        new AuditInfo(new Date(), "last translator"));
        when(documentListPresenter.getDocumentInfo(docId)).thenReturn(
                documentInfo);
View Full Code Here

                1, 2, 3), LocaleId.EN_US.toString()));
        newSelectedStats.addStats(new TranslationStatistics(new TransUnitWords(
                4, 5, 6), LocaleId.EN_US.toString()));

        DocumentInfo documentInfo =
                new DocumentInfo(docId, "a.po", "pot/", new LocaleId("en-US"),
                        newSelectedStats, new AuditInfo(new Date(),
                                "Translator"), new HashMap<String, String>(),
                        new AuditInfo(new Date(), "last translator"));
        when(documentListPresenter.getDocumentInfo(docId)).thenReturn(
                documentInfo);
View Full Code Here

        presenter.setStatesForTest(projectStats, selectedDocumentStats, null,
                null);
        presenter.showView(MainView.Editor);
        DocumentId docId = new DocumentId(1L, "");
        DocumentInfo documentInfo =
                new DocumentInfo(docId, "a.po", "pot/", new LocaleId("en-US"),
                        selectedDocumentStats, new AuditInfo(new Date(),
                                "Translator"), new HashMap<String, String>(),
                        new AuditInfo(new Date(), "last translator"));
        when(documentListPresenter.getDocumentInfo(docId)).thenReturn(
                documentInfo);
View Full Code Here

    @Test
    public void onDocumentsClickWillFireNewHistoryItemAndSwitchToDocumentView() {
        // Given: current token is search view and has selected doc
        DocumentId docId = new DocumentId(1L, "");
        DocumentInfo documentInfo =
                new DocumentInfo(docId, "a.po", "pot/", new LocaleId("en-US"),
                        selectedDocumentStats, new AuditInfo(new Date(),
                                "Translator"), new HashMap<String, String>(),
                        new AuditInfo(new Date(), "last translator"));
        when(documentListPresenter.getDocumentInfo(docId)).thenReturn(
                documentInfo);
View Full Code Here

    @BeforeMethod(firstTimeOnly = true)
    public void setup() {
        documentDAO = new DocumentDAO(getSession());
        localeDAO = new LocaleDAO(getSession());
        as = localeDAO.findByLocaleId(new LocaleId("as"));
        de = localeDAO.findByLocaleId(new LocaleId("de"));
    }
View Full Code Here

    }

    @Test
    public void testFindByLocale() {
        log.debug("testFindByLocale");
        HLocale hl = dao.findByLocaleId(new LocaleId("de"));
        assertThat(hl.getLocaleId().getId(), is("de"));
    }
View Full Code Here

        target.setContents("hello world");
        target.setState(ContentState.Approved);
        target.setTranslator(new Person("root@localhost", "Admin user"));
        entity.getTextFlowTargets().add(target);

        LocaleId de_DE = new LocaleId("de");
        ClientResponse<String> response =
                transResource.putTranslations("my.txt", de_DE, entity, null);

        assertThat(response.getResponseStatus(), is(Status.OK));
View Full Code Here

         */
    }

    @Test
    public void getDocumentWithResources() throws Exception {
        LocaleId nbLocale = new LocaleId("de");
        String docName = "my/path/document.txt";
        String docUri = RestUtil.convertToDocumentURIId(docName);
        Resource resource = createSourceDoc(docName, true);
        sourceDocResource.putResource(docUri, resource, null);
        TranslationsResource trans = createTargetDoc();
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.