-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Junit4 support [SPR-3104] #7791
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
Comments
Santiago Valdarrama commented I create a project to maintain a set of JUnit 4 extensions to test spring code. You can see some information or download binaries or the complete source code from http://code.google.com/p/gienah-testing/. Please, feel free to send your feedback in order to make the project grow. Maybe Spring developers could take a look to the project to include a similar behaviour in future spring releases. |
Santiago Valdarrama commented To see a little tutorial of gienah-testing project, go to http://groups.google.com/group/gienah-testing/web/project-5-minutes-tutorial |
Rich Eggert commented I've also been interested in this. I've been holding off on implementing integration tests for my projects, since I don't want to start off using an obsolete API. I haven't tried it out yet, but the Gienah API looks to be clean and consistent with how JUnit4 and Spring are meant to work. Given that the necessary code is already written as uses the same license as Spring, would it be possible to get it merged into the main Spring codebase in the near future? |
Santiago Valdarrama commented I'll be very glad to help with this issue, so, please, if you guys want to get access to the gienah-testing source code, let me know. |
Ben Turner commented This is a feature I'd really like to see - currently I have to decide between Spring injection or JUnit4 Parametrized tests. However, I note the gienah-testing project (above) advocates the use of a SpringRunner to do the Spring bean injection - so I assume this approach would leave me with the same dilemma - SpringRunner OR Parameterized runner ? In my case, I am hoping for an update to the existing Spring Classes to allow simple test injection without limiting my choice of Test Runner. Can see arguments for both approaches I guess, but wanted to add my 5 cents here - have waited a while for this integration and would be disappointed if it was of little or no use to me. |
Sam Brannen commented In Spring 2.1 M4 we are introducing the new "Spring TestContext Framework" In addition to providing generic and extensible testing infrastructure, the To discover how this new testing support can assist you with writing unit and I encourage everyone to take a look at the examples and give the new testing Thanks, Sam |
Sam Brannen commented Hi Mujahid,
The Spring TestContext Framework provides a custom runner for JUnit 4.4 called regards, Sam |
Sam Brannen commented Hi Ben,
That is a very valid point you make. Due to the design of JUnit 4's For the Spring TestContext Framework, we have also chosen to provide To benefit from the full scope of the new TestContext framework, you However, you mentioned that you would only like to have "simple test I created a proof-of-concept class and checked it into CVS as an internal ParameterizedDependencyInjectionTests is a simple JUnit 4 based unit test In summary, if you choose the manual route using TestContextManager NOTE: I do not want to mislead anyone. The solution mentioned above Regards, Sam |
Mujahid Ali opened SPR-3104 and commented
Junit4 doesn't require a class to extend TestCase to write unit tests; there needs to be a similar class to AbstractDependencyInjectionSpringContextTests which provides support for tests that depend on a Spring context but doesn't extends from Junit's TestCase.
If there is a workaround for this, please either reply here or in the forum under the thread http://forum.springframework.org/showthread.php?t=34378
Thanks,
-Mujahid
Issue Links:
18 votes, 18 watchers
The text was updated successfully, but these errors were encountered: