Package org.zanata.model

Examples of org.zanata.model.HProject


        MockitoAnnotations.initMocks(this);
        documentService = new DocumentServiceImpl();
        documentService.init(projectIterationDAO, documentDAO, msgs);

        HProjectIteration version = Mockito.mock(HProjectIteration.class);
        HProject project = Mockito.mock(HProject.class);
        HDocument document = Mockito.mock(HDocument.class);

        webHooks = Lists.newArrayList();
        webHooks.add(new WebHook(project, "http://test.com"));
        webHooks.add(new WebHook(project, "http://test1.com"));

        when(projectIterationDAO.findById(versionId)).thenReturn(version);
        when(version.getProject()).thenReturn(project);
        when(version.getSlug()).thenReturn(versionSlug);
        when(project.getSlug()).thenReturn(projectSlug);
        when(project.getWebHooks()).thenReturn(webHooks);
        when(documentDAO.getById(docId)).thenReturn(document);
        when(document.getDocId()).thenReturn(docIdString);

        when(msgs.format(anyString())).thenReturn("test message");
    }
View Full Code Here


                projectIterationDAO.getBySlug("same-project", "same-version");
        assert version != null;
        version.setStatus(EntityStatus.OBSOLETE);
        projectIterationDAO.makePersistent(version);

        HProject project = projectDAO.getBySlug("different-project");
        assert project != null;
        project.setStatus(EntityStatus.OBSOLETE);
        projectDAO.makePersistent(project);

        // Run the copy trans scenario (very liberal, but nothing should be
        // translated)
        CopyTransExecution execution =
View Full Code Here

            doc.setObsolete(true);
            documentDAO.makePersistent(doc);
        }

        ProjectDAO projectDAO = seam.autowire(ProjectDAO.class);
        HProject project = projectDAO.getBySlug("different-project");
        assert project != null;
        for (HProjectIteration it : project.getProjectIterations()) {
            for (HDocument doc : it.getDocuments().values()) {
                doc.setObsolete(true);
                documentDAO.makePersistent(doc);
            }
        }
View Full Code Here

        softly.assertThat(
                granter.shouldInvokeGranter(null)).isTrue();
        softly.assertThat(
                granter.shouldInvokeGranter(
                        null,
                        new HProject())).isTrue();
        softly.assertThat(
                granter.shouldInvokeGranter(
                        "my-action")).isTrue();
        softly.assertThat(
                granter.shouldInvokeGranter(
                        "my-action", new HProject())).isTrue();
        softly.assertAll();
    }
View Full Code Here

                        getStaticMethod(SimpleTestEvaluators.class,
                                "evaluatesForHProject"));

        softly.assertThat(
                granter.shouldInvokeGranter(
                        null, new HProject())).isTrue();
        softly.assertThat(
                granter.shouldInvokeGranter(
                        "my-action", new HProject())).isTrue();
        softly.assertThat(
                granter.shouldInvokeGranter(
                        null, new HProjectIteration())).isFalse();
        softly.assertThat(
                granter.shouldInvokeGranter(
View Full Code Here

                new PermissionGranter(getStaticMethod(
                        SimpleTestEvaluators.class,
                        "evaluatesForMultiTarget"));

        assertThat(granter.shouldInvokeGranter(
                "multi-target-action", new HProject(), new HLocale()
        )).isTrue();
    }
View Full Code Here

                new PermissionGranter(getStaticMethod(
                        SimpleTestEvaluators.class,
                        "evaluatesForMultiTarget"));

        assertThat(granter.shouldInvokeGranter(
                "multi-target-action", new HLocale(), new HProject()
        )).isTrue();
    }
View Full Code Here

                        getStaticMethod(SimpleTestEvaluators.class,
                                "evaluatesForMultiTarget"));

        assertThat(
                granter.shouldInvokeGranter(
                        "multi-target-action", new HLocale(), new HProject(),
                        new HProjectIteration(), new StringBuilder()
                        )).isTrue();
    }
View Full Code Here

    }

    @Test
    public void alwaysGrantWithSingleArgument() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("always-grant", new HProject())).isTrue();
    }
View Full Code Here

    }

    @Test
    public void alwaysGrantWithMultipleArguments() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("always-grant", new HProject(), "A string",
                        new HProjectIteration())).isTrue();
    }
View Full Code Here

TOP

Related Classes of org.zanata.model.HProject

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.