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

Upgrade to JUnit 4 #97

Closed
wants to merge 5 commits into from
Closed

Upgrade to JUnit 4 #97

wants to merge 5 commits into from

Conversation

edysli
Copy link
Contributor

@edysli edysli commented Aug 22, 2019

JUnit version 5 has been out for a while so it's time to upgrade from version 3 to 4, right? ;)

My end goal with this is to remove AbstractFlowExecutionTests's inheritance on JUnit 3's TestCase which causes all sorts of weirdness in my tests using Spring Webflow with JUnit 4 (need to use @RunWith(JUnit4.class)). This prevents my flow tests from using JUnit 5.

Remove `extends TestCase` from test classes. Add `@Test` to all test
methods and `@Before` to `setUp()` methods.
Remove `extends TestCase` from test classes. Add `@Test` to all test
methods, `@Before` to `setUp()` methods and `@After` to `tearDown()`
methods.

Class `JsfUtilsTests` still indirectly inherits from `TestCase` via
`org.apache.myfaces.test.base.AbstractJsfTestCase`.
Remove `extends TestCase` from test classes. Add `@Test` to all test
methods, `@Before` to `setUp()` methods and `@After` to `tearDown()`
methods.

Remove a couple unused imports in test classes.
Remove `AbstractFlowExecutionTests`'s dependency on
`junit.framework.TestCase`. Also remove its constructors which are now
useless.

Also remove constructors taking a `String name` argument from
`AbstractExternalizedFlowExecutionTests` and
`AbstractXmlFlowExecutionTests` as that parameter is not used in any
of the three classes.
@edysli
Copy link
Contributor Author

edysli commented Aug 23, 2019

I've already signed Pivotal's CLA, by the way.

@edysli
Copy link
Contributor Author

edysli commented Aug 26, 2019

Also filed as SWF-1738 on jira.spring.io.

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Aug 26, 2019

@edysli, thanks for the contribution!

I think internal tests should go directly to JUnit 5 while for the flow test support we should provide an option to upgrade to either JUnit 5 or 4 but not require it. That way we could get the changes into a maintenance release without waiting for another minor or major release.

I've also split this into two parts, SWF-1739 and SWF-1740 with some initial thoughts. If you'd like to rework the PR accordingly that would be much appreciated!

@edysli
Copy link
Contributor Author

edysli commented Aug 26, 2019

Hey @rstoyanchev, thanks for sharing your thoughts! :) That makes sense, I'll split this PR in two then.

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.

2 participants