Package org.zanata.webtrans.shared.model

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


        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);
        setProjectAndIterationSlug(hTextFlow1, "project", "master");
        addHTextFlowTarget(hLocale, hTextFlow1, null);
View Full Code Here


    @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

    private void prepareActionAndMockLocaleService(GetTransUnitList action) {
        action.setEditorClientId(new EditorClientId("sessionId", 1));
        action.setWorkspaceId(TestFixture.workspaceId(localeId, "plurals",
                "master", ProjectType.Podir));
        ProjectIterationId projectIterationId =
                action.getWorkspaceId().getProjectIterationId();
        when(
                localeService.validateLocaleByProjectIteration(action
                        .getWorkspaceId().getLocaleId(), projectIterationId
                        .getProjectSlug(), projectIterationId
                        .getIterationSlug())).thenReturn(jaHLocale);
        when(localeService.getByLocaleId(localeId)).thenReturn(jaHLocale);
    }
View Full Code Here

    @Test
    public void requestToJoinVersionGroup() throws Exception {
        String versionGroupName = "GROUP_NAME[测试]";
        String versionGroupSlug = "GROUP_SLUG";
        Collection<ProjectIterationId> projectIterIds = Lists.newArrayList(
                new ProjectIterationId("PROJECT_SLUG", "ITERATION_SLUG",
                        ProjectType.File)
        );

        EmailStrategy strategy =
                new RequestToJoinVersionGroupEmailStrategy(
View Full Code Here

        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

        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(
                projectIterationDAO.getBySlug(
                        projectIterationId.getProjectSlug(),
                        projectIterationId.getIterationSlug())).thenReturn(
                hProjectIteration);
        when(identity.hasPermission("modify-translation", hProject, hLocale))
                .thenReturn(true);
        when(identity.hasPermission("glossary-update", "")).thenReturn(true);
        LoadOptionsResult optionsResult =
View Full Code Here

TOP

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

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.