use of org.apache.openejb.testing.Classes in project tomee by apache.
the class ActiveMQResourceAdapterControlTest method app.
@Module
@Classes(value = Mdb.class)
public EjbModule app() {
return new EjbModule(new EjbJar("test"), new OpenejbJar() {
{
setId("test");
getEjbDeployment().add(new EjbDeployment() {
{
setEjbName("ejb/Mdb");
getProperties().put("MdbActiveOnStartup", "false");
getProperties().put("MdbJMXControl", "default:type=test");
}
});
}
});
}
use of org.apache.openejb.testing.Classes in project tomee by apache.
the class ApplicationComposerDeployer method deploy.
@Override
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
if (!appModule.isStandaloneModule()) {
return appModule;
}
for (final EjbModule ejbModule : appModule.getEjbModules()) {
if (ejbModule.getFinder() == null) {
continue;
}
WebModule webModule = null;
for (final WebModule web : appModule.getWebModules()) {
if (!web.getModuleId().equals(ejbModule.getModuleId())) {
continue;
}
webModule = web;
break;
}
if (webModule == null) {
continue;
}
for (final Class<?> clazz : ejbModule.getFinder().findAnnotatedClasses(ApplicationComposer.class)) {
final ApplicationComposer applicationComposer = clazz.getAnnotation(ApplicationComposer.class);
final Descriptor descriptor = clazz.getAnnotation(Descriptor.class);
if (descriptor != null) {
configureDescriptor(appModule, descriptor);
}
final Descriptors descriptors = clazz.getAnnotation(Descriptors.class);
if (descriptors != null) {
for (final Descriptor d : descriptors.value()) {
configureDescriptor(appModule, descriptor);
}
}
final Classes classes = clazz.getAnnotation(Classes.class);
if (classes != null) {
configureClasses(webModule, ejbModule, applicationComposer, classes);
}
Object instance = null;
final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(org.apache.openejb.util.Classes.ancestors(clazz)));
for (final Method m : finder.findAnnotatedMethods(org.apache.openejb.testing.Module.class)) {
instance = configureModule(appModule, ejbModule, clazz, instance, m);
}
for (final Method m : finder.findAnnotatedMethods(Configuration.class)) {
instance = configureConfiguration(appModule, clazz, instance, m);
}
final JaxrsProviders jaxrsProviders = clazz.getAnnotation(JaxrsProviders.class);
if (jaxrsProviders != null) {
for (final Class<?> c : jaxrsProviders.value()) {
webModule.getJaxrsProviders().add(c.getName());
}
}
}
}
return appModule;
}
use of org.apache.openejb.testing.Classes in project tomee by apache.
the class CdiDecoratorMultipleDelegateCallsTest method classes.
@Module
@Classes({ ServiceImpl.class })
public EjbModule classes() {
final Beans beans = new Beans();
beans.addDecorator(ServiceDecorator.class);
final EjbModule jar = new EjbModule(new EjbJar());
jar.setBeans(beans);
return jar;
}
use of org.apache.openejb.testing.Classes in project tomee by apache.
the class BasicInjectionTest method app.
@Module
@Classes(cdi = true, value = { Configuration.class })
public StatelessBean app() throws Exception {
final StatelessBean bean = new StatelessBean(WidgetBean.class);
bean.setLocalBean(new Empty());
return bean;
}
use of org.apache.openejb.testing.Classes in project tomee by apache.
the class ResourceAdapterDeliveryActiveTest method app.
@Module
@Classes(value = Mdb.class)
public EjbModule app() {
return new EjbModule(new EjbJar("test") {
{
addEnterpriseBean(new MessageDrivenBean("ejb/Mdb", Mdb.class) {
{
setActivationConfig(new ActivationConfig());
getActivationConfig().addProperty("DeliveryActive", "false");
getActivationConfig().addProperty("MdbJMXControl", "default:type=test");
}
});
}
});
}
Aggregations