Examples of LocationAwareException


Examples of org.gradle.internal.exceptions.LocationAwareException

        details.summary.format("%s failed with an exception.", granularity);

        fillInFailureResolution(details);

        if (failure instanceof LocationAwareException) {
            final LocationAwareException scriptException = (LocationAwareException) failure;
            details.failure = scriptException.getCause();
            if (scriptException.getLocation() != null) {
                details.location.text(scriptException.getLocation());
            }
            scriptException.visitReportableCauses(new TreeVisitor<Throwable>() {
                int depth;

                @Override
                public void node(final Throwable node) {
                    if (node == scriptException) {
                        details.details.text(getMessage(scriptException.getCause()));
                    } else {
                        details.details.format("%n");
                        StringBuilder prefix = new StringBuilder();
                        for (int i = 1; i < depth; i++) {
                            prefix.append("   ");
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        DefaultExceptionAnalyser analyser = analyser();
        Throwable transformed = analyser.transform(failure);
        assertThat(transformed, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformed;
        assertThat(gse.getCause(), sameInstance(failure));
        assertThat(gse.getReportableCauses(), isEmpty());
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        DefaultExceptionAnalyser analyser = analyser();

        Throwable transformedFailure = analyser.transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getCause(), sameInstance(failure));
        assertThat(gse.getReportableCauses(), isEmpty());
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        DefaultExceptionAnalyser analyser = analyser();

        Throwable transformedFailure = analyser.transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getCause(), sameInstance(failure));
        assertThat(gse.getReportableCauses(), equalTo(toList(cause)));
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        notifyAnalyser(analyser, source);

        Throwable transformedFailure = analyser.transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getScriptSource(), sameInstance(source));
        assertThat(gse.getLineNumber(), equalTo(7));
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        notifyAnalyser(analyser, source);

        Throwable transformedFailure = analyser.transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getScriptSource(), sameInstance(source));
        assertThat(gse.getLineNumber(), equalTo(7));
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

    public void doesNotAddLocationWhenLocationCannotBeDetermined() {
        Throwable failure = new ContextualException();
        Throwable transformedFailure = analyser().transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getScriptSource(), nullValue());
        assertThat(gse.getLineNumber(), nullValue());
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        Throwable failure = new ContextualMultiCauseException(cause1, cause2);

        Throwable transformedFailure = analyser().transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getCause(), sameInstance(failure));
        assertThat(gse.getReportableCauses(), equalTo(toList(cause1, cause2)));
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        Throwable failure = new GradleScriptException("broken", new RuntimeException(cause));

        Throwable transformedFailure = analyser().transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getCause(), sameInstance(cause));
    }
View Full Code Here

Examples of org.gradle.internal.exceptions.LocationAwareException

        Throwable failure = new TaskExecutionException(null, cause);

        Throwable transformedFailure = analyser().transform(failure);
        assertThat(transformedFailure, instanceOf(LocationAwareException.class));

        LocationAwareException gse = (LocationAwareException) transformedFailure;
        assertThat(gse.getCause(), sameInstance(cause));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.