use of org.jboss.weld.mock.MockEjbServices in project core by weld.
the class SubclassedComponentDescriptorTest method prepareContainer.
@BeforeClass
public void prepareContainer() {
final EjbDescriptor<Foo> fooDescriptor = new EjbDescriptorImpl<Foo>(Foo.class, Foo.class, EnhancedFoo.class, SessionBeanType.STATEFUL);
final EjbDescriptor<Bar> barDescriptor = new EjbDescriptorImpl<Bar>(Bar.class, BarLocal.class, EnhancedBar.class, SessionBeanType.STATEFUL);
final EjbDescriptor<Baz> bazDescriptor = new EjbDescriptorImpl<Baz>(Baz.class, Baz.class, EnhancedBaz.class, null);
final BeanDeploymentArchive bda = new BeanDeploymentArchiveImpl("1", Foo.class, Bar.class, BarLocal.class, BarDecorator.class, BarInterceptor.class, BarInterceptorBinding.class, Baz.class) {
@Override
public Collection<EjbDescriptor<?>> getEjbs() {
return ImmutableSet.<EjbDescriptor<?>>of(fooDescriptor, barDescriptor, bazDescriptor);
}
};
final Deployment deployment = new FlatDeployment(bda) {
@Override
public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
return bda;
}
@Override
protected void configureServices(Environment environment) {
super.configureServices(environment);
getServices().add(EjbServices.class, new MockEjbServices());
}
};
container = new TestContainer(deployment).startContainer();
manager = (BeanManagerImpl) container.getBeanManager(bda);
}
Aggregations