Package org.zanata.model

Examples of org.zanata.model.HProject


    }

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


    @Test
    public void allowMatchingActionWithMultipleTargets() throws Exception {
        // As long as all the granter parameters are supplied, the rest of
        // arguments can be ignored
        assertThat(complexPermissionEvaluator
                .checkPermission("project-action", new HProject(),
                        "A string")).isTrue();
    }
View Full Code Here

    }

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

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

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

    @Test
    public void multiTargetDenyCheckFailed() throws Exception {
        // Only allows German
        assertThat(complexPermissionEvaluator
                .checkPermission("please-allow", new LocaleId("es-ES"),
                        new HProject())).isFalse();
    }
View Full Code Here

    }

    @Test
    public void multiTargetAllowWithTargetsInDifferentOrder() {
        assertThat(complexPermissionEvaluator
                .checkPermission("please-allow", new HProject(),
                        new LocaleId("de-DE"))).isTrue();
    }
View Full Code Here

    @Test
    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

    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

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.