use of org.apache.openejb.jee.MessageDrivenBean in project tomee by apache.
the class ActivationConfigPropertyOverrideTest method testOverrideActivationConfigProperty.
/**
* System property set should override activationConfigProperty
*
* @throws OpenEJBException
*/
@Test
public void testOverrideActivationConfigProperty() throws OpenEJBException {
// set overrides for destinationType and check
System.setProperty("ENTERPRISEBEAN.mdb.activation.destinationType", "testString");
final MessageDrivenBean mdb = new MdbBuilder().anMdb().withActivationProperty("destinationType", "stringToBeOverriden").build();
final ActivationConfigPropertyOverride activationPropertyOverride = new ActivationConfigPropertyOverride();
final AppModule appModule = new AppModuleBuilder().anAppModule().withAnMdb(mdb).build();
activationPropertyOverride.deploy(appModule);
assertTrue(containsActivationKeyValuePair(mdb, "destinationType", "testString"));
assertTrue(mdb.getActivationConfig().getActivationConfigProperty().size() == 1);
System.clearProperty("ENTERPRISEBEAN.mdb.activation.destinationType");
}
use of org.apache.openejb.jee.MessageDrivenBean in project tomee by apache.
the class AutoConfigMdbContainerTest method _testJmsMdbNoContainerConfigured.
public void _testJmsMdbNoContainerConfigured() throws Exception {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new MessageDrivenBean(JmsBean.class));
final EjbJarInfo info = config.configureApplication(ejbJar);
// assembler.createApplication(info);
}
use of org.apache.openejb.jee.MessageDrivenBean in project tomee by apache.
the class AutoConfig method getUsableContainer.
private String getUsableContainer(final Class<? extends ContainerInfo> containerInfoType, final Object bean, final AppResources appResources) {
if (MessageDrivenBean.class.isInstance(bean)) {
final MessageDrivenBean messageDrivenBean = (MessageDrivenBean) bean;
final String messagingType = messageDrivenBean.getMessagingType();
final List<String> containerIds = appResources.containerIdsByType.get(messagingType);
if (containerIds != null && !containerIds.isEmpty()) {
return containerIds.get(0);
}
}
String containerInfo = matchContainer(containerInfoType, bean, appResources.getContainerInfos());
if (containerInfo == null) {
// avoid to build configFactory.getContainerInfos() if not needed
containerInfo = matchContainer(containerInfoType, bean, configFactory.getContainerInfos());
}
if (containerInfo != null) {
return containerInfo;
}
return null;
}
Aggregations