-
1. Re: Would EasyMock Plugin make sense?
michaelschuetz Sep 8, 2010 8:38 PM (in response to michaelschuetz)Or an even more EasyMock like approach:
final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "test.jar")
.addClasses(MyService.class, MyServiceBean.class)
.addMock(MyReferenced2ndService.class);
This would add MyReferenced2ndService class and generated mock implementation, additionally. So, this might be even extended, if you like: addStrictMock, addSimpleMock and so on...
Sorry, wiki formatting does not occur like expected.
-
2. Re: Would EasyMock Plugin make sense?
aslak Sep 9, 2010 7:44 AM (in response to michaelschuetz)Have been playing with the thought in relation to some MC Bean Service mocking.
But can EasyMock generate a complete Mock Class?
I was looking into Mockito at the time, and as far as i found it could only generate a Serialized object of the Mock it self. To be able to get for instance the EJB Container to load it as a bean, we need to have the Mock not as a Object Stream but as a Class. (think javassist, not java Proxy)
-
3. Re: Would EasyMock Plugin make sense?
michaelschuetz Sep 14, 2010 6:56 PM (in response to aslak)Hm, ok I see. Yes, EasyMock uses java proxy for generating mock objects.
I'll try to find help finding a mock framework that suits for this usecase.
MockEJB (http://www.mockejb.org) seems to behave like expected but is outdated and does not support EJB3.