-
1. Re: More Arquillian and JSFUnit integration
aslak Nov 23, 2010 9:12 AM (in response to ssilvert)Very interesting stuff!
Any thoughts on porting this to use the Arquillian SPIs instead of CDI ?
Would make it workable for older containers(ee5) and non CDI deployments.
-
2. Re: More Arquillian and JSFUnit integration
ssilvert Nov 23, 2010 2:05 PM (in response to aslak)Aslak Knutsen wrote:
Any thoughts on porting this to use the Arquillian SPIs instead of CDI ?
Would make it workable for older containers(ee5) and non CDI deployments.
That would be great. Currently, I am using CDI's @Produces methods for JSFSession, JSFClientSession, and JSFServerSession. All the code that creates the objects is in JSFSessionFactory. How do I use the Arquillian SPI to create and inject these objects?
Stan
-
3. Re: More Arquillian and JSFUnit integration
aslak Nov 23, 2010 4:28 PM (in response to ssilvert)Using the TestEnricher SPI should be doable: https://github.com/arquillian/arquillian/blob/master/spi/src/main/java/org/jboss/arquillian/spi/TestEnricher.java
resolve(Context, Object[], Method) <- Object array with index of Method arguments, read Method to find Annotations etc
enrich(Context, Object) <-- Object is the test instance, here you can do instance variable injection.
-
4. Re: More Arquillian and JSFUnit integration
aslak Nov 23, 2010 4:31 PM (in response to aslak)You also need to use the AuxiliaryArchiveAppender SPI to package up the TestEnricher 'bundle' so it gets deployed along side the users deployment.
-
5. Re: More Arquillian and JSFUnit integration
ssilvert Nov 23, 2010 5:05 PM (in response to aslak)Aslak Knutsen wrote:
You also need to use the AuxiliaryArchiveAppender SPI to package up the TestEnricher 'bundle' so it gets deployed along side the users deployment.
Aslak Knutsen wrote:
You also need to use the AuxiliaryArchiveAppender SPI to package up the TestEnricher 'bundle' so it gets deployed along side the users deployment.
I'm stealing the JSFUnitArchiveAppender from you anyway.
Using the TestEnricher looks very doable. I think most of my code for JSFSessionFactory will stay the same. I'll probably have questions next week when the holiday is over.
Stan