Class EJBInjectionEnricher

  • All Implemented Interfaces:
    org.jboss.arquillian.test.spi.TestEnricher

    public class EJBInjectionEnricher
    extends Object
    implements org.jboss.arquillian.test.spi.TestEnricher
    Enricher that provide EJB class and setter method injection.
    Version:
    $Revision: $
    Author:
    Aslak Knutsen
    • Constructor Detail

      • EJBInjectionEnricher

        public EJBInjectionEnricher()
    • Method Detail

      • enrich

        public void enrich​(Object testCase)
        Specified by:
        enrich in interface org.jboss.arquillian.test.spi.TestEnricher
      • resolve

        public Object[] resolve​(Method method)
        Specified by:
        resolve in interface org.jboss.arquillian.test.spi.TestEnricher
      • injectClass

        protected void injectClass​(Object testCase)
      • resolveJNDINames

        protected String[] resolveJNDINames​(Class<?> fieldType,
                                            String mappedName,
                                            String beanName,
                                            String lookup)
        Resolves the JNDI name of the given field.

        If mappedName, lookup or beanName are specified, they're used to resolve JNDI name. Otherwise, default policy applies.

        If more than one of the mappedName, lookup and beanName EJB annotation attributes is specified at the same time, an IllegalStateException will be thrown.

        Parameters:
        fieldType - annotated field which JNDI name should be resolved.
        mappedName - Value of EJB's mappedName attribute.
        beanName - Value of EJB's beanName attribute.
        lookup - Value of EJB's lookup attribute.
        Returns:
        possible JNDI names which should be looked up to access the proper object.
      • getJndiNamesForAnonymousEJB

        protected String[] getJndiNamesForAnonymousEJB​(Class<?> fieldType)