How to create something like CDI producer in an arquillian extension. There are two posibilities:
-
implementing the ResourceProvider interface and using the @ArquillianResource annotation in the test class - it can be combinated with some qualifier (probably what are you looking for)
- see the example ProviderProducer
-
implementing the TestEnricher interface and using your own annotation (this is more flexible but also more complicated solution)
- see the example EnricherProducer
NOTE: This master branch is for arquillian 1.1.8.Final. In this release there have been introduced two new annotations for the injection via ResourceProvider (for more informatin see https://issues.jboss.org/browse/ARQ-1921):
- @ResourceProvider.ClassInjection
- @ResourceProvider.MethodInjection
If you need an implementation for the previous version, please see the arquillian-1.1.7.Final branch