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

Handle AssumptionViolatedException in @Parameters method #1460

Merged
merged 8 commits into from
Jun 14, 2017

Conversation

panchenko
Copy link
Contributor

Fixes #1329

@panchenko panchenko force-pushed the assumptionViolationInParameters branch from 8a50082 to 3bc3a3a Compare May 25, 2017 10:28
Object parameters;
try {
parameters = parametersMethod.invokeExplosively(null);
} catch (AssumptionViolatedException e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't you catch this exception in the caller (RunnersFactory)? If the exception gets caught, you can set a field in RunnersFactory named runnerOverride to a new AssumptionViolationRunner. If runnerOverride is set it would be returned from RunnersFactory.createRunners().

As a bonus, we could possibly catch any exception from there, and for the exceptions that aren't AssumptionViolatedException use ErrorReportingRunner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've implemented the first part.

ErrorReportingRunner is already applied in RunnerBuilder.safeRunnerForClass(), seems like we should not care about other exceptions.

@kcooney kcooney force-pushed the assumptionViolationInParameters branch from 9f38f32 to 03987d9 Compare May 26, 2017 00:30
@kcooney kcooney added the 4.13 label May 26, 2017
@kcooney kcooney merged commit 7111b96 into junit-team:master Jun 14, 2017
@kcooney
Copy link
Member

kcooney commented Jun 14, 2017

@panchenko Thanks! Could you update the release notes on the wiki?

@garfieldnate
Copy link

Thank you!

@kcooney kcooney modified the milestone: 4.13 Aug 6, 2017
@kcooney kcooney removed the 4.13 label Aug 6, 2017
@panchenko
Copy link
Contributor Author

@kcooney I've updated release notes for this.

@panchenko panchenko deleted the assumptionViolationInParameters branch February 10, 2018 09:16
sebasjm pushed a commit to sebasjm/junit4 that referenced this pull request Mar 11, 2018
aristotle0x01 pushed a commit to aristotle0x01/junit4 that referenced this pull request Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants