tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r1149385 - in /tapestry/tapestry5/trunk/tapestry-jpa/src: main/java/org/apache/tapestry5/internal/jpa/ main/java/org/apache/tapestry5/jpa/ test/java/org/apache/tapestry5/internal/jpa/
Date Thu, 21 Jul 2011 21:53:58 GMT
Author: hlship
Date: Thu Jul 21 21:53:53 2011
New Revision: 1149385

URL: http://svn.apache.org/viewvc?rev=1149385&view=rev
Log:
TAP5-1508: Update tapestry-jpa to use the new transformation APIs

Modified:
    tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterMethodAdvice.java
    tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterWorker.java
    tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaInternalUtils.java
    tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImpl.java
    tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContextWorker.java
    tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java
    tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImplTest.java

Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterMethodAdvice.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterMethodAdvice.java?rev=1149385&r1=1149384&r2=1149385&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterMethodAdvice.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterMethodAdvice.java
Thu Jul 21 21:53:53 2011
@@ -14,28 +14,29 @@
 
 package org.apache.tapestry5.internal.jpa;
 
+import org.apache.tapestry5.jpa.EntityManagerManager;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.MethodInvocation;
+
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 import javax.persistence.PersistenceContext;
 
-import org.apache.tapestry5.ioc.Invocation;
-import org.apache.tapestry5.ioc.MethodAdvice;
-import org.apache.tapestry5.jpa.EntityManagerManager;
-
 public class CommitAfterMethodAdvice implements MethodAdvice
 {
-
     private final EntityManagerManager manager;
 
-    public CommitAfterMethodAdvice(final EntityManagerManager manager)
+    private final PersistenceContext annotation;
+
+    public CommitAfterMethodAdvice(final EntityManagerManager manager, PersistenceContext
annotation)
     {
-        super();
         this.manager = manager;
+        this.annotation = annotation;
     }
 
-    public void advise(final Invocation invocation)
+    public void advise(final MethodInvocation invocation)
     {
-        final EntityTransaction transaction = getTransaction(invocation);
+        final EntityTransaction transaction = getTransaction();
 
         if (transaction != null && !transaction.isActive())
         {
@@ -45,8 +46,7 @@ public class CommitAfterMethodAdvice imp
         try
         {
             invocation.proceed();
-        }
-        catch (final RuntimeException e)
+        } catch (final RuntimeException e)
         {
             if (transaction != null && transaction.isActive())
             {
@@ -65,11 +65,8 @@ public class CommitAfterMethodAdvice imp
 
     }
 
-    private EntityTransaction getTransaction(final Invocation invocation)
+    private EntityTransaction getTransaction()
     {
-        final PersistenceContext annotation = invocation
-                .getMethodAnnotation(PersistenceContext.class);
-
         EntityManager em = JpaInternalUtils.getEntityManager(manager, annotation);
 
         if (em == null)

Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterWorker.java?rev=1149385&r1=1149384&r2=1149385&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterWorker.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/CommitAfterWorker.java
Thu Jul 21 21:53:53 2011
@@ -17,36 +17,38 @@ package org.apache.tapestry5.internal.jp
 import org.apache.tapestry5.jpa.EntityManagerManager;
 import org.apache.tapestry5.jpa.annotations.CommitAfter;
 import org.apache.tapestry5.model.MutableComponentModel;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.ComponentMethodAdvice;
-import org.apache.tapestry5.services.ComponentMethodInvocation;
-import org.apache.tapestry5.services.TransformMethod;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.PlasticClass;
+import org.apache.tapestry5.plastic.PlasticMethod;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
 
-public class CommitAfterWorker implements ComponentClassTransformWorker
+import javax.persistence.PersistenceContext;
+
+public class CommitAfterWorker implements ComponentClassTransformWorker2
 {
-    private final CommitAfterMethodAdvice advice;
 
-    public CommitAfterWorker(final EntityManagerManager manager)
+    private final MethodAdvice shared;
+
+    private final EntityManagerManager manager;
+
+    public CommitAfterWorker(EntityManagerManager manager)
     {
-        advice = new CommitAfterMethodAdvice(manager);
+        this.manager = manager;
+
+        shared = new CommitAfterMethodAdvice(manager, null);
     }
 
-    public void transform(final ClassTransformation transformation,
-            final MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel
model)
     {
-        for (final TransformMethod method : transformation
-                .matchMethodsWithAnnotation(CommitAfter.class))
+        for (final PlasticMethod method : plasticClass
+                .getMethodsWithAnnotation(CommitAfter.class))
         {
-            method.addAdvice(new ComponentMethodAdvice()
-            {
+            PersistenceContext annotation = method.getAnnotation(PersistenceContext.class);
 
-                public void advise(final ComponentMethodInvocation invocation)
-                {
-                    advice.advise(invocation);
+            MethodAdvice advice = annotation == null ? shared : new CommitAfterMethodAdvice(manager,
annotation);
 
-                }
-            });
+            method.addAdvice(advice);
         }
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaInternalUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaInternalUtils.java?rev=1149385&r1=1149384&r2=1149385&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaInternalUtils.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaInternalUtils.java
Thu Jul 21 21:53:53 2011
@@ -14,18 +14,17 @@
 
 package org.apache.tapestry5.internal.jpa;
 
-import java.util.Map;
-import java.util.Set;
+import org.apache.tapestry5.ioc.internal.util.InternalUtils;
+import org.apache.tapestry5.jpa.EntityManagerManager;
+import org.apache.tapestry5.jpa.JpaConstants;
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.PersistenceContext;
 import javax.persistence.metamodel.EntityType;
 import javax.persistence.metamodel.Metamodel;
-
-import org.apache.tapestry5.ioc.internal.util.InternalUtils;
-import org.apache.tapestry5.jpa.EntityManagerManager;
-import org.apache.tapestry5.jpa.JpaConstants;
+import java.util.Map;
+import java.util.Set;
 
 public class JpaInternalUtils
 {
@@ -63,7 +62,10 @@ public class JpaInternalUtils
             {
                 if (entityType.getJavaType() == entity.getClass())
                 {
-                    if (em.contains(entity)) { return em; }
+                    if (em.contains(entity))
+                    {
+                        return em;
+                    }
                 }
             }
         }
@@ -75,9 +77,9 @@ public class JpaInternalUtils
     }
 
     public static EntityManager getEntityManager(EntityManagerManager entityManagerManager,
-            PersistenceContext annotation)
-    {        
-        String unitName = annotation == null? null: annotation.unitName();
+                                                 PersistenceContext annotation)
+    {
+        String unitName = annotation == null ? null : annotation.unitName();
 
         if (InternalUtils.isNonBlank(unitName))
             return entityManagerManager.getEntityManager(unitName);
@@ -87,7 +89,7 @@ public class JpaInternalUtils
         if (entityManagers.size() == 1)
             return entityManagers.values().iterator().next();
 
-        throw new RuntimeException("Unable to locate a single EntityManager.  " +
-                "Please provide the persistence unit name as defined in the persistence.xml
using the @PersistenceContext annotation");
+        throw new RuntimeException("Unable to locate a single EntityManager. " +
+                "You must provide the persistence unit name as defined in the persistence.xml
using the @PersistenceContext annotation.");
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImpl.java?rev=1149385&r1=1149384&r2=1149385&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImpl.java
Thu Jul 21 21:53:53 2011
@@ -14,32 +14,40 @@
 
 package org.apache.tapestry5.internal.jpa;
 
-import java.lang.reflect.Method;
-
 import org.apache.tapestry5.ioc.MethodAdviceReceiver;
 import org.apache.tapestry5.jpa.EntityManagerManager;
 import org.apache.tapestry5.jpa.JpaTransactionAdvisor;
 import org.apache.tapestry5.jpa.annotations.CommitAfter;
+import org.apache.tapestry5.plastic.MethodAdvice;
+
+import javax.persistence.PersistenceContext;
+import java.lang.reflect.Method;
 
 public class JpaTransactionAdvisorImpl implements JpaTransactionAdvisor
 {
+    private final EntityManagerManager manager;
 
-    private final CommitAfterMethodAdvice advice;
+    private final MethodAdvice shared;
 
-    public JpaTransactionAdvisorImpl(final EntityManagerManager manager)
+
+    public JpaTransactionAdvisorImpl(EntityManagerManager manager)
     {
-        advice = new CommitAfterMethodAdvice(manager);
+        this.manager = manager;
+
+        shared = new CommitAfterMethodAdvice(manager, null);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     public void addTransactionCommitAdvice(final MethodAdviceReceiver receiver)
     {
         for (final Method m : receiver.getInterface().getMethods())
         {
             if (m.getAnnotation(CommitAfter.class) != null)
             {
+                PersistenceContext annotation = receiver.getMethodAnnotation(m, PersistenceContext.class);
+
+                MethodAdvice advice =
+                        annotation == null ? shared : new CommitAfterMethodAdvice(manager,
annotation);
+
                 receiver.adviseMethod(m, advice);
             }
         }

Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContextWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContextWorker.java?rev=1149385&r1=1149384&r2=1149385&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContextWorker.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/PersistenceContextWorker.java
Thu Jul 21 21:53:53 2011
@@ -14,57 +14,42 @@
 
 package org.apache.tapestry5.internal.jpa;
 
-import javax.persistence.PersistenceContext;
-
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
+import org.apache.tapestry5.internal.transform.ReadOnlyFieldValueConduit;
 import org.apache.tapestry5.jpa.EntityManagerManager;
 import org.apache.tapestry5.model.MutableComponentModel;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.plastic.InstanceContext;
+import org.apache.tapestry5.plastic.PlasticClass;
+import org.apache.tapestry5.plastic.PlasticField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
+
+import javax.persistence.PersistenceContext;
 
-public class PersistenceContextWorker implements ComponentClassTransformWorker
+public class PersistenceContextWorker implements ComponentClassTransformWorker2
 {
     private final EntityManagerManager entityManagerManager;
 
     public PersistenceContextWorker(final EntityManagerManager entityManagerManager)
     {
-        super();
         this.entityManagerManager = entityManagerManager;
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    public void transform(final ClassTransformation transformation,
-            final MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel
model)
     {
-
-        for (final TransformField field : transformation
-                .matchFieldsWithAnnotation(PersistenceContext.class))
+        for (final PlasticField field : plasticClass
+                .getFieldsWithAnnotation(PersistenceContext.class))
         {
             final PersistenceContext annotation = field.getAnnotation(PersistenceContext.class);
 
             field.claim(annotation);
 
-            field.replaceAccess(new FieldValueConduit()
+            field.setConduit(new ReadOnlyFieldValueConduit(plasticClass.getClassName(), field.getName())
             {
-
-                public Object get()
+                public Object get(Object instance, InstanceContext context)
                 {
                     return JpaInternalUtils.getEntityManager(entityManagerManager, annotation);
                 }
-
-                public void set(final Object newValue)
-                {
-                    throw new UnsupportedOperationException(String.format(
-                            "It is not possible to assign a new value to '%s' field",
-                            field.getName()));
-
-                }
             });
         }
-
     }
-
 }

Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java?rev=1149385&r1=1149384&r2=1149385&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-jpa/src/main/java/org/apache/tapestry5/jpa/JpaModule.java
Thu Jul 21 21:53:53 2011
@@ -18,34 +18,11 @@ import org.apache.tapestry5.ValueEncoder
 import org.apache.tapestry5.internal.InternalConstants;
 import org.apache.tapestry5.internal.jpa.*;
 import org.apache.tapestry5.internal.services.PersistentFieldManager;
-import org.apache.tapestry5.ioc.Configuration;
-import org.apache.tapestry5.ioc.LoggerSource;
-import org.apache.tapestry5.ioc.MappedConfiguration;
-import org.apache.tapestry5.ioc.ObjectProvider;
-import org.apache.tapestry5.ioc.OrderedConfiguration;
-import org.apache.tapestry5.ioc.Resource;
-import org.apache.tapestry5.ioc.ScopeConstants;
-import org.apache.tapestry5.ioc.ServiceBinder;
-import org.apache.tapestry5.ioc.annotations.Contribute;
-import org.apache.tapestry5.ioc.annotations.Local;
-import org.apache.tapestry5.ioc.annotations.Scope;
-import org.apache.tapestry5.ioc.annotations.Startup;
-import org.apache.tapestry5.ioc.annotations.Symbol;
-import org.apache.tapestry5.ioc.services.FactoryDefaults;
-import org.apache.tapestry5.ioc.services.MasterObjectProvider;
-import org.apache.tapestry5.ioc.services.PerthreadManager;
-import org.apache.tapestry5.ioc.services.PropertyAccess;
-import org.apache.tapestry5.ioc.services.RegistryShutdownHub;
-import org.apache.tapestry5.ioc.services.SymbolProvider;
-import org.apache.tapestry5.ioc.services.TypeCoercer;
-import org.apache.tapestry5.services.ApplicationStateContribution;
-import org.apache.tapestry5.services.ApplicationStateManager;
-import org.apache.tapestry5.services.ApplicationStatePersistenceStrategy;
-import org.apache.tapestry5.services.ApplicationStatePersistenceStrategySource;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.PersistentFieldStrategy;
-import org.apache.tapestry5.services.ValueEncoderFactory;
-import org.apache.tapestry5.services.ValueEncoderSource;
+import org.apache.tapestry5.ioc.*;
+import org.apache.tapestry5.ioc.annotations.*;
+import org.apache.tapestry5.ioc.services.*;
+import org.apache.tapestry5.services.*;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
 import org.slf4j.Logger;
 
 import javax.persistence.EntityManagerFactory;
@@ -134,11 +111,11 @@ public class JpaModule
         configuration.addInstance(JpaPersistenceConstants.ENTITY, EntityApplicationStatePersistenceStrategy.class);
     }
 
-    public static void contributeComponentClassTransformWorker(
-            final OrderedConfiguration<ComponentClassTransformWorker> configuration)
+    @Contribute(ComponentClassTransformWorker2.class)
+    @Primary
+    public static void provideClassTransformWorkers(OrderedConfiguration<ComponentClassTransformWorker2>
configuration)
     {
         configuration.addInstance("PersistenceContext", PersistenceContextWorker.class, "after:Property");
-
         configuration.addInstance("JPACommitAfter", CommitAfterWorker.class, "after:Log");
     }
 

Modified: tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImplTest.java?rev=1149385&r1=1149384&r2=1149385&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImplTest.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-jpa/src/test/java/org/apache/tapestry5/internal/jpa/JpaTransactionAdvisorImplTest.java
Thu Jul 21 21:53:53 2011
@@ -97,7 +97,7 @@ public class JpaTransactionAdvisorImplTe
         advisor.addTransactionCommitAdvice(builder);
 
         final VoidService interceptor = builder.build();
-        
+
         expect(manager.getEntityManagers()).andReturn(managers);
 
         replay();
@@ -106,15 +106,14 @@ public class JpaTransactionAdvisorImplTe
         {
             interceptor.persistenceUnitNameMissing();
             TestBase.unreachable();
-        }
-        catch (Exception e)
+        } catch (Exception e)
         {
-               Assert.assertEquals(e.getMessage(), "Unable to locate a single EntityManager.
 " +
-                       "Please provide the persistence unit name as defined in the persistence.xml
using the @PersistenceContext annotation");
+            Assert.assertEquals(e.getMessage(), "Unable to locate a single EntityManager.
" +
+                    "You must provide the persistence unit name as defined in the persistence.xml
using the @PersistenceContext annotation.");
         }
         verify();
     }
-    
+
     @Test
     public void persistence_unit_name_missing_single_unit_configured()
     {
@@ -132,7 +131,7 @@ public class JpaTransactionAdvisorImplTe
         advisor.addTransactionCommitAdvice(builder);
 
         final VoidService interceptor = builder.build();
-        
+
         expect(manager.getEntityManagers()).andReturn(managers);
         train_getTransaction(em, transaction, true);
         delegate.persistenceUnitNameMissing();
@@ -163,25 +162,25 @@ public class JpaTransactionAdvisorImplTe
         expect(manager.getEntityManagers()).andReturn(managers);
 
         replay();
+
         try
         {
             interceptor.persistenceUnitMissing();
             TestBase.unreachable();
-        }
-        catch (Exception e)
+        } catch (Exception e)
         {
-               Assert.assertEquals(e.getMessage(), "Unable to locate a single EntityManager.
 " +
-                       "Please provide the persistence unit name as defined in the persistence.xml
using the @PersistenceContext annotation");
+            assertMessageContains(e, "Unable to locate a single EntityManager");
         }
+
         verify();
     }
-    
+
     @Test
     public void persistence_unit_missing_single_unit_configured()
     {
         final VoidService delegate = newMock(VoidService.class);
         final EntityManagerManager manager = newMock(EntityManagerManager.class);
-        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);        
+        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);
         final EntityTransaction transaction = newMock(EntityTransaction.class);
         EntityManager em = newMock(EntityManager.class);
         Map<String, EntityManager> managers = CollectionFactory.newMap();
@@ -310,8 +309,7 @@ public class JpaTransactionAdvisorImplTe
         {
             interceptor.perform();
             TestBase.unreachable();
-        }
-        catch (final RuntimeException ex)
+        } catch (final RuntimeException ex)
         {
             Assert.assertSame(ex, re);
         }
@@ -337,8 +335,10 @@ public class JpaTransactionAdvisorImplTe
         final Performer interceptor = builder.build();
 
         train_getActiveTransaction(manager, entityManager, transaction);
+
         delegate.perform();
-        TestBase.setThrowable(se);
+        setThrowable(se);
+
         train_commitActiveTransaction(transaction);
 
         replay();
@@ -347,9 +347,9 @@ public class JpaTransactionAdvisorImplTe
         try
         {
             interceptor.perform();
-            TestBase.unreachable();
-        }
-        catch (final SQLException ex)
+
+            unreachable();
+        } catch (final SQLException ex)
         {
             Assert.assertSame(ex, se);
         }
@@ -408,26 +408,26 @@ public class JpaTransactionAdvisorImplTe
     }
 
     private void train_getAndBeginTransaction(final EntityManagerManager manager,
-            final EntityManager entityManager, final EntityTransaction transaction)
+                                              final EntityManager entityManager, final EntityTransaction
transaction)
     {
         train_getTransaction(manager, entityManager, transaction, false);
         transaction.begin();
     }
 
     private void train_getActiveTransaction(final EntityManagerManager manager,
-            final EntityManager entityManager, final EntityTransaction transaction)
+                                            final EntityManager entityManager, final EntityTransaction
transaction)
     {
         train_getTransaction(manager, entityManager, transaction, true);
     }
 
     private void train_getTransaction(final EntityManagerManager manager,
-            final EntityManager entityManager, final EntityTransaction transaction,
-            final boolean isActive)
+                                      final EntityManager entityManager, final EntityTransaction
transaction,
+                                      final boolean isActive)
     {
         expect(manager.getEntityManager(UNIT_NAME)).andReturn(entityManager);
         train_getTransaction(entityManager, transaction, isActive);
     }
-    
+
     private void train_getTransaction(
             final EntityManager entityManager, final EntityTransaction transaction,
             final boolean isActive)



Mime
View raw message