|
5 | 5 | package org.hibernate.demos.jpacditesting;
|
6 | 6 |
|
7 | 7 | import javax.enterprise.context.RequestScoped;
|
8 |
| -import javax.enterprise.inject.se.SeContainerInitializer; |
9 | 8 |
|
| 9 | +import org.hibernate.demos.jpacditesting.support.EntityManagerFactoryProducer; |
| 10 | +import org.hibernate.demos.jpacditesting.support.EntityManagerProducer; |
10 | 11 | import org.hibernate.demos.jpacditesting.support.TransactionalConnectionProvider;
|
11 |
| -import org.jboss.weld.environment.se.Weld; |
12 | 12 | import org.jboss.weld.junit4.WeldInitiator;
|
13 | 13 | import org.jnp.server.NamingBeanImpl;
|
14 | 14 | import org.junit.AfterClass;
|
15 | 15 | import org.junit.BeforeClass;
|
16 | 16 | import org.junit.Rule;
|
17 | 17 |
|
| 18 | +import com.arjuna.ats.jta.cdi.TransactionExtension; |
18 | 19 | import com.arjuna.ats.jta.utils.JNDIManager;
|
19 | 20 |
|
20 |
| -public abstract class AbstractCdiTest { |
| 21 | +public abstract class CdiJpaTestBase { |
21 | 22 |
|
22 | 23 | private static NamingBeanImpl NAMING_BEAN;
|
23 | 24 |
|
| 25 | +// @Rule |
| 26 | +// public WeldInitiator weld = WeldInitiator.from(new Weld()) |
| 27 | +// .activate(RequestScoped.class) |
| 28 | +// .inject(this) |
| 29 | +// .build(); |
| 30 | + |
| 31 | + // new Weld() above enables scanning of the classpath; alternatively, only the required beans can be listed explicitly: |
| 32 | + |
24 | 33 | @Rule
|
25 |
| - public WeldInitiator weld = WeldInitiator.from(((Weld) SeContainerInitializer.newInstance())) |
| 34 | + public WeldInitiator weld = WeldInitiator.from( |
| 35 | + ObserverTestBean.class, |
| 36 | + TransactionalTestService.class, |
| 37 | + TestService.class, |
| 38 | + EntityManagerProducer.class, |
| 39 | + EntityManagerFactoryProducer.class, |
| 40 | + TransactionExtension.class |
| 41 | + ) |
26 | 42 | .activate(RequestScoped.class)
|
27 | 43 | .inject(this)
|
28 | 44 | .build();
|
|
0 commit comments