aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/testng/internal
diff options
context:
space:
mode:
authorCedric Beust <cedric@beust.com>2015-09-10 13:36:16 -0700
committerCedric Beust <cedric@beust.com>2015-09-10 13:36:16 -0700
commitf6a34fbf3dd3f4b75ce22f59cd6f6113fb0dddf9 (patch)
treee13f978a84cd5b6653629daa431c451b08d3b228 /src/main/java/org/testng/internal
parenta4bc141b9857a459eac378232bee19856464dd27 (diff)
parent6ba3194fdc4355a195c940c885cec29dfbd6a3e2 (diff)
downloadtestng-f6a34fbf3dd3f4b75ce22f59cd6f6113fb0dddf9.tar.gz
Merge pull request #774 from juherr/issue-773
Fix issue #773 : Test should not be skipped when the exception is expected
Diffstat (limited to 'src/main/java/org/testng/internal')
-rw-r--r--src/main/java/org/testng/internal/Invoker.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/org/testng/internal/Invoker.java b/src/main/java/org/testng/internal/Invoker.java
index 9cf7326d..86c892c2 100644
--- a/src/main/java/org/testng/internal/Invoker.java
+++ b/src/main/java/org/testng/internal/Invoker.java
@@ -1351,17 +1351,18 @@ public class Invoker implements IInvoker {
// Exception thrown?
if (ite != null) {
- if (isSkipExceptionAndSkip(ite)){
- status = ITestResult.SKIP;
- }
// Invocation caused an exception, see if the method was annotated with @ExpectedException
- else if (expectedExceptionsHolder != null) {
+ if (expectedExceptionsHolder != null) {
if (expectedExceptionsHolder.isExpectedException(ite)) {
testResult.setStatus(ITestResult.SUCCESS);
status = ITestResult.SUCCESS;
} else {
- testResult.setThrowable(expectedExceptionsHolder.wrongException(ite));
- status= ITestResult.FAILURE;
+ if (isSkipExceptionAndSkip(ite)){
+ status = ITestResult.SKIP;
+ } else {
+ testResult.setThrowable(expectedExceptionsHolder.wrongException(ite));
+ status = ITestResult.FAILURE;
+ }
}
} else {
handleException(ite, testMethod, testResult, failure.count++);