Package org.zanata.webtrans.shared.model

Examples of org.zanata.webtrans.shared.model.AuditInfo


            .toString()));

        DocumentInfo docInfo =
            new DocumentInfo(new DocumentId(1111L, "no/filter/matches"),
                "matches", "no/filter", LocaleId.EN_US, stats,
                new AuditInfo(new Date(), "Translator"),
                new HashMap<String, String>(), new AuditInfo(
                new Date(), "last translator"));
        docList.add(new DocumentNode(docInfo));

        docInfo =
            new DocumentInfo(new DocumentId(2222L, "match/exact/filter"),
                "filter", "match/exact/", LocaleId.EN_US, stats,
                new AuditInfo(new Date(), "Translator"),
                new HashMap<String, String>(), new AuditInfo(
                new Date(), "last translator"));
        docList.add(new DocumentNode(docInfo));

        docInfo =
            new DocumentInfo(new DocumentId(3333L,
                "does/not/match/exact/filter"), "filter",
                "does/not/match/exact/", LocaleId.EN_US, stats,
                new AuditInfo(new Date(), "Translator"),
                new HashMap<String, String>(), new AuditInfo(
                new Date(), "last translator"));
        docList.add(new DocumentNode(docInfo));

        return docList;
    }
View Full Code Here


        // simulate document click on second document
        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(2222L, ""), "doc122",
                        "second/path/", LocaleId.EN_US,
                        new ContainerTranslationStatistics(), new AuditInfo(
                                new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        documentListPresenter.fireDocumentSelection(docInfo);

        verify(mockHistory).newItem(capturedHistoryToken.capture());
        verify(mockUserWorkspaceContext).setSelectedDoc(docInfo);
View Full Code Here

        DocumentId doc1 = new DocumentId(1111L, "no/filter/matches");
        DocumentInfo docInfo = documentListPresenter.getDocumentInfo(doc1);

        assertThat(docInfo, is(equalTo(new DocumentInfo(doc1, "doc111",
                "first/path/", LocaleId.EN_US,
                new ContainerTranslationStatistics(), new AuditInfo(new Date(),
                        "Translator"), new HashMap<String, String>(),
                new AuditInfo(new Date(), "last translator")))));

        DocumentId doc2 = new DocumentId(3333L, "does/not/match/exact/filter");
        docInfo = documentListPresenter.getDocumentInfo(doc2);
        assertThat(docInfo, is(equalTo(new DocumentInfo(doc2, "doc123",
                "third/path/", LocaleId.EN_US,
                new ContainerTranslationStatistics(), new AuditInfo(new Date(),
                        "Translator"), new HashMap<String, String>(),
                new AuditInfo(new Date(), "last translator")))));
    }
View Full Code Here

                .toString()));

        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(1111L, "no/filter/matches"),
                        "matches", "no/filter", LocaleId.EN_US, stats,
                        new AuditInfo(new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        docList.add(docInfo);

        docInfo =
                new DocumentInfo(new DocumentId(2222L, "match/exact/filter"),
                        "filter", "match/exact/", LocaleId.EN_US, stats,
                        new AuditInfo(new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        docList.add(docInfo);

        docInfo =
                new DocumentInfo(new DocumentId(3333L,
                        "does/not/match/exact/filter"), "filter",
                        "does/not/match/exact/", LocaleId.EN_US, stats,
                        new AuditInfo(new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        docList.add(docInfo);

        return docList;
    }
View Full Code Here

        return documentInfo(id, "", docId);
    }

    public static DocumentInfo documentInfo(long id, String path, String name) {
        return new DocumentInfo(new DocumentId(id, path + name), name, path,
                LocaleId.EN_US, null, new AuditInfo(new Date(), "Translator"),
                null, new AuditInfo(new Date(), "last translator"));
    }
View Full Code Here

    }

    private static DocumentInfo docInfo(String name, String path) {
        return new DocumentInfo(new DocumentId(1L, ""), name, path,
                LocaleId.EN_US, new ContainerTranslationStatistics(),
                new AuditInfo(new Date(), "Translator"),
                new HashMap<String, String>(), new AuditInfo(new Date(),
                        "last translator"));
    }
View Full Code Here

    @Test
    public void fireSearchEvent() {
        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(new Long(1), ""), "test",
                        "test/path", LocaleId.EN_US,
                        new ContainerTranslationStatistics(), new AuditInfo(
                                new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        userWorkspaceContext.setSelectedDoc(docInfo);

        when(messages.searchGlossary()).thenReturn("Search glossary");
        when(display.getGlossaryTextBox()).thenReturn(mockGlossaryTextBox);
View Full Code Here

            fireSearchEventInSequentialWillBlockSecondRequestUntilFirstReturn() {
        // Given:
        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(new Long(1), ""), "test",
                        "test/path", LocaleId.EN_US,
                        new ContainerTranslationStatistics(), new AuditInfo(
                                new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        userWorkspaceContext.setSelectedDoc(docInfo);
        when(messages.searchGlossary()).thenReturn("Search glossary");
        when(display.getGlossaryTextBox()).thenReturn(mockGlossaryTextBox);
        when(mockGlossaryTextBox.getText()).thenReturn("query1", "query2");
View Full Code Here

    @Test
    public void fireSearchEventOnSuccessCallbackWithGlossaryResults() {
        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(new Long(1), ""), "test",
                        "test/path", LocaleId.EN_US,
                        new ContainerTranslationStatistics(), new AuditInfo(
                                new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        userWorkspaceContext.setSelectedDoc(docInfo);

        when(messages.searchGlossary()).thenReturn("Search glossary");
        when(display.getGlossaryTextBox()).thenReturn(mockGlossaryTextBox);
View Full Code Here

    @Test
    public void fireSearchEventOnSuccessCallbackButNoGlossaryFound() {
        DocumentInfo docInfo =
                new DocumentInfo(new DocumentId(new Long(1), ""), "test",
                        "test/path", LocaleId.EN_US,
                        new ContainerTranslationStatistics(), new AuditInfo(
                                new Date(), "Translator"),
                        new HashMap<String, String>(), new AuditInfo(
                                new Date(), "last translator"));
        userWorkspaceContext.setSelectedDoc(docInfo);

        when(messages.searchGlossary()).thenReturn("Search glossary");
        when(display.getGlossaryTextBox()).thenReturn(mockGlossaryTextBox);
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.model.AuditInfo

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.