[seam-commits] Seam SVN: r13513 - in modules/persistence/trunk: impl/src/main/java/org/jboss/seam/persistence/transaction and 3 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jul 27 03:48:58 EDT 2010


Author: swd847
Date: 2010-07-27 03:48:57 -0400 (Tue, 27 Jul 2010)
New Revision: 13513

Added:
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/NamingUtils.java
Removed:
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/Naming.java
Modified:
   modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/Transactional.java
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionExtension.java
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInterceptor.java
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionalInterceptorBinding.java
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EjbApi.java
   modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java
   modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java
   modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java
   modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java
Log:
change implementation of transaction interceptor to allow overriding transaction type on methods


Modified: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/Transactional.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/Transactional.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/Transactional.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -27,21 +27,22 @@
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-import javax.interceptor.InterceptorBinding;
-
 /**
  * Demarcates transaction boundaries
  * 
  * Note that is you are using seam managed transactions seam will automatically
  * manage your transactions for you, rendering this unnessesary
  * 
+ * Note that this annotation is not actually an interceptor binding. It is
+ * replaced by an interceptor binding at runtime by a portable extension in the
+ * ProcessAnnotatedType phase
  * 
+ * 
  * @author Dan Allen
  */
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 @Target( { ElementType.METHOD, ElementType.TYPE })
- at InterceptorBinding
 public @interface Transactional
 {
    /**

Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -25,7 +25,7 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
 
-import org.jboss.seam.persistence.util.Naming;
+import org.jboss.seam.persistence.util.NamingUtils;
 
 /**
  * utility class to look up the EJBContext
@@ -41,11 +41,11 @@
    {
       try
       {
-         return (EJBContext) Naming.getInitialContext().lookup(ejbContextName);
+         return (EJBContext) NamingUtils.getInitialContext().lookup(ejbContextName);
       }
       catch (NameNotFoundException nnfe)
       {
-         return (EJBContext) Naming.getInitialContext().lookup(STANDARD_EJB_CONTEXT_NAME);
+         return (EJBContext) NamingUtils.getInitialContext().lookup(STANDARD_EJB_CONTEXT_NAME);
       }
    }
 

Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionExtension.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionExtension.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionExtension.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -22,11 +22,16 @@
 package org.jboss.seam.persistence.transaction;
 
 import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.BeforeBeanDiscovery;
 import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.enterprise.util.AnnotationLiteral;
 
 import org.jboss.seam.persistence.transaction.literal.DefaultTransactionLiteral;
+import org.jboss.seam.persistence.util.EjbApi;
 import org.jboss.weld.extensions.annotated.AnnotatedTypeBuilder;
 import org.jboss.weld.extensions.bean.BeanBuilder;
 import org.jboss.weld.extensions.defaultbean.DefaultBeanExtension;
@@ -63,4 +68,45 @@
       builder.getQualifiers().add(DefaultTransactionLiteral.INSTANCE);
       DefaultBeanExtension.addDefaultBean(SeamTransaction.class, builder.create());
    }
+
+   /**
+    * Looks for @Transaction or @TransactionAttribute annotations and if they
+    * are found adds the transaction intercepter binding
+    * 
+    */
+   public <X> void processAnnotatedType(@Observes ProcessAnnotatedType<X> event)
+   {
+      if (event.getAnnotatedType().isAnnotationPresent(Transactional.class))
+      {
+         event.setAnnotatedType(addInterceptorBinding(event.getAnnotatedType()));
+         return;
+      }
+      if (event.getAnnotatedType().isAnnotationPresent(EjbApi.TRANSACTION_ATTRIBUTE) && !EjbApi.isEjb(event.getAnnotatedType()))
+      {
+         event.setAnnotatedType(addInterceptorBinding(event.getAnnotatedType()));
+         return;
+      }
+      for (AnnotatedMethod<? super X> m : event.getAnnotatedType().getMethods())
+      {
+         if (m.isAnnotationPresent(Transactional.class))
+         {
+            event.setAnnotatedType(addInterceptorBinding(event.getAnnotatedType()));
+            return;
+         }
+         else if (m.isAnnotationPresent(EjbApi.TRANSACTION_ATTRIBUTE) && !EjbApi.isEjb(event.getAnnotatedType()))
+         {
+            event.setAnnotatedType(addInterceptorBinding(event.getAnnotatedType()));
+            return;
+         }
+      }
+   }
+
+   public <X> AnnotatedType addInterceptorBinding(AnnotatedType<X> type)
+   {
+      AnnotatedTypeBuilder<X> builder = new AnnotatedTypeBuilder<X>().readFromType(type);
+      builder.addToClass(new AnnotationLiteral<TransactionalInterceptorBinding>()
+      {
+      });
+      return builder.create();
+   }
 }

Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInterceptor.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInterceptor.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInterceptor.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -38,8 +38,9 @@
  * 
  * @author Gavin King
  * @author Shane Bryzak
+ * @author Stuart Douglas
  */
- at Transactional
+ at TransactionalInterceptorBinding
 @Interceptor
 public class TransactionInterceptor implements Serializable
 {

Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -10,7 +10,7 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
 
-import org.jboss.seam.persistence.util.Naming;
+import org.jboss.seam.persistence.util.NamingUtils;
 import org.jboss.weld.extensions.literal.DefaultLiteral;
 
 /**
@@ -72,7 +72,7 @@
 
    protected javax.transaction.UserTransaction getUserTransaction() throws NamingException
    {
-      InitialContext context = Naming.getInitialContext();
+      InitialContext context = NamingUtils.getInitialContext();
       try
       {
          return (javax.transaction.UserTransaction) context.lookup("java:comp/UserTransaction");

Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionalInterceptorBinding.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionalInterceptorBinding.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionalInterceptorBinding.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.seam.persistence.transaction;
 
 import java.lang.annotation.ElementType;

Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EjbApi.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EjbApi.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EjbApi.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -24,6 +24,8 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 
+import javax.enterprise.inject.spi.AnnotatedType;
+
 import org.jboss.weld.extensions.util.Reflections;
 
 /**
@@ -43,6 +45,11 @@
    public static final Class<? extends Enum> TRANSACTION_ATTRIBUTE_TYPE;
    public static final Class<? extends Annotation> APPLICATION_EXCEPTION;
 
+   public static final Class<? extends Annotation> STATEFUL;
+   public static final Class<? extends Annotation> STATELESS;
+   public static final Class<? extends Annotation> MESSAGE_DRIVEN;
+   public static final Class<? extends Annotation> SINGLETON;
+
    private static final Object MANDATORY;
 
    private static final Object REQUIRED;
@@ -73,6 +80,7 @@
    {
       APPLICATION_EXCEPTION = classForName("javax.ejb.ApplicationException");
       TRANSACTION_ATTRIBUTE = classForName("javax.ejb.TransactionAttribute");
+
       TRANSACTION_ATTRIBUTE_TYPE = classForName("javax.ejb.TransactionAttributeType");
       if (TRANSACTION_ATTRIBUTE_TYPE.getName().equals("javax.ejb.TransactionAttributeType"))
       {
@@ -93,6 +101,12 @@
          SUPPORTS = Dummy.class;
       }
       INVOCATION_CONTEXT_AVAILABLE = !classForName("javax.interceptor.InvocationContext").equals(Dummy.class);
+
+      STATEFUL = classForName("javax.ejb.Stateful");
+      STATELESS = classForName("javax.ejb.Stateless");
+      MESSAGE_DRIVEN = classForName("javax.ejb.MessageDriven");
+      SINGLETON = classForName("javax.ejb.Singleton");
+
    }
 
    public static String name(Annotation annotation)
@@ -122,4 +136,8 @@
       }
    }
 
+   public static <X> boolean isEjb(AnnotatedType<X> type)
+   {
+      return type.isAnnotationPresent(STATEFUL) || type.isAnnotationPresent(STATELESS) || type.isAnnotationPresent(MESSAGE_DRIVEN) || type.isAnnotationPresent(SINGLETON);
+   }
 }

Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/Naming.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/Naming.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/Naming.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.persistence.util;
-
-import java.util.Hashtable;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * this has been ported to seam and hacked to make it work
- * 
- * we need to figure out what we are doing with JNDI in seam 3 and make this go
- * away
- * 
- * @author stuart
- * 
- */
-public final class Naming
-{
-   private static final Logger log = LoggerFactory.getLogger(Naming.class);
-   private static Hashtable initialContextProperties;
-
-   private static InitialContext initialContext;
-
-   public static InitialContext getInitialContext(Hashtable<String, String> props) throws NamingException
-   {
-      if (props == null)
-      {
-         // throw new
-         // IllegalStateException("JNDI properties not initialized, Seam was not started correctly");
-      }
-      props = new Hashtable<String, String>();
-
-      if (log.isDebugEnabled())
-      {
-         log.debug("JNDI InitialContext properties:" + props);
-      }
-
-      try
-      {
-         return props.size() == 0 ? new InitialContext() : new InitialContext(props);
-      }
-      catch (NamingException e)
-      {
-         log.debug("Could not obtain initial context");
-         throw e;
-      }
-
-   }
-
-   public static InitialContext getInitialContext() throws NamingException
-   {
-      if (initialContext == null)
-         initInitialContext();
-
-      return initialContext;
-   }
-
-   private static synchronized void initInitialContext() throws NamingException
-   {
-      if (initialContext == null)
-      {
-         initialContext = getInitialContext(initialContextProperties);
-      }
-   }
-
-   private Naming()
-   {
-   }
-
-   public static void setInitialContextProperties(Hashtable initialContextProperties)
-   {
-      Naming.initialContextProperties = initialContextProperties;
-      initialContext = null;
-   }
-
-   public static Hashtable getInitialContextProperties()
-   {
-      return initialContextProperties;
-   }
-}

Copied: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/NamingUtils.java (from rev 13502, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/Naming.java)
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/NamingUtils.java	                        (rev 0)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/NamingUtils.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.util;
+
+import java.util.Hashtable;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * this has been ported to seam and hacked to make it work
+ * 
+ * we need to figure out what we are doing with JNDI in seam 3 and make this go
+ * away
+ * 
+ * @author stuart
+ * 
+ */
+public final class NamingUtils
+{
+   private static final Logger log = LoggerFactory.getLogger(NamingUtils.class);
+   private static Hashtable initialContextProperties;
+
+   private static InitialContext initialContext;
+
+   public static InitialContext getInitialContext(Hashtable<String, String> props) throws NamingException
+   {
+      if (props == null)
+      {
+         // throw new
+         // IllegalStateException("JNDI properties not initialized, Seam was not started correctly");
+      }
+      props = new Hashtable<String, String>();
+
+      if (log.isDebugEnabled())
+      {
+         log.debug("JNDI InitialContext properties:" + props);
+      }
+
+      try
+      {
+         return props.size() == 0 ? new InitialContext() : new InitialContext(props);
+      }
+      catch (NamingException e)
+      {
+         log.debug("Could not obtain initial context");
+         throw e;
+      }
+
+   }
+
+   public static InitialContext getInitialContext() throws NamingException
+   {
+      if (initialContext == null)
+         initInitialContext();
+
+      return initialContext;
+   }
+
+   private static synchronized void initInitialContext() throws NamingException
+   {
+      if (initialContext == null)
+      {
+         initialContext = getInitialContext(initialContextProperties);
+      }
+   }
+
+   private NamingUtils()
+   {
+   }
+
+   public static void setInitialContextProperties(Hashtable initialContextProperties)
+   {
+      NamingUtils.initialContextProperties = initialContextProperties;
+      initialContext = null;
+   }
+
+   public static Hashtable getInitialContextProperties()
+   {
+      return initialContextProperties;
+   }
+}

Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTest.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -18,6 +18,7 @@
 import org.jboss.seam.persistence.transaction.DefaultTransaction;
 import org.jboss.seam.persistence.transaction.SeamTransaction;
 import org.jboss.seam.persistence.transaction.TransactionExtension;
+import org.jboss.seam.persistence.util.NamingUtils;
 import org.jboss.seam.transactions.test.util.ArtifactNames;
 import org.jboss.seam.transactions.test.util.Hotel;
 import org.jboss.seam.transactions.test.util.ManagedPersistenceContextProvider;
@@ -40,6 +41,7 @@
       war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
       war.addPackage(TransactionExtension.class.getPackage());
       war.addPackage(PersistenceContextExtension.class.getPackage());
+      war.addPackage(NamingUtils.class.getPackage());
       war.addClasses(ManagedPersistenceContextTest.class, Hotel.class, ManagedPersistenceContextProvider.class);
       war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
       war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");

Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTest.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -40,6 +40,7 @@
 import org.jboss.seam.persistence.transaction.SeamTransaction;
 import org.jboss.seam.persistence.transaction.TransactionExtension;
 import org.jboss.seam.persistence.transaction.TransactionInterceptor;
+import org.jboss.seam.persistence.util.NamingUtils;
 import org.jboss.seam.transactions.test.util.ArtifactNames;
 import org.jboss.seam.transactions.test.util.DontRollBackException;
 import org.jboss.seam.transactions.test.util.EntityManagerProvider;
@@ -69,6 +70,7 @@
       war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
       war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
       war.addPackage(TransactionExtension.class.getPackage());
+      war.addPackage(NamingUtils.class.getPackage());
       war.addClasses(TransactionInterceptorTest.class, TransactionManagedBean.class, Hotel.class, EntityManagerProvider.class, DontRollBackException.class);
       war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
       war.addWebResource(new ByteArrayAsset(("<beans><interceptors><class>" + TransactionInterceptor.class.getName() + "</class></interceptors></beans>").getBytes()), "beans.xml");

Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTest.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -17,6 +17,7 @@
 import org.jboss.seam.persistence.transaction.SeamTransaction;
 import org.jboss.seam.persistence.transaction.TransactionExtension;
 import org.jboss.seam.persistence.transaction.scope.TransactionScopeExtension;
+import org.jboss.seam.persistence.util.NamingUtils;
 import org.jboss.seam.transactions.test.util.ArtifactNames;
 import org.jboss.seam.transactions.test.util.Hotel;
 import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
@@ -38,6 +39,7 @@
       war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
       war.addPackage(TransactionExtension.class.getPackage());
       war.addPackage(TransactionScopeExtension.class.getPackage());
+      war.addPackage(NamingUtils.class.getPackage());
       war.addClasses(TransactionScopedTest.class, Hotel.class, TransactionScopedObject.class);
       war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
       war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");

Modified: modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java
===================================================================
--- modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java	2010-07-26 15:08:47 UTC (rev 13512)
+++ modules/persistence/trunk/impl/src/test/java/org/jboss/seam/persistence/transactions/test/UserTransactionTest.java	2010-07-27 07:48:57 UTC (rev 13513)
@@ -18,6 +18,7 @@
 import org.jboss.seam.persistence.transaction.DefaultTransaction;
 import org.jboss.seam.persistence.transaction.SeamTransaction;
 import org.jboss.seam.persistence.transaction.TransactionExtension;
+import org.jboss.seam.persistence.util.NamingUtils;
 import org.jboss.seam.transactions.test.util.ArtifactNames;
 import org.jboss.seam.transactions.test.util.Hotel;
 import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
@@ -39,6 +40,7 @@
       war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
       war.addPackage(TransactionExtension.class.getPackage());
       war.addClasses(UserTransactionTest.class, Hotel.class);
+      war.addPackage(NamingUtils.class.getPackage());
       war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
       war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
       war.addWebResource("META-INF/services/javax.enterprise.inject.spi.Extension", "classes/META-INF/services/javax.enterprise.inject.spi.Extension");



More information about the seam-commits mailing list