Package org.zanata.webtrans.shared.model

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


                Lists.newArrayList(new TransUnitUpdateInfo(true, true,
                        new DocumentId(new Long(1), ""), TestFixture
                                .makeTransUnit(1), 0, 0, ContentState.Approved));
        RevertTransUnitUpdates action =
                new RevertTransUnitUpdates(updatesToRevert);
        action.setWorkspaceId(new WorkspaceId(new ProjectIterationId("", "",
                ProjectType.File), LocaleId.EN_US));

        TranslationService.TranslationResult translationResult =
                mockTranslationResult(ContentState.NeedReview, 0);
        when(
View Full Code Here


                .autowire(GetTargetForLocaleHandler.class);
        // @formatter:on

        jaHLocale = getEm().find(HLocale.class, 3L);

        WorkspaceId workspaceId = TestFixture.workspaceId();

        //plural="true" content0="One file removed_" content1="%d more files removed"
        sourceTransUnitId = new TransUnitId(3L);
        action = new GetTargetForLocale(sourceTransUnitId,
                new Locale(new IdForLocale(jaHLocale.getId(), localeId), ""));
View Full Code Here

    }

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

        verify(eventBus)
                .addHandler(PresenterRevealedEvent.getType(), presenter);
        verify(eventBus).addHandler(RefreshProjectStatsEvent.getType(),
                presenter);

        WorkspaceId workspaceId =
                userWorkspace.getWorkspaceContext().getWorkspaceId();
        String localeId = workspaceId.getLocaleId().getId();

        verify(display).setProjectLinkLabel(
                workspaceId.getProjectIterationId().getProjectSlug());
        verify(display).setVersionLinkLabel(
                workspaceId.getProjectIterationId().getIterationSlug());
        verify(display).setFilesLinkLabel("Documents (" + localeId + ")");

        verify(display).setReadOnlyVisible(userWorkspace.hasReadOnlyAccess());
        verify(window).setTitle("new title");
        verify(keyShortcutPresenter, times(3)).register(
View Full Code Here

        when(userOptionsService.getConfigHolder()).thenReturn(configHolder);

        presenter = new ChangeReferenceLangPresenter(display, eventBus,
                dispatcher, userOptionsService);

        workspaceId = new WorkspaceId(new ProjectIterationId("projectSlug",
                "iterationSlug", ProjectType.Podir), LocaleId.EN_US);

        verify(display).setListener(presenter);
    }
View Full Code Here

        SeamAutowire seamAutowire = getSeamAutowire();

        // Mock certain objects
        TranslationWorkspace transWorkspace = mock(TranslationWorkspace.class);

        WorkspaceId workspaceId =
                new WorkspaceId(new ProjectIterationId(projectSlug,
                        iterationSlug, ProjectType.Podir), localeId);

        // Set mock expectations
        when(
                transWorspaceManager
View Full Code Here

    private TransMemoryMerge prepareAction(int threshold,
            List<TransUnitUpdateRequest> requests, MergeOptions opts) {
        TransMemoryMerge action =
                new TransMemoryMerge(threshold, requests, opts);
        action.setWorkspaceId(new WorkspaceId(new ProjectIterationId(
                projectSlug, versionSlug, ProjectType.File), targetLocale
                .getLocaleId()));
        return action;
    }
View Full Code Here

        MockitoAnnotations.initMocks(this);
        configHolder = new UserConfigHolder();
        when(mockUserOptionsService.getConfigHolder()).thenReturn(configHolder);

        workspaceId =
                new WorkspaceId(new ProjectIterationId("projectSlug",
                        "iterationSlug", ProjectType.Podir), LocaleId.ES);

        when(mockUserWorkspaceContext.getWorkspaceContext()).thenReturn(
                mockWorkspaceContext);
        when(mockWorkspaceContext.getWorkspaceId()).thenReturn(workspaceId);
View Full Code Here

                        userWorkspaceContext, validationDetailsPresenter,
                        changeReferenceLangPresenter,
                        dispatcher, userOptionsService);

        workspaceId =
                new WorkspaceId(new ProjectIterationId("projectSlug",
                        "iterationSlug", ProjectType.Podir), LocaleId.EN_US);

        when(userWorkspaceContext.getWorkspaceContext()).thenReturn(
                workspaceContext);
        when(workspaceContext.getWorkspaceId()).thenReturn(workspaceId);
View Full Code Here

        ProjectIterationId projectIterationId =
                new ProjectIterationId(projectSlug, iterationSlug, projectType);
        WorkspaceRestrictions workspaceRestrictions =
                new WorkspaceRestrictions(projectActive, hasWriteAccess, true,
                        true, true);
        return new UserWorkspaceContext(new WorkspaceContext(new WorkspaceId(
                projectIterationId, LocaleId.EN_US), "workspaceName",
                LocaleId.EN_US.getId()), workspaceRestrictions);
    }
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.