[jboss-cvs] JBossAS SVN: r91065 - in branches/JBPAPP_4_2_0_GA_CP/ejb3/src: test/org/jboss/ejb3/test and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 10 06:45:02 EDT 2009


Author: wolfc
Date: 2009-07-10 06:45:01 -0400 (Fri, 10 Jul 2009)
New Revision: 91065

Added:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java
Removed:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java
Modified:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java
Log:
JBPAPP-1668: re-applied


Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java	2009-07-10 10:38:27 UTC (rev 91064)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/JBossMessageEndpointFactory.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -26,12 +26,11 @@
 import java.util.Collection;
 import java.util.HashMap;
 
-import javax.ejb.TransactionManagementType;
 import javax.ejb.TransactionAttribute;
 import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionManagementType;
+import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
 import javax.resource.spi.ActivationSpec;
 import javax.resource.spi.UnavailableException;
 import javax.resource.spi.endpoint.MessageEndpoint;
@@ -41,11 +40,11 @@
 import org.jboss.deployment.DeploymentException;
 import org.jboss.ejb3.Container;
 import org.jboss.ejb3.KernelAbstractionFactory;
+import org.jboss.ejb3.mdb.MessagingContainer;
 import org.jboss.ejb3.tx.TxUtil;
-import org.jboss.ejb3.mdb.MessagingContainer;
+import org.jboss.logging.Logger;
 import org.jboss.metadata.ActivationConfigPropertyMetaData;
 import org.jboss.mx.util.JMXExceptionDecoder;
-import org.jboss.logging.Logger;
 
 import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
 
@@ -186,8 +185,10 @@
       TransactionManagementType mtype = TxUtil.getTransactionManagementType(container);
       if (mtype == javax.ejb.TransactionManagementType.BEAN) return false;
 
-
-      TransactionAttribute attr = (TransactionAttribute)container.resolveAnnotation(method, TransactionAttribute.class);
+      // JBPAPP-1668: the method can be called by anybody using the interface method (== unadvised)
+      Method advisedMethod = container.getMethodInfo(method).getAdvisedMethod();
+      
+      TransactionAttribute attr = (TransactionAttribute)container.resolveAnnotation(advisedMethod, TransactionAttribute.class);
       if (attr == null)
       {
          attr =(TransactionAttribute)container.resolveAnnotation(TransactionAttribute.class);

Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java	2009-07-10 10:38:27 UTC (rev 91064)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -21,8 +21,8 @@
  */
 package org.jboss.ejb3.mdb.inflow;
 
+import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
-import java.lang.reflect.InvocationHandler;
 
 import javax.resource.ResourceException;
 import javax.resource.spi.endpoint.MessageEndpointFactory;
@@ -31,11 +31,10 @@
 import javax.transaction.TransactionManager;
 import javax.transaction.xa.XAResource;
 
+import org.jboss.aop.MethodInfo;
 import org.jboss.aop.joinpoint.Invocation;
 import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.aop.MethodInfo;
 import org.jboss.ejb3.mdb.MessagingContainer;
-import org.jboss.ejb3.mdb.MDB;
 import org.jboss.ejb3.tx.TxUtil;
 import org.jboss.logging.Logger;
 
@@ -49,6 +48,26 @@
 {
    private static final Logger log = Logger.getLogger(MessageInflowLocalProxy.class);
    
+   private static final Method METHOD_TO_STRING;
+   
+   static
+   {
+      try
+      {
+         //METHOD_EQUALS = Object.class.getDeclaredMethod("equals", Object.class);
+         //METHOD_HASH_CODE = Object.class.getDeclaredMethod("hashCode");
+         METHOD_TO_STRING = Object.class.getDeclaredMethod("toString");
+      }
+      catch (SecurityException e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch (NoSuchMethodException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
    /** The key for the factory */
    public static final String MESSAGE_ENDPOINT_FACTORY = "MessageEndpoint.Factory";
 
@@ -104,7 +123,10 @@
 
    public Object invoke(Object proxy, Method method, Object[] args)
            throws Throwable
-   {   
+   {
+      if(method.equals(METHOD_TO_STRING))
+         return getProxyString(proxy);
+      
       // Are we still useable?
       if (released.get())
          throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " has been released");
@@ -198,8 +220,7 @@
       try
       {
          // Is the delivery transacted?
-         MethodInfo methodInfo = container.getMethodInfo((Method)args[0]);
-         boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(methodInfo.getAdvisedMethod());
+         boolean isTransacted = messageEndpointFactory.isDeliveryTransacted((Method) args[0]);
 
          startTransaction("beforeDelivery", proxy, container, method, args, isTransacted);
       }
@@ -262,7 +283,7 @@
          // Check for starting a transaction
          if (oldClassLoader == null)
          {
-            boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(methodInfo.getAdvisedMethod());
+            boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(method);
             startTransaction("delivery", proxy, container, method, args, isTransacted);
          }
          return container.localInvoke(methodInfo, args);

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java (from rev 89919, branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/common/AbstractReplierMDB.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.common;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Sets up a MDB which can reply to messages via sendReply.
+ * 
+ * Make sure that postConstruct are preDestroy are properly executed when overridden.
+ * 
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public abstract class AbstractReplierMDB implements MessageListener
+{
+   private static final Logger log = Logger.getLogger(AbstractReplierMDB.class);
+   
+   @Resource(mappedName="java:/ConnectionFactory")
+   private QueueConnectionFactory factory;
+   
+   private QueueConnection connection;
+   private QueueSession session;
+   private QueueSender sender;
+   
+   /**
+    * Send an object message to the specified destination.
+    * 
+    * @param destination
+    * @param obj
+    * @throws JMSException
+    */
+   protected void sendReply(Destination destination, Serializable obj) throws JMSException
+   {
+      Message message = session.createObjectMessage(obj);
+      sender.send(destination, message);
+   }
+   
+   @PostConstruct
+   public void postConstruct()
+   {
+      try
+      {
+         connection = factory.createQueueConnection();
+         session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         sender = session.createSender(null);
+      }
+      catch(JMSException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
+   @PreDestroy
+   public void preDestroy()
+   {
+      try
+      {
+         if(sender != null)
+            sender.close();
+         if(session != null)
+            session.close();
+         if(connection != null)
+            connection.close();
+      }
+      catch(JMSException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668 (from rev 89919, branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668)

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java	2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668;
-
-import javax.annotation.Resource;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-
-import org.jboss.ejb3.test.common.AbstractReplierMDB;
-import org.jboss.logging.Logger;
-
-/**
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public abstract class AbstractTXMDB extends AbstractReplierMDB
-{
-   private static final Logger log = Logger.getLogger(AbstractTXMDB.class);
-   
-   // this goes against spec, normally you would use BMT and UserTransaction
-   @Resource(mappedName="java:/TransactionManager")
-   private TransactionManager tm;
-   
-   protected void process(Message message)
-   {
-      try
-      {
-         Destination destination = message.getJMSReplyTo();
-         
-         try
-         {
-            int status = tm.getStatus();
-            
-            log.info("Transaction status for " + this + " is " + status);
-            
-            sendReply(destination, status);
-         }
-         catch(SystemException e)
-         {
-            log.warn("Transaction status for " + this + " failed", e);
-            sendReply(destination, e);
-         }
-      }
-      catch(JMSException e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java (from rev 89919, branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/AbstractTXMDB.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668;
+
+import javax.annotation.Resource;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+
+import org.jboss.ejb3.test.common.AbstractReplierMDB;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public abstract class AbstractTXMDB extends AbstractReplierMDB
+{
+   private static final Logger log = Logger.getLogger(AbstractTXMDB.class);
+   
+   // this goes against spec, normally you would use BMT and UserTransaction
+   @Resource(mappedName="java:/TransactionManager")
+   private TransactionManager tm;
+   
+   protected void process(Message message)
+   {
+      try
+      {
+         Destination destination = message.getJMSReplyTo();
+         
+         try
+         {
+            int status = tm.getStatus();
+            
+            log.info("Transaction status for " + this + " is " + status);
+            
+            sendReply(destination, status);
+         }
+         catch(SystemException e)
+         {
+            log.warn("Transaction status for " + this + " failed", e);
+            sendReply(destination, e);
+         }
+      }
+      catch(JMSException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java	2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668;
-
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.MessageDriven;
-import javax.jms.Message;
-
-/**
- * Reply the tx status when using default settings.
- * 
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at MessageDriven(activationConfig = {
-      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
-      @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/jbpapp1668-default"),
-      @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "3") })
-public class TXDefaultMDB extends AbstractTXMDB
-{
-   public void onMessage(Message message)
-   {
-      process(message);
-   }
-}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java (from rev 89919, branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXDefaultMDB.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.jms.Message;
+
+/**
+ * Reply the tx status when using default settings.
+ * 
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at MessageDriven(activationConfig = {
+      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+      @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/jbpapp1668-default"),
+      @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "3") })
+public class TXDefaultMDB extends AbstractTXMDB
+{
+   public void onMessage(Message message)
+   {
+      process(message);
+   }
+}

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java	2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668;
-
-import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED;
-
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.MessageDriven;
-import javax.ejb.TransactionAttribute;
-import javax.jms.Message;
-
-/**
- * Reply the tx status when using NOT_SUPPORTED.
- * 
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at MessageDriven(activationConfig = {
-      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
-      @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/jbpapp1668-notx"),
-      @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "3") })
-public class TXNotSupportedMDB extends AbstractTXMDB
-{
-   @TransactionAttribute(NOT_SUPPORTED)
-   public void onMessage(Message message)
-   {
-      process(message);
-   }
-}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java (from rev 89919, branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/TXNotSupportedMDB.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668;
+
+import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.ejb.TransactionAttribute;
+import javax.jms.Message;
+
+/**
+ * Reply the tx status when using NOT_SUPPORTED.
+ * 
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at MessageDriven(activationConfig = {
+      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+      @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/jbpapp1668-notx"),
+      @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "3") })
+public class TXNotSupportedMDB extends AbstractTXMDB
+{
+   @TransactionAttribute(NOT_SUPPORTED)
+   public void onMessage(Message message)
+   {
+      process(message);
+   }
+}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit (from rev 89919, branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit)

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java	2009-06-05 19:42:05 UTC (rev 89919)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668.unit;
-
-import java.io.Serializable;
-
-import javax.jms.DeliveryMode;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.TemporaryQueue;
-import javax.jms.TextMessage;
-import javax.transaction.Status;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.common.EJB3TestCase;
-
-/**
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public class TXAttributeTestCase extends EJB3TestCase
-{
-   public TXAttributeTestCase(String name)
-   {
-      super(name);
-   }
-
-   public Object sendMessage(String queueName, String text) throws Exception
-   {
-      Queue queue = lookup("queue/" + queueName, Queue.class);
-      QueueConnectionFactory factory = getQueueConnectionFactory();
-      QueueConnection conn = factory.createQueueConnection();
-      try
-      {
-         QueueSession session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
-         TemporaryQueue replyQueue = session.createTemporaryQueue();
-         QueueReceiver receiver = session.createReceiver(replyQueue);
-         QueueSender sender = session.createSender(queue);
-         conn.start();
-         try
-         {
-            TextMessage msg = session.createTextMessage(text);
-            msg.setJMSReplyTo(replyQueue);
-            msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
-            msg.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 1);
-      
-            sender.send(msg);
-            
-            Message reply = receiver.receive(5000);
-            assertNotNull(reply);
-            
-            Serializable obj = ((ObjectMessage) reply).getObject();
-            if(obj instanceof Exception)
-               throw (Exception) obj;
-            else
-               return obj;
-         }
-         finally
-         {
-            conn.stop();
-            sender.close();
-            receiver.close();
-            session.close();
-         }
-      }
-      finally
-      {
-         conn.close();
-      }
-   }
-   
-   public void testDefault() throws Exception
-   {
-      Object result = sendMessage("jbpapp1668-default", "testDefault");
-      assertEquals("Wrong transaction status", Status.STATUS_ACTIVE, result);
-   }
-   
-   public void testNotSupported() throws Exception
-   {
-      Object result = sendMessage("jbpapp1668-notx", "testNotSupported");
-      assertEquals("Wrong transaction status", Status.STATUS_NO_TRANSACTION, result);
-   }
-   
-   public static Test suite() throws Exception
-   {
-      return getDeploySetup(TXAttributeTestCase.class, "jbpapp1668.jar");
-   }
-}

Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java (from rev 89919, branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp1668/unit/TXAttributeTestCase.java	2009-07-10 10:45:01 UTC (rev 91065)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp1668.unit;
+
+import java.io.Serializable;
+
+import javax.jms.DeliveryMode;
+import javax.jms.Message;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.TemporaryQueue;
+import javax.jms.TextMessage;
+import javax.transaction.Status;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.common.EJB3TestCase;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class TXAttributeTestCase extends EJB3TestCase
+{
+   public TXAttributeTestCase(String name)
+   {
+      super(name);
+   }
+
+   public Object sendMessage(String queueName, String text) throws Exception
+   {
+      Queue queue = lookup("queue/" + queueName, Queue.class);
+      QueueConnectionFactory factory = getQueueConnectionFactory();
+      QueueConnection conn = factory.createQueueConnection();
+      try
+      {
+         QueueSession session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         TemporaryQueue replyQueue = session.createTemporaryQueue();
+         QueueReceiver receiver = session.createReceiver(replyQueue);
+         QueueSender sender = session.createSender(queue);
+         conn.start();
+         try
+         {
+            TextMessage msg = session.createTextMessage(text);
+            msg.setJMSReplyTo(replyQueue);
+            msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
+            msg.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 1);
+      
+            sender.send(msg);
+            
+            Message reply = receiver.receive(5000);
+            assertNotNull(reply);
+            
+            Serializable obj = ((ObjectMessage) reply).getObject();
+            if(obj instanceof Exception)
+               throw (Exception) obj;
+            else
+               return obj;
+         }
+         finally
+         {
+            conn.stop();
+            sender.close();
+            receiver.close();
+            session.close();
+         }
+      }
+      finally
+      {
+         conn.close();
+      }
+   }
+   
+   public void testDefault() throws Exception
+   {
+      Object result = sendMessage("jbpapp1668-default", "testDefault");
+      assertEquals("Wrong transaction status", Status.STATUS_ACTIVE, result);
+   }
+   
+   public void testNotSupported() throws Exception
+   {
+      Object result = sendMessage("jbpapp1668-notx", "testNotSupported");
+      assertEquals("Wrong transaction status", Status.STATUS_NO_TRANSACTION, result);
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(TXAttributeTestCase.class, "jbpapp1668.jar");
+   }
+}




More information about the jboss-cvs-commits mailing list