Where do you expect test injection to be done? Maybe have a look to
arquillian, applicationcomposr junite runner, openejb ejbcontainer
bind("inject", xxx) feature or deltaspike junit runnerLe lundi 3 février 2014, Abhijit Sarkar <[email protected]> a écrit : > After struggling all day with it, I switched to using Apache DeltaSpike with Weld and it told me that I had circular dependencies. I'd think that's where the StackOverflowError was coming from but OWB fails to recognize the root cause (improvement option?). > Anyway, after fixing the circular dependencies problem, I'm back to OWB again but now my injected dependencies are null. Surprisingly, there's not any good account of how to unit test CDI with DeltaSpike and OWB. From the scanty documentation, I seem to be doing nothing wrong. > Anyone wants to take a look? The project can be downloaded from GitHub ( https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and the following command would readily expose the aforementioned issue: > > > > > > > > gradle -PskipCoverage -Dtest.single=CDITestSuite clean build > Regards,Abhijit >> From: [email protected] >> Date: Sun, 2 Feb 2014 10:00:23 +0100 >> Subject: Re: StackOverflowError >> To: [email protected] >> >> 1) >> java -> groovy >> mvn -> gradle >> spring -> cdi >> >> all can have side effects (in particular groovy and IoC), groovy >> should be well handled >> >> 3) @ManagedBean is alsmot a stateful so I'm pretty sure you don't want >> to use it but rather @Dependent or @ApplicationScoped, @Produces in >> EJBs (@ManagedBean is considered this way) are not that good since you >> can't ignore an EJB, just use normal CDI beans >> >> Romain Manni-Bucau >> Twitter: @rmannibucau >> Blog: http://rmannibucau.wordpress.com/ >> LinkedIn: http://fr.linkedin.com/in/rmannibucau >> Github: https://github.com/rmannibucau >> >> >> >> 2014-02-02 Abhijit Sarkar <[email protected]>: >> > Thank you for looking into it. >> > "> first if you change everything it is hard to understand the cause" >> > Nothing was changed, neither the code, nor the output I attached with the email. Why do you say that? >> > "> secondly your example is not self contained and need some dep it can't retrive by default" >> > Probably you're referring to the dependency 'name.abhijitsarkar.util.logging:logging-util'. It's a logging module I use - I didn't know you'd actually try to execute the code. I've replaced it with SLF4J now. >> > "lastly you use @ManagedBean which is surely not what you want"Without @ManagedBean, the OpenEJB container complains that it can't find the beans. I don't have the error message handy else I'd have put it here. Perhaps a package scan or something similar needs to be set? >> >> From: [email protected] >> >> Date: Sun, 2 Feb 2014 08:50:21 +0100 >> >> Subject: Re: StackOverflowError >> >> To: [email protected] >> >> >> >> Hi >> >> >> >> first if you change everything it is hard to understand the cause, >> >> secondly your example is not self contained and need some dep it can't >> >> retrive by default, lastly you use @ManagedBean which is surely not >> >> what you want, is it intended? >> >> Romain Manni-Bucau >> >> Twitter: @rmannibucau >> >> Blog: http://rmannibucau.wordpress.com/ >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau >> >> Github: https://github.com/rmannibucau >> >> >> >> >> >> >> >> 2014-02-02 Abhijit Sarkar <[email protected]>: >> >> > Hi, >> >> > I'm getting a StackOverflowError while running tests on the application. >> >> > This is a pet project which I'm migrating from Java/Spring/Maven to >> >> > Groovy/CDI/Gradle. Is it ok to ask for help here or is there another more >> >> > appropriate group? >> >> > In case someone decides to help me out, the code is here >> >> > (https://github.com/abhijitsarkar/groovy/tree/master/movie-manager) and I've >> >> > attached a build log with this email. One thing I noticed, which may not >> >> > even be related, is that 2 beans I'm trying to override using @Specializes >> >> > are still getting deployed. >> >> > >> >> > Java 1.7.0_51-b13, Open EJB 4.6.1-SNAPSHOT >> >> > >> >> > Regards, >> >> > Abhijit >> > > -- *Romain Manni-Bucau* *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau <http://fr.linkedin.com/in/rmannibucau>* *Github: https://github.com/rmannibucau <https://github.com/rmannibucau>*
