Re: OpenEJB Mockito unit test

2012-09-15 Thread Vishwanath Krishnamurthi
e that has a unit test with Arquillian > > working? > > So far I have not been able to find a complete example of an integration > > test using Tomee. > > > > > > > > -- > > View this message in context: > > > http://openejb.979440.n4.nabble.

Re: OpenEJB Mockito unit test

2012-09-15 Thread Romain Manni-Bucau
n able to find a complete example of an integration > test using Tomee. > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/OpenEJB-Mockito-unit-test-tp4657142p4657433.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >

Re: OpenEJB Mockito unit test

2012-09-14 Thread zeeman
Romain, Is there a simple project with Tomee that has a unit test with Arquillian working? So far I have not been able to find a complete example of an integration test using Tomee. -- View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-Mockito-unit-test

Re: OpenEJB Mockito unit test

2012-09-11 Thread Romain Manni-Bucau
w.softplan.com.br > > > -Mensagem original- > De: Romain Manni-Bucau [mailto:rmannibu...@gmail.com] > Enviada em: terça-feira, 11 de setembro de 2012 10:09 > Para: users@openejb.apache.org > Assunto: Re: OpenEJB Mockito unit test > > some n

RES: OpenEJB Mockito unit test

2012-09-11 Thread Elton Kuzniewski
5, SCBCD 5 Pesquisa & Desenvolvimento Softplan/Poligraph + 55 48 3027-8000 www.softplan.com.br -Mensagem original- De: Romain Manni-Bucau [mailto:rmannibu...@gmail.com] Enviada em: terça-feira, 11 de setembro de 2012 10:09 Para: users@openejb.apache.org Assunto: Re: OpenEJB Mockito unit test

Re: OpenEJB Mockito unit test

2012-09-11 Thread Romain Manni-Bucau
some news: application composer + mockito: http://svn.apache.org/repos/asf/openejb/trunk/openejb/utils/openejb-mockito/src/test/java/org/apache/openejb/mockito/MockitoAndAppComposerTest.java the idea is to provide a custom injector (for @EJB) and an extension is automatically discovered for cdi

Re: OpenEJB Mockito unit test

2012-09-05 Thread Romain Manni-Bucau
Currently no but should be pretty easy ;) Not sure i can go further today but the idea is: 1) create an fallback injector with a map string/object you can feed statically 2) implement getvalue method simply getting in the map the key i said before 3) return an instance in the test class with mocki

Re: OpenEJB Mockito unit test

2012-09-05 Thread Jean-Louis MONTEIRO
any basic sample to give it a try? Very interesting BTW JLouis 2012/9/5 Romain Manni-Bucau > added org.apache.openejb.injection.FallbackPropertyInjector which should > manage failling injections (so you can inject a mock) and in application > composer you can return your injector annotating @Mo

Re: OpenEJB Mockito unit test

2012-09-05 Thread Romain Manni-Bucau
added org.apache.openejb.injection.FallbackPropertyInjector which should manage failling injections (so you can inject a mock) and in application composer you can return your injector annotating @MockInjector a method. i didnt test too much, was just trying to find a way which doesn't impact the c

Re: OpenEJB Mockito unit test

2012-08-31 Thread Romain Manni-Bucau
Nothing against it but here is my opinion, JEE is designed to be testable so no need of any "complicated for nothing" framework. For me mockito answer to a different need. For a cdi sample we have an example on trunk using alternatives ans stereotypes. - Romain Le 31 août 2012 12:45, "Yann Blaz

Re: OpenEJB Mockito unit test

2012-08-31 Thread Yann Blazart
I'm agree but tests with arquilian take more time than simple unit tests. Le 31 août 2012 11:21, "Jean-Louis MONTEIRO" a écrit : > Waiting for Romain's answer, but I guess it will be. Mocking is an old > school solution ;-) > Indeed, nowadays, and mainly thanks to EJB 3 lite, Arquillian, and so o

Re: OpenEJB Mockito unit test

2012-08-31 Thread Jean-Louis MONTEIRO
Waiting for Romain's answer, but I guess it will be. Mocking is an old school solution ;-) Indeed, nowadays, and mainly thanks to EJB 3 lite, Arquillian, and so on, it's far easier to get simple integration tests. So the need to really write unit tests is smaller. Just some thoughts. Romain is cur

Re: OpenEJB Mockito unit test

2012-08-31 Thread Yann Blazart
Well, in fact I'm not sure to go in the right way. I wan't to make the demonstration that jee6 can now replace spring. One thing very interesting in spring is about that faculty to make "unit-test" between real unit-test and integration tests with @Configuration. I wanted to make the same thing.

Re: OpenEJB Mockito unit test

2012-08-31 Thread Romain Manni-Bucau
I dont think so (the proxy). The need is more than it: vetoing a bean deployment (not managed today i think) + mocking (i would like to avoid to update core for this need) - Romain Le 31 août 2012 09:15, "Jean-Louis MONTEIRO" a écrit : > Romain, > > maybe a proxy handler on top of the business i

Re: OpenEJB Mockito unit test

2012-08-31 Thread Jean-Louis MONTEIRO
Romain, maybe a proxy handler on top of the business interface can do the trick. Not sure it will work, but it should be able to provide any implementation even a mock to a business interface. The need is there, so that be great to have a look. Any other ideas? Jean-Louis 2012/8/30 Romain Mann

Re: OpenEJB Mockito unit test

2012-08-30 Thread Romain Manni-Bucau
Hmm, not sure i get what is hard, never tried it but using alternative of cdi or specialize should do the trick. To use mockito you need to change deep in the code the way ejb are instantiated+scanned (doable but i really think it is easier to mock an ejb than using mockito) Another lazy solution

Re: OpenEJB Mockito unit test

2012-08-29 Thread Yann Blazart
Wo I'm studying applicationComposer code. It's difficult. Why I want to use mockito ? Simply because I wan't to make some unit tests without have to get all. For example I wan't to test a business service, a stateless ejb. This one use another one that make some things with mms, databases and oth

Re: OpenEJB Mockito unit test

2012-08-28 Thread Yann Blazart
Mockito is more easy to use than extends the ejb class. I will search for a way to make that works. 2012/8/28 Romain Manni-Bucau > Hi, > > Generally we mock services replacing them by child or another > implementation so no need of mockito and you keep injection > consistent...but you can use m

Re: OpenEJB Mockito unit test

2012-08-28 Thread Romain Manni-Bucau
Hi, Generally we mock services replacing them by child or another implementation so no need of mockito and you keep injection consistent...but you can use mockito to implement this other class with a kind of delegate pattern. - Romain Le 28 août 2012 16:19, "Yann Blazart" a écrit : > Hi , is th

OpenEJB Mockito unit test

2012-08-28 Thread Yann Blazart
Hi , is there a way to use Mockito instance with Application composer for unit tests ? For example here, is there a solution to use the mockito instance for the EjbJar ? : > @RunWith(ApplicationComposer.class) > public class EchoServiceTest { > > @Mock > private DummyService dummyService