use of org.apache.openejb.jee.Connector in project tomee by apache.
the class AnnotationDeployerTest method testResourceAdapter.
@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());
}
use of org.apache.openejb.jee.Connector in project tomee by apache.
the class GetterConnectorTest method connector.
@Module
public Connector connector() {
final ConfigProperty configProperty = new ConfigProperty();
configProperty.setConfigPropertyName("conf");
configProperty.setConfigPropertyType(String.class.getName());
configProperty.setConfigPropertyValue("GetterConnectorTest");
final ConnectionDefinition connectionDefinition = new ConnectionDefinition();
connectionDefinition.setConnectionFactoryImplClass(MyMcf.class.getName());
connectionDefinition.setConnectionInterface(ConnectionFactory.class.getName());
final OutboundResourceAdapter out = new OutboundResourceAdapter();
out.getConnectionDefinition().add(connectionDefinition);
final ResourceAdapter ra = new ResourceAdapter();
ra.setResourceAdapterClass(MyRa.class.getName());
ra.getConfigProperty().add(configProperty);
final Connector connector = new Connector();
connector.setVersion("1.7");
connector.setResourceAdapter(ra);
return connector;
}
Aggregations