@Test
public void testEntityManagerIsPassed() throws Exception {
-
-
+
final TransactionProxyFactory<Service> factory = new TransactionProxyFactory<Service>(
jpaTester.getJpaBuilder(), Service.class);
- Service service = new Service() {
- private EntityManager em = factory.getTransactionScopedEntityManager();
-
+ Service service = new Service() {
+ private EntityManager em = factory
+ .getTransactionScopedEntityManager();
+
@Override
public int execute(int aValue) throws Exception {
assertNotNull(em);
return 0;
}
};
-
+
final Service proxy = factory.getProxy(service);
jpaTester.getJpaBuilder().execute(new JpaUnitOfWork<Void>() {
@Override
public Void execute(EntityManager aEm) throws Exception {
- assert(aEm != null);
+ assert (aEm != null);
proxy.execute(10);
- return null;
+ return null;
}
});
}