@Test public void testResourceAdapter() throws Exception { final ConnectorModule connectorModule = testConnectorModule(); final AnnotationDeployer.DiscoverAnnotatedBeans discvrAnnBeans = new AnnotationDeployer.DiscoverAnnotatedBeans(); discvrAnnBeans.deploy(connectorModule); final Connector connector = connectorModule.getConnector(); Assert.assertEquals("displayName", connector.getDisplayName()); Assert.assertEquals("description", connector.getDescription()); Assert.assertEquals("eisType", connector.getEisType()); Assert.assertEquals("vendorName", connector.getVendorName()); Assert.assertEquals("version", connector.getResourceAdapterVersion()); Assert.assertEquals("smallIcon", connector.getIcon().getSmallIcon()); Assert.assertEquals("largeIcon", connector.getIcon().getLargeIcon()); Assert.assertEquals("licenseDescription", connector.getLicense().getDescription()); Assert.assertEquals(true, connector.getLicense().isLicenseRequired()); final List<org.apache.openejb.jee.SecurityPermission> securityPermission = connector.getResourceAdapter().getSecurityPermission(); Assert.assertEquals("description", securityPermission.get(0).getDescription()); Assert.assertEquals("permissionSpec", securityPermission.get(0).getSecurityPermissionSpec()); final List<String> requiredWorkContext = connector.getRequiredWorkContext(); Assert.assertEquals(TestWorkContext.class.getName(), requiredWorkContext.get(0)); final List<org.apache.openejb.jee.AuthenticationMechanism> authenticationMechanism = connector.getResourceAdapter().getOutboundResourceAdapter().getAuthenticationMechanism(); Assert.assertEquals("authMechanism", authenticationMechanism.get(0).getAuthenticationMechanismType()); Assert.assertEquals(CredentialInterface.GenericCredential.toString(), authenticationMechanism.get(0).getCredentialInterface()); Assert.assertEquals("description", authenticationMechanism.get(0).getDescription()); Assert.assertEquals(TransactionSupportType.NO_TRANSACTION, connector.getResourceAdapter().getOutboundResourceAdapter().getTransactionSupport()); Assert.assertEquals(true, connector.getResourceAdapter().getOutboundResourceAdapter().isReauthenticationSupport()); Assert.assertEquals(Connection.class.getName(), connector.getResourceAdapter().getOutboundResourceAdapter().getConnectionDefinition().get(0).getConnectionInterface()); Assert.assertEquals(ConnectionImpl.class.getName(), connector.getResourceAdapter().getOutboundResourceAdapter().getConnectionDefinition().get(0).getConnectionImplClass()); Assert.assertEquals(ConnectionFactory.class.getName(), connector.getResourceAdapter().getOutboundResourceAdapter().getConnectionDefinition().get(0).getConnectionFactoryInterface()); Assert.assertEquals(ConnectionFactoryImpl.class.getName(), connector.getResourceAdapter().getOutboundResourceAdapter().getConnectionDefinition().get(0).getConnectionFactoryImplClass()); Assert.assertEquals(TestActivation.class.getName(), connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter().getMessageListener().get(0).getActivationSpec().getActivationSpecClass()); Assert.assertEquals(TestMessageListener.class.getName(), connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter().getMessageListener().get(0).getMessageListenerType()); Assert.assertEquals(TestAdminObject.class.getName(), connector.getResourceAdapter().getAdminObject().get(0).getAdminObjectClass()); Assert.assertEquals(TestAdminObjectInterface.class.getName(), connector.getResourceAdapter().getAdminObject().get(0).getAdminObjectInterface()); }
public AppModule deploy(AppModule appModule) throws OpenEJBException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(appModule.getClassLoader()); setModule(appModule); try { appModule = discoverAnnotatedBeans.deploy(appModule); appModule = envEntriesPropertiesDeployer.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = builtInEnvironmentEntries.deploy(appModule); appModule = processAnnotatedBeans.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = mBeanDeployer.deploy(appModule); return appModule; } finally { envEntriesPropertiesDeployer.resetAdditionalEnvEntries(); Thread.currentThread().setContextClassLoader(classLoader); removeModule(); } }
AnnotationDeployer implements DynamicDeployer { public AppModule deploy(AppModule appModule) throws OpenEJBException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(appModule.getClassLoader()); setModule(appModule); try { appModule = discoverAnnotatedBeans.deploy(appModule); appModule = envEntriesPropertiesDeployer.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = builtInEnvironmentEntries.deploy(appModule); appModule = processAnnotatedBeans.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = mBeanDeployer.deploy(appModule); return appModule; } finally { envEntriesPropertiesDeployer.resetAdditionalEnvEntries(); Thread.currentThread().setContextClassLoader(classLoader); removeModule(); } } }
AnnotationDeployer implements DynamicDeployer { public AppModule deploy(AppModule appModule) throws OpenEJBException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(appModule.getClassLoader()); setModule(appModule); try { appModule = discoverAnnotatedBeans.deploy(appModule); appModule = envEntriesPropertiesDeployer.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = builtInEnvironmentEntries.deploy(appModule); appModule = processAnnotatedBeans.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = mBeanDeployer.deploy(appModule); return appModule; } finally { envEntriesPropertiesDeployer.resetAdditionalEnvEntries(); Thread.currentThread().setContextClassLoader(classLoader); removeModule(); } } AnnotationDeployer(); }
AnnotationDeployer implements DynamicDeployer { public AppModule deploy(AppModule appModule) throws OpenEJBException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(appModule.getClassLoader()); setModule(appModule); try { appModule = discoverAnnotatedBeans.deploy(appModule); appModule = envEntriesPropertiesDeployer.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = builtInEnvironmentEntries.deploy(appModule); appModule = processAnnotatedBeans.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = mBeanDeployer.deploy(appModule); return appModule; } finally { envEntriesPropertiesDeployer.resetAdditionalEnvEntries(); Thread.currentThread().setContextClassLoader(classLoader); removeModule(); } } AnnotationDeployer(); AppModule deploy(AppModule appModule); void deploy(final CdiBeanInfo beanInfo); WebModule deploy(WebModule webModule); static DeploymentModule getModule(); static boolean isKnownEnvironmentEntryType(final Class type); static boolean isShareableJNDINamespace(final String jndiName); static void autoJpa(final EjbModule ejbModule); static void doAutoJpa(final IAnnotationFinder finder, final org.apache.openejb.jee.jpa.unit.PersistenceUnit pu); static List<Annotated<Class<?>>> sortClasses(final List<Annotated<Class<?>>> list); static List<Class<?>> sortClassesParentFirst(final List<Class<?>> list); static List<Annotated<Method>> sortMethods(final List<Annotated<Method>> list); static Collection<String> findRestClasses(final WebModule webModule, final IAnnotationFinder finder); static boolean isInstantiable(final Class<?> clazz); static URL classLocation(final Class clazz); EnvEntriesPropertiesDeployer getEnvEntriesPropertiesDeployer(); }
AnnotationDeployer implements DynamicDeployer { public AppModule deploy(AppModule appModule) throws OpenEJBException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(appModule.getClassLoader()); setModule(appModule); try { appModule = discoverAnnotatedBeans.deploy(appModule); appModule = envEntriesPropertiesDeployer.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = builtInEnvironmentEntries.deploy(appModule); appModule = processAnnotatedBeans.deploy(appModule); appModule = mergeWebappJndiContext.deploy(appModule); appModule = mBeanDeployer.deploy(appModule); return appModule; } finally { envEntriesPropertiesDeployer.resetAdditionalEnvEntries(); Thread.currentThread().setContextClassLoader(classLoader); removeModule(); } } AnnotationDeployer(); AppModule deploy(AppModule appModule); void deploy(final CdiBeanInfo beanInfo); WebModule deploy(WebModule webModule); static DeploymentModule getModule(); static boolean isKnownEnvironmentEntryType(final Class type); static boolean isShareableJNDINamespace(final String jndiName); static void autoJpa(final EjbModule ejbModule); static void doAutoJpa(final IAnnotationFinder finder, final org.apache.openejb.jee.jpa.unit.PersistenceUnit pu); static List<Annotated<Class<?>>> sortClasses(final List<Annotated<Class<?>>> list); static List<Class<?>> sortClassesParentFirst(final List<Class<?>> list); static List<Annotated<Method>> sortMethods(final List<Annotated<Method>> list); static Collection<String> findRestClasses(final WebModule webModule, final IAnnotationFinder finder); static boolean isInstantiable(final Class<?> clazz); static URL classLocation(final Class clazz); EnvEntriesPropertiesDeployer getEnvEntriesPropertiesDeployer(); static final Logger logger; static final Logger startupLogger; static final String OPENEJB_JPA_AUTO_SCAN; static final String OPENEJB_JPA_AUTO_SCAN_PACKAGE; static final Set<String> knownResourceEnvTypes; static final Set<String> knownEnvironmentEntries; }