Package org.gradle.integtests.fixtures

Examples of org.gradle.integtests.fixtures.ExecutionFailure


    public void compilationFailureBreaksBuild() {
        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns("apply plugin: 'java'");
        testFile("src/main/java/org/gradle/broken.java").write("broken");

        ExecutionFailure failure = usingBuildFile(buildFile).withTasks("build").runWithFailure();

        failure.assertHasFileName(String.format("Build file '%s'", buildFile));
        failure.assertHasDescription("Execution failed for task ':compileJava'");
        failure.assertHasCause("Compile failed; see the compiler error output for details.");
    }
View Full Code Here


        TestFile buildFile = testFile("build.gradle");
        buildFile.writelns("apply plugin: 'java'");
        testFile("src/main/java/org/gradle/ok.java").write("package org.gradle; class ok { }");
        testFile("src/test/java/org/gradle/broken.java").write("broken");

        ExecutionFailure failure = usingBuildFile(buildFile).withTasks("build").runWithFailure();

        failure.assertHasFileName(String.format("Build file '%s'", buildFile));
        failure.assertHasDescription("Execution failed for task ':compileTestJava'");
        failure.assertHasCause("Compile failed; see the compiler error output for details.");
    }
View Full Code Here

    public void javadocGenerationFailureBreaksBuild() throws IOException {
        TestFile buildFile = testFile("javadocs.gradle");
        buildFile.write("apply plugin: 'java'");
        testFile("src/main/java/org/gradle/broken.java").write("class Broken { }");

        ExecutionFailure failure = usingBuildFile(buildFile).withTasks("javadoc").runWithFailure();

        failure.assertHasFileName(String.format("Build file '%s'", buildFile));
        failure.assertHasDescription("Execution failed for task ':javadoc'");
        failure.assertHasCause("Javadoc generation failed.");
    }
View Full Code Here

        testFile("settings.gradle").writelns(
            "include 'child'",
            "project(':child').projectDir = rootProject.projectDir");
        testFile("build.gradle").write("// empty");

        ExecutionFailure result = inTestDirectory().withTasks("test").runWithFailure();
        result.assertThatDescription(startsWith("Could not select the default project for this build. Multiple projects in this build have project directory"));

        result = usingProjectDir(getTestDir()).withTasks("test").runWithFailure();
        result.assertThatDescription(startsWith("Could not select the default project for this build. Multiple projects in this build have project directory"));

        result = usingBuildFile(testFile("build.gradle")).withTasks("test").runWithFailure();
        result.assertThatDescription(startsWith("Could not select the default project for this build. Multiple projects in this build have build file"));
    }
View Full Code Here

        result.assertThatDescription(startsWith("Could not select the default project for this build. Multiple projects in this build have build file"));
    }

    @Test
    public void buildFailsWhenSpecifiedBuildFileIsNotAFile() {
        ExecutionFailure result = usingBuildFile(testFile("unknown build file")).runWithFailure();
        result.assertThatDescription(startsWith("Build file"));
        result.assertThatDescription(endsWith("does not exist."));
    }
View Full Code Here

        result.assertThatDescription(endsWith("does not exist."));
    }

    @Test
    public void buildFailsWhenSpecifiedProjectDirectoryIsNotADirectory() {
        ExecutionFailure result = usingProjectDir(testFile("unknown dir")).runWithFailure();
        result.assertThatDescription(startsWith("Project directory"));
        result.assertThatDescription(endsWith("does not exist."));
    }
View Full Code Here

        result.assertThatDescription(endsWith("does not exist."));
    }

    @Test
    public void buildFailsWhenSpecifiedSettingsFileIsNotAFile() {
        ExecutionFailure result = inTestDirectory().usingSettingsFile(testFile("unknown")).runWithFailure();
        result.assertThatDescription(startsWith("Could not read settings file"));
        result.assertThatDescription(endsWith("as it does not exist."));
    }
View Full Code Here

        settingsFile.write("// empty");

        TestFile projectdir = testFile("project dir");
        projectdir.mkdirs();

        ExecutionFailure result = usingProjectDir(projectdir).usingSettingsFile(settingsFile).runWithFailure();
        result.assertThatDescription(startsWith("Could not select the default project for this build. No projects in this build have project directory"));
    }
View Full Code Here

        inTestDirectory().withTasks("test").run();

        testFile("gradle/src/BuildClass.java").writelns("public class BuildClass { public BuildClass(String value) { throw new RuntimeException(\"broken\"); } }");

        ExecutionFailure failure = inTestDirectory().withTasks("test").runWithFailure();
        failure.assertHasCause("broken");
    }
View Full Code Here

import java.io.File;

public class BuildScriptErrorIntegrationTest extends AbstractIntegrationTest {
    @Test
    public void reportsProjectEvaluationFailsWithGroovyException() {
        ExecutionFailure failure = usingBuildScript("\ncreateTakk('do-stuff')").runWithFailure();

        failure.assertHasFileName("Embedded build file");
        failure.assertHasLineNumber(2);
        failure.assertHasDescription("A problem occurred evaluating root project 'reportsProjectEvaluationFailsWithGroovyException");
        failure.assertHasCause("Could not find method createTakk() for arguments [do-stuff] on root project 'reportsProjectEvaluationFailsWithGroovyException");
    }
View Full Code Here

TOP

Related Classes of org.gradle.integtests.fixtures.ExecutionFailure

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.