Package org.zanata.model

Examples of org.zanata.model.HProjectIteration


    }

    @Test
    public void denyCorrectActionButDifferentType() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("project-action", new HProjectIteration()))
                .isFalse();
    }
View Full Code Here


    }

    @Test
    public void allowAnyMultiAction() throws Exception {
        softly.assertThat(complexPermissionEvaluator
                .checkPermission("multi-action-1", new HProjectIteration()))
                .isTrue();
        softly.assertThat(complexPermissionEvaluator
                .checkPermission("multi-action-2", new HProjectIteration()))
                .isTrue();
        softly.assertThat(complexPermissionEvaluator
                .checkPermission("multi-action-3", new HProjectIteration()))
                .isTrue();
        softly.assertAll();
    }
View Full Code Here

    @Test
    public void multiTargetDenyWithDifferentTargetTypes() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("please-allow", new LocaleId("de-DE"),
                        new HProjectIteration())).isFalse();
    }
View Full Code Here

    public void allowWhenAllArgsPresentInOrder() {
        assertThat(
                complexPermissionEvaluator
                        .checkPermission("only-when-all-args-present",
                                new HProject(),
                                new HProjectIteration(), new HLocale()))
                .isTrue();
    }
View Full Code Here

    public void allowWhenAllArgsPresentInDisorder() {
        assertThat(
                complexPermissionEvaluator
                        .checkPermission("only-when-all-args-present",
                                new HLocale(),
                                new HProjectIteration(), new HProject()))
                .isTrue();
    }
View Full Code Here

    @Test
    public void denyWhenSomeRequiredArgsAbsent() {
        assertThat(
                complexPermissionEvaluator
                        .checkPermission("only-when-all-args-present",
                                new HProjectIteration()))
                .isFalse();
    }
View Full Code Here

    public void exceptionInGranterIsPropagated() {
        try {
            assertThat(
                    complexPermissionEvaluator
                            .checkPermission("throws-exception",
                                    new HProjectIteration()))
                    .isFalse();
        }
        catch (Exception e) {
            assertThat(e).isExactlyInstanceOf(RuntimeException.class);
            assertThat(e).hasCauseInstanceOf(InvocationTargetException.class);
View Full Code Here

        return hTextFlowTarget;
    }

    private static void setProjectAndIterationSlug(HTextFlow hTextFlow,
            String projectSlug, String iterationSlug) {
        HProjectIteration projectIteration = new HProjectIteration();
        projectIteration.setSlug(iterationSlug);
        HProject project = new HProject();
        project.setName(projectSlug);
        projectIteration.setProject(project);
        hTextFlow.getDocument().setProjectIteration(projectIteration);
    }
View Full Code Here

    private void runCopyVersion(String projectSlug, String versionSlug,
            String newVersionSlug) {
        service.copyVersion(projectSlug, versionSlug, newVersionSlug,
                new CopyVersionTaskHandle());

        HProjectIteration existingVersion = projectIterationDAO.getBySlug(
                projectSlug, versionSlug);
        HProjectIteration newVersion =
                projectIterationDAO.getBySlug(projectSlug, newVersionSlug);

        assertVersion(existingVersion, newVersion, newVersionSlug,
                existingVersion.getStatus());

        for (Map.Entry<String, HDocument> entry : newVersion.getDocuments()
                .entrySet()) {
            HDocument existingDoc = existingVersion.getDocuments().get(
                    entry.getValue().getDocId());
            HDocument newDoc = entry.getValue();
View Full Code Here

    }

    private HProjectIteration createNewVersion(String projectSlug,
            String versionSlug, String newVersionSlug) {

        HProjectIteration existingVersion =
                projectIterationDAO.getBySlug(projectSlug, versionSlug);

        HProjectIteration newVersion = new HProjectIteration();
        newVersion.setSlug(newVersionSlug);
        newVersion.setProject(existingVersion.getProject());
        return projectIterationDAO.makePersistent(newVersion);
    }
View Full Code Here

TOP

Related Classes of org.zanata.model.HProjectIteration

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.