JUnit 4 for CDI Java-SE tests
If just plain unit testing is needed without JEE APIs it's possible to use the AbstractCdiAwareTest
JUnit 4 for CDI Java-EE tests
If it's required to test e.g. request scoped beans it's possible to use the AbstractServletAwareTest
If it's required to test e.g. grouped conversation scoped beans it's possible to use the AbstractServletAwareTest
Needed modules and dependencies
Because the unit-test modules will never be needed in production builds, you have to add the CODI-test modules manually, even if you are using one of the all-in-one packages. You'll need at least the myfaces-extcdi-junit-support-module for general JUnit support. And depending on your needs, you'll also need the myfaces-extcdi-owb-support-module and myfaces-extcdi-jsf-support-module. Don't forget to also include the needed (test)modules of the CDI implementation. In case of OWB, you'll need cditest and cditest-owb from the org.apache.openwebbeans.test group. For convenience, here's a pom-snippet to pick the needed dependencies from:
Examples
An example is available here.
