diff options
author | Cedric Beust <cedric@beust.com> | 2015-09-10 13:36:16 -0700 |
---|---|---|
committer | Cedric Beust <cedric@beust.com> | 2015-09-10 13:36:16 -0700 |
commit | f6a34fbf3dd3f4b75ce22f59cd6f6113fb0dddf9 (patch) | |
tree | e13f978a84cd5b6653629daa431c451b08d3b228 /src/main/java/org/testng/internal | |
parent | a4bc141b9857a459eac378232bee19856464dd27 (diff) | |
parent | 6ba3194fdc4355a195c940c885cec29dfbd6a3e2 (diff) | |
download | testng-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.java | 13 |
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++); |