Skip to content

Commit

Permalink
Fixing review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
krmahadevan committed Jul 8, 2020
1 parent 4a0d0b7 commit 95c2974
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/testng/internal/TestListenerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void runPreConfigurationListeners(ITestResult tr, ITestNGMethod tm, List<
try {
icl.beforeConfiguration(tr, tm);
} catch (Exception e) {
handleException(e);
ignoreInternalGradleException(e);
}
}
}
Expand All @@ -40,23 +40,23 @@ static void runPostConfigurationListeners(
try {
icl.onConfigurationSkip(tr, tm);
} catch (Exception e) {
handleException(e);
ignoreInternalGradleException(e);
}
break;
case ITestResult.FAILURE:
icl.onConfigurationFailure(tr);
try {
icl.onConfigurationFailure(tr, tm);
} catch (Exception e) {
handleException(e);
ignoreInternalGradleException(e);
}
break;
case ITestResult.SUCCESS:
icl.onConfigurationSuccess(tr);
try {
icl.onConfigurationSuccess(tr,tm);
} catch (Exception e) {
handleException(e);
ignoreInternalGradleException(e);
}
break;
default:
Expand All @@ -68,7 +68,7 @@ static void runPostConfigurationListeners(
//This method is added because Gradle which builds TestNG seems to be using an older version
//of TestNG that doesn't know about the new methods that we added and so it causes
//the TestNG build to keep failing.
private static void handleException(Exception e) {
private static void ignoreInternalGradleException(Exception e) {
if (!e.getClass().getPackage().getName().startsWith("org.gradle.internal")) {
throw new ListenerInvocationException(e);
}
Expand Down

0 comments on commit 95c2974

Please sign in to comment.