use of org.gradle.api.GradleScriptException in project gradle by gradle.
the class DefaultExceptionAnalyserTest method usesDeepestScriptExceptionException.
@Test
public void usesDeepestScriptExceptionException() {
Throwable cause = new GradleScriptException("broken", new RuntimeException());
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));
}
Aggregations