Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllMembersSupplier.addMultiPointMethods() swallows exceptions #449

Closed
Stephan202 opened this issue Jun 7, 2012 · 4 comments
Closed

AllMembersSupplier.addMultiPointMethods() swallows exceptions #449

Stephan202 opened this issue Jun 7, 2012 · 4 comments
Milestone

Comments

@Stephan202
Copy link
Contributor

From the class AllMembersSupplier:

private void addMultiPointMethods(List<PotentialAssignment> list) {
    for (FrameworkMethod dataPointsMethod : fClass.getAnnotatedMethods(DataPoints.class))
        try {
            addArrayValues(dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null));
        } catch (Throwable e) {
            // ignore and move on
        }
}

This try/catch block seems inappropriate to me: exceptions thrown in a @DataPoints-annotated method will silently be ignored. Surely this cannot be the desired behavior?

@marcphilipp
Copy link
Member

Targetting this issue for 4.12 as GitHub does not allow adding labels to the corresponding pull request (#529).

@Stephan202
Copy link
Contributor Author

@marcphilipp: Though I'd certainly would like to see this issue fixed, do note that the referenced pull request solves another problem. To my knowledge there has been no decision on how to handle exceptions originating from #addMultiPointArrayValues. Btw, I notice there's a similar suppression of Throwables in #addFields.

@marcphilipp
Copy link
Member

@Stephan202 Thanks for the clarification.

pimterry added a commit to pimterry/junit that referenced this issue Feb 17, 2013
…thod exceptions

Also includes a rewrite of the Theory nullsAccepted code, since that relied on the previous behaviour of this.
@dsaff
Copy link
Member

dsaff commented Feb 18, 2013

The exception-swallowing was indeed the initially intended behavior. I'm willing to accept that my original intentions may have been bad (http://www.quickmeme.com/meme/3q13l8/), but I think we're stuck with having to ask users to intentionally turn off the behavior that I originally intentionally turned on. :-(

pimterry added a commit to pimterry/junit that referenced this issue Mar 21, 2013
@dsaff dsaff closed this as completed in 5c2070d Mar 26, 2013
dsaff pushed a commit that referenced this issue Mar 26, 2013
Fixes #449, stopping AllMembersSupplier & Theories hiding DataPoints method exceptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants