(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Tue, 27 Jul 2010 20:47:14 +0000 (20:47 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Tue, 27 Jul 2010 20:47:14 +0000 (20:47 +0000)
test/enterprise/src/main/java/org/wamblee/test/persistence/JpaBuilder.java

index d50ca76e10b92172d0a51e4caf8218f3b90e191d..223971c6cdfec69eec48daf8e224f452b2f61663 100644 (file)
@@ -151,15 +151,19 @@ public class JpaBuilder implements TransactionResource<EntityManager> {
      * passing it the entity manager. Use of this method saves a lot of typing
      * for applications.
      * 
+     * This method requires the transaction to succeed. Otherwise the test will
+     * fail. See {@link #execute(JpaUnitOfWork, TransactionResultCallback)} and
+     * {@link RequireTransactionStatus} for more possibilities. 
+     * 
      * @param aWork
      *            Work to execute.
      * 
      * @return The return value of the execute method of the unit of work.
      */
     public <T> T execute(JpaUnitOfWork<T> aWork) throws Exception {
-        return execute(aWork, new LoggingTransactionResultCallback(Level.INFO));
+        return execute(aWork, new RequireTransactionStatus(TransactionResult.COMMIT));
     }
-
+    
     /**
      * Executes a unit of work. This creates an entitymanager and runs the
      * {@link JpaUnitOfWork#execute(EntityManager)} within a transaction,