Package org.zanata.webtrans.shared.model

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


        return hTextFlowTarget;
    }

    @Test
    public void testExecute() throws Exception {
        WorkspaceId workspaceId =
                TestFixture.workspaceId(hLocale.getLocaleId());
        GetTransMemoryDetailsAction action =
                new GetTransMemoryDetailsAction(1L, 2L);
        action.setWorkspaceId(workspaceId);
        ProjectIterationId projectIterationId =
                workspaceId.getProjectIterationId();
        when(
                localeServiceImpl.validateLocaleByProjectIteration(
                        workspaceId.getLocaleId(),
                        projectIterationId.getProjectSlug(),
                        projectIterationId.getIterationSlug())).thenReturn(
                hLocale);
        // text flow 1
        HTextFlow hTextFlow1 = TestFixture.makeApprovedHTextFlow(1L, hLocale);
View Full Code Here


        assertThat(result.getItems(), Matchers.hasSize(2));
    }

    @Test(expectedExceptions = ActionException.class)
    public void testExecuteWithInvalidLocale() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        GetTransMemoryDetailsAction action = new GetTransMemoryDetailsAction();
        action.setWorkspaceId(workspaceId);
        ProjectIterationId projectIterationId =
                workspaceId.getProjectIterationId();
        when(
                localeServiceImpl.validateLocaleByProjectIteration(
                        workspaceId.getLocaleId(),
                        projectIterationId.getProjectSlug(),
                        projectIterationId.getIterationSlug())).thenThrow(
                new ZanataServiceException("test"));

        handler.execute(action, null);
View Full Code Here

      // @formatter:on
    }

    @Test
    public void testExecute() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        PublishWorkspaceChatAction action =
                new PublishWorkspaceChatAction("admin", "hi",
                        HasWorkspaceChatData.MESSAGE_TYPE.USER_MSG);
        action.setWorkspaceId(workspaceId);
        when(translationWorkspaceManager.getOrRegisterWorkspace(workspaceId))
View Full Code Here

                .use("localeServiceImpl", localeServiceImpl)
                .ignoreNonResolvable()
                .autowire(GetLocaleListHandler.class);
        // @formatter:on

        WorkspaceId workspaceId = TestFixture.workspaceId();
        action = new GetLocaleList();
        action.setWorkspaceId(workspaceId);
        when(
                localeServiceImpl.getSupportedLanguageByProjectIteration(
                        "project", "master")).thenReturn(getHLocaleList());
View Full Code Here

      // @formatter:on
    }

    @Test
    public void testExecute() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        GetDocumentList action = new GetDocumentList();
        action.setWorkspaceId(workspaceId);
        HDocument hDocument = hDocument(1);
        List<HDocument> documentList = Arrays.asList(hDocument);
View Full Code Here

        assertThat(documentInfo.getName(), Matchers.equalTo("a.po"));
    }

    @Test
    public void testExecuteWithFilter() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        GetDocumentList action = new GetDocumentList();
        action.setWorkspaceId(workspaceId);
        HDocument hDocument = hDocument(1);
        List<HDocument> documentList = Arrays.asList(hDocument);
        when(documentDAO.getAllByProjectIteration("project", "master"))
View Full Code Here

        return glossaryTerm;
    }

    @Test
    public void testExecute() throws Exception {
        WorkspaceId workspaceId =
                TestFixture.workspaceId(targetHLocale.getLocaleId());
        ArrayList<Long> sourceIdList = Lists.newArrayList(1L);
        GetGlossaryDetailsAction action =
                new GetGlossaryDetailsAction(sourceIdList);
        action.setWorkspaceId(workspaceId);
        when(
                localeServiceImpl.validateLocaleByProjectIteration(workspaceId
                        .getLocaleId(), workspaceId.getProjectIterationId()
                        .getProjectSlug(), workspaceId.getProjectIterationId()
                        .getIterationSlug())).thenReturn(targetHLocale);
        HGlossaryTerm sourceTerm = glossaryTerm("src term", srcLocale);
        HGlossaryTerm targetTerm = glossaryTerm("target term", srcLocale);
        sourceTerm.getGlossaryEntry().getGlossaryTerms()
                .put(targetHLocale, targetTerm);
View Full Code Here

                Matchers.equalTo("target term"));
    }

    @Test(expectedExceptions = ActionException.class)
    public void testExecuteWithInvalidLocale() throws Exception {
        WorkspaceId workspaceId =
                TestFixture.workspaceId(targetHLocale.getLocaleId());
        GetGlossaryDetailsAction action =
                new GetGlossaryDetailsAction(Lists.newArrayList(1L));
        action.setWorkspaceId(workspaceId);
        ProjectIterationId projectIterationId =
                workspaceId.getProjectIterationId();
        when(
                localeServiceImpl.validateLocaleByProjectIteration(
                        workspaceId.getLocaleId(),
                        projectIterationId.getProjectSlug(),
                        projectIterationId.getIterationSlug())).thenThrow(
                new ZanataServiceException("test"));

        handler.execute(action, null);
View Full Code Here

        validationFactory = new ValidationFactory(message);
    }

    @Test
    public void testExecute() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        ActivateWorkspaceAction action =
                new ActivateWorkspaceAction(workspaceId);
        when(translationWorkspaceManager.getOrRegisterWorkspace(workspaceId))
                .thenReturn(translationWorkspace);
        HLocale hLocale = new HLocale(workspaceId.getLocaleId());
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(hLocale);
        ProjectIterationId projectIterationId =
                workspaceId.getProjectIterationId();
        HProject hProject = new HProject();
        when(projectDAO.getBySlug(projectIterationId.getProjectSlug()))
                .thenReturn(hProject);
        HProjectIteration hProjectIteration = new HProjectIteration();
        when(
View Full Code Here

    @Test
    public void testExecute() throws Exception {
        Person person = TestFixture.person();
        EditorClientId editorClientId = new EditorClientId("sessionId", 1);
        WorkspaceId workspaceId = TestFixture.workspaceId();
        when(translationWorkspaceManager.getOrRegisterWorkspace(workspaceId))
                .thenReturn(translationWorkspace);
        ExitWorkspaceAction action = new ExitWorkspaceAction(person);
        action.setEditorClientId(editorClientId);
        action.setWorkspaceId(workspaceId);
View Full Code Here

TOP

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

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.