-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
External version of AssumptionViolatedException #818
External version of AssumptionViolatedException #818
Conversation
Thanks! To make things more backwards-compatible, code in JUnit itself that catches |
…ion junit-team#818 This allows backwards compatibility with third-party code that directly throws internal version
@kcooney I didn't consider it on the initial pass, but makes sense to maintain that functionality. I pushed a changeset this morning updating anywhere that catches |
One minor thing: The imports are not ordered alphabetically in a couple of places leading to unnecessary changes in some files, e.g. in |
@marcphilipp Serves me right for manually updating imports. I've fixed the import ordering to match coding standards for all modified files. There were a few extra fixes for some missing/extra blank lines and static imports below imports. |
LGTM @dsaff Did you want to take a look? |
Also LGTM! |
|
@marcphilipp What's the preferred package style for tests that use experimental features? |
The test and the class under test should have the same package. Therefore |
Looking forward to this one. I think, ultimately, specific assertion/assumption mechanisms (assertEquals, assumeThat, etc.) belong outside of the core of JUnit. AssertionError and AssumptionViolatedException represent implicit contracts between test and test runner, and can be satisfied in many ways (Hamcrest, etc.) Publishing AssumptionViolatedException will encourage fuller, alternative assertion/assumption mechanisms. |
Alright, finally got around to moving the test class. Anything left to do before this can be merged? |
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.internal.AssumptionViolatedException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Stopwatch
class hasn't been released yet. Could you please update the Javadoc to use the external version of AssumptionViolatedException
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage in Stopwatch
is overriding a method from TestWatcher
so I can't update this reference without changing existing APIs
Thanks! Besides |
I found no further usage of |
@@ -1,6 +1,5 @@ | |||
package org.junit.tests.experimental.theories.extendingwithstubs; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you revert this change, please. This file should not be part of the issues change list, because there is no real edit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
… in org.junit.internal Allows developers to write code that handles assumption violations without depending on internal classes
@stefanbirkner The commits should be squashed now with a few additional updates. I noticed that I only made aesthetic changes to |
…eption External version of AssumptionViolatedException
Thanks. |
This is a pull-request for issue #390.
Just subclassing and deprecating the internal version and updating references. I'm wondering if there's a better package for the external version?