Package org.gradle.api

Examples of org.gradle.api.Rule


    @Test
    public void findDomainObjectByNameInvokesNestedRulesOnlyOnceForUnknownDomainObject() {
        final Bean bean1 = new Bean();
        final Bean bean2 = new Bean();
        container.addRule(new Rule() {
            public String getDescription() {
                return "rule1";
            }

            public void apply(String domainObjectName) {
                if (domainObjectName.equals("bean1")) {
                    container.addObject("bean1", bean1);
                }
            }
        });
        container.addRule(new Rule() {
            private boolean applyHasBeenCalled;

            public String getDescription() {
                return "rule2";
            }
View Full Code Here


    }

    @Test
    public void passesEachRuleToRenderer() throws IOException {
        context.checking(new Expectations() {{
            Rule rule1 = context.mock(Rule.class);
            Rule rule2 = context.mock(Rule.class);

            List<String> defaultTasks = toList();
            allowing(project).getDefaultTasks();
            will(returnValue(defaultTasks));
View Full Code Here

        assertThat(System.getProperty(testPropertyKey), equalTo(expectedTaskName));
        System.getProperties().remove(testPropertyKey);
    }

    private void addRuleFor(final Bean bean) {
        container.addRule(new Rule() {
            public String getDescription() {
                throw new UnsupportedOperationException();
            }

            public void apply(String taskName) {
View Full Code Here

    }

    @Test
    public void passesEachRuleToRenderer() throws IOException {
        context.checking(new Expectations() {{
            Rule rule1 = context.mock(Rule.class);
            Rule rule2 = context.mock(Rule.class);

            List<String> defaultTasks = toList();
            allowing(project).getDefaultTasks();
            will(returnValue(defaultTasks));
View Full Code Here

TOP

Related Classes of org.gradle.api.Rule

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.