Package org.zanata.webtrans.shared.model

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


    }

    @Test(expectedExceptions = NoSuchWorkspaceException.class)
    public void testRegisterWorkspaceForObsoleteProjectIteration()
            throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        HProjectIteration projectIteration = makeHProjectIteration("a", "1");
        projectIteration.getProject().setStatus(EntityStatus.OBSOLETE);
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(projectIteration);

        manager.getOrRegisterWorkspace(workspaceId);
    }
View Full Code Here


        manager.getOrRegisterWorkspace(workspaceId);
    }

    @Test(expectedExceptions = NoSuchWorkspaceException.class)
    public void testRegisterWorkspaceWithInvalidLocale() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(makeHProjectIteration("a", "1"));
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(null);

        manager.getOrRegisterWorkspace(workspaceId);
    }
View Full Code Here

        manager.getOrRegisterWorkspace(workspaceId);
    }

    @Test(expectedExceptions = NoSuchWorkspaceException.class)
    public void testRegisterWorkspaceWithInactiveLocale() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId();
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(makeHProjectIteration("project", "1"));
        HLocale hLocale = new HLocale(LocaleId.DE);
        hLocale.setActive(false);
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(hLocale);

        manager.getOrRegisterWorkspace(workspaceId);
    }
View Full Code Here

        manager.getOrRegisterWorkspace(workspaceId);
    }

    @Test
    public void testRegisterNewWorkspace() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId(LocaleId.DE);
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(makeHProjectIteration("project", "master"));
        HLocale hLocale = new HLocale(LocaleId.DE);
        hLocale.setActive(true);
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(hLocale);

        TranslationWorkspace workspace =
                manager.getOrRegisterWorkspace(workspaceId);
View Full Code Here

                Matchers.equalTo("project (master)"));
    }

    @Test
    public void testGetRegisteredNewWorkspace() throws Exception {
        WorkspaceId workspaceId = TestFixture.workspaceId(LocaleId.DE);
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(makeHProjectIteration("a", "1"));
        HLocale hLocale = new HLocale(LocaleId.DE);
        hLocale.setActive(true);
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(hLocale);

        TranslationWorkspace workspace =
                manager.getOrRegisterWorkspace(workspaceId);
View Full Code Here

    @Test
    public void testProjectIterationUpdate() throws Exception {
        HProjectIteration projectIteration =
                makeHProjectIteration("project", "master");
        WorkspaceId workspaceId = TestFixture.workspaceId(LocaleId.DE);
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(projectIteration);
        HLocale hLocale = new HLocale(LocaleId.DE);
        hLocale.setActive(true);
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(hLocale);

        when(
                validationServiceImpl.getValidationActions(projectIteration
                        .getProject().getSlug(), projectIteration.getSlug()))
View Full Code Here

    @Test
    public void testExitWorkspaceWithAccount() throws Exception {
        HProjectIteration projectIteration =
                makeHProjectIteration("project", "master");
        WorkspaceId workspaceId = TestFixture.workspaceId(LocaleId.DE);
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(projectIteration);
        HLocale hLocale = new HLocale(LocaleId.DE);
        hLocale.setActive(true);
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(hLocale);
        TranslationWorkspaceManagerImpl spy = spy(manager);
        doReturn(mockWorkspace).when(spy).createWorkspace(workspaceId);
        doReturn("sessionId").when(spy).getSessionId();
        ArrayList<EditorClientId> editorClientIds =
View Full Code Here

    @Test
    public void testExitWorkspaceWithNullAccount() throws Exception {
        HProjectIteration projectIteration =
                makeHProjectIteration("project", "master");
        WorkspaceId workspaceId = TestFixture.workspaceId(LocaleId.DE);
        when(
                projectIterationDAO.getBySlug(workspaceId
                        .getProjectIterationId().getProjectSlug(), workspaceId
                        .getProjectIterationId().getIterationSlug()))
                .thenReturn(projectIteration);
        HLocale hLocale = new HLocale(LocaleId.DE);
        hLocale.setActive(true);
        when(localeServiceImpl.getByLocaleId(workspaceId.getLocaleId()))
                .thenReturn(hLocale);
        TranslationWorkspaceManagerImpl spy = spy(manager);
        doReturn(mockWorkspace).when(spy).createWorkspace(workspaceId);
        doReturn("sessionId").when(spy).getSessionId();
        ArrayList<EditorClientId> editorClientIds =
View Full Code Here

    @Test
    public void testExecute() throws Exception {
        Person person = TestFixture.person();
        TransUnit selectedTransUnit = TestFixture.makeTransUnit(1);
        WorkspaceId workspaceId = TestFixture.workspaceId();
        EditorClientId editorClientId = new EditorClientId("sessionId", 1);
        TransUnitEditAction action =
                new TransUnitEditAction(person, selectedTransUnit.getId());
        action.setWorkspaceId(workspaceId);
        action.setEditorClientId(editorClientId);
View Full Code Here

    private WorkspaceId workspaceId;

    @BeforeMethod
    public void setUp() {
        workspaceId =
                new WorkspaceId(ProjectIterationId.of("project", "master",
                        ProjectType.Podir), new LocaleId("en-US"));
        WorkspaceContext workspaceContext =
                new WorkspaceContext(workspaceId, "workspaceName", "en-US");
        translationWorkspace = new TranslationWorkspaceImpl(workspaceContext);
    }
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.