Repository navigation
[JSTEP-10] Migrate from using /failing tests to /tofix tests - #1372
cowtowncoder merged 4 commits into
Conversation
/failing tests to /tofix tests/failing tests to /tofix tests
| * {@link JacksonTestFailureExpected} annotation. | ||
| */ | ||
| @Override | ||
| public void interceptTestTemplateMethod(Invocation<Void> invocation, |
There was a problem hiding this comment.
This API is for @ParameterizedTest.
For every method invocation, this method is called.
| ExpectedPassingTestCasePredicate predicate = findzExpectedPassingTestCasePredicate(invocationContext); | ||
| if (predicate != null) { | ||
| if (predicate.shouldPass(invocationContext.getArguments())) { | ||
| // do-nothing, we do not expect an exception | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
What we are trying to do here is use ExpectedPassingTestCasePredicate to allow passing test being part of test cases of provided by @ParameterizedTest this way we can keep test cases in one place (like @MethodSource)
|
@cowtowncoder Now that we have additional implementation like one here, around |
| try { | ||
| invocation.proceed(); | ||
| } catch (Throwable t) { | ||
| // do-nothing, we do expect an exception |
There was a problem hiding this comment.
Is there an expectation of always getting an exception, to indicate failing test? I guess this is true in that assert-methods do throw assertion exceptions.
| implements ExpectedPassingTestCasePredicate | ||
| { | ||
| @Override | ||
| public boolean shouldPass(List<Object> arguments) { |
There was a problem hiding this comment.
I am not so sure about this -- seems bit fragile and not very easy to understand. Is something like this expected for all "tofix" parameterized tests?
There was a problem hiding this comment.
Oh. Looks like this is just one case, maybe there is something special about that one.
| import java.util.List; | ||
|
|
||
| /** | ||
| * Interface that defines a predicate to determine if a test case is expected to pass. |
There was a problem hiding this comment.
I assume "pass" here mean that test completes without exception? (if so, fine, if not should probably be explained further).
Resolves #1370