-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
EasyMock CDI extension #1
Conversation
- Adding validation to mock definitions. - Testing multiple TestSubject in the interceptor example.
different mock java types.
newer versions of weld.
- Removing Demoiselle junit dependency. - Created profiles to test the extension with different weld versions.
to openwebbeans tests.
In openwebbeans, process injection target events are fired before all processAnnotatedType events are done. That means we can't count on this order to scan @Testsubject.
Conflicts: easymock-cdiextension/README.md
Is this still relevant? From what I read on stack overflow, CDI-unit or needle seem to solve the issue. Also, the root of your problem seems to be that EasyMock cannot recognize a mock if it is subclassed. Indeed, that wasn't expected. But could be fixed. |
I did some tests with CDI-unit and needle and it worked better this time. Maybe the only thing this contribution adds is allowing to mock a interceptor's collaborators during interception (https://github.com/marciopd/easymock/blob/master/easymock-cdiextension/src/test/java/org/easymock/cdi/interceptor/InterceptorTest.java). Should we close the issue? |
8c19cf4
to
2f59cf7
Compare
1836d7f
to
56c0299
Compare
94bf0ae
to
d5a2659
Compare
d974e92
to
c5b0ebd
Compare
Sorry. This has been pending for a long long time now. I really do not want to add that much code just to support CDI. I don't think EasyMock should be that involved in "in container mocking". I do appreciate your effort and I am side I can't merge this. |
Unit testing CDI (JSR 299) beans using EasyMock is tricky, as the following post suggests: http://stackoverflow.com/questions/16761905/unit-test-with-cdi-unit-and-easymock/16814237#16814237.
As CDI is becoming widely used in new JEE projects, it's important to provide first class support to developers willing to unit test CDI beans using EasyMock.
This pull request is about a portable CDI extension, which provides a clean way of unit testing CDI beans and mocking its collaborators using EasyMock.
JIRA request:
https://jira.codehaus.org/browse/EASYMOCK-126
More details in README.md:
https://github.com/marciopd/easymock/tree/master/easymock-cdiextension
I think this could be a great new feature to EasyMock and I'm open to suggestions or doing any other efforts needed in order to make it happen. In fact, I'm already needing badly a extension like this in my company's projects.
cheers