[jboss-cvs] JBossAS SVN: r63408 - in branches/Branch_4_2/ejb3/src: test/org/jboss/ejb3/test/mdb and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 7 20:22:03 EDT 2007


Author: bdecoste
Date: 2007-06-07 20:22:03 -0400 (Thu, 07 Jun 2007)
New Revision: 63408

Added:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestInterface.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestMDB.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestInterface.java
Modified:
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb/MessageDrivenImpl.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java
Log:
[EJBTHREE-990] fix and test for merging messageListenerInterface from annotation and descriptor

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb/MessageDrivenImpl.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb/MessageDrivenImpl.java	2007-06-07 21:40:06 UTC (rev 63407)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb/MessageDrivenImpl.java	2007-06-08 00:22:03 UTC (rev 63408)
@@ -85,6 +85,10 @@
       
       if (desc.length() == 0)
          desc = annotation.description();
+       
+      Class messageListenerInterface = annotation.messageListenerInterface();
+      if (messageListenerInterface != null && !messageListenerInterface.getName().equals(Object.class.getName()))
+         listenerInterface = annotation.messageListenerInterface();
       
       for (ActivationConfigProperty property : annotation.activationConfig())
       {

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestInterface.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestInterface.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestInterface.java	2007-06-08 00:22:03 UTC (rev 63408)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.mdb;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface AbstractQueueTestInterface
+{
+   void dummy();
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestMDB.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestMDB.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/AbstractQueueTestMDB.java	2007-06-08 00:22:03 UTC (rev 63408)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.mdb;
+
+import javax.jms.MessageListener;
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public abstract class AbstractQueueTestMDB implements MessageListener, AbstractQueueTestInterface
+{
+   public void dummy()
+   {
+     
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestInterface.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestInterface.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestInterface.java	2007-06-08 00:22:03 UTC (rev 63408)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.mdb;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface QueueTestInterface
+{
+   void dummy1();
+}

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java	2007-06-07 21:40:06 UTC (rev 63407)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java	2007-06-08 00:22:03 UTC (rev 63408)
@@ -45,14 +45,17 @@
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
- at MessageDriven(activationConfig =
+ at MessageDriven(name="QueueMDB", messageListenerInterface=MessageListener.class,
+      activationConfig =
         {
         @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
         @ActivationConfigProperty(propertyName="destination", propertyValue="queue/mdbtest")
         })
 @RunAs("TestRole")
 @SecurityDomain("other")
-public class QueueTestMDB implements MessageListener
+public class QueueTestMDB
+extends AbstractQueueTestMDB
+implements MessageListener, QueueTestInterface
 {
    private static final Logger log = Logger.getLogger(QueueTestMDB.class);
    
@@ -109,4 +112,9 @@
    {
       TestStatusBean.preDestroy = true;
    }
+   
+   public void dummy1()
+   {
+      
+   }
 }

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java	2007-06-07 21:40:06 UTC (rev 63407)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java	2007-06-08 00:22:03 UTC (rev 63408)
@@ -49,7 +49,7 @@
       
       int size = 0;
 	      
-      ObjectName testerName = new ObjectName("jboss.j2ee:jar=mdb-test.jar,name=QueueTestMDB,service=EJB3");
+      ObjectName testerName = new ObjectName("jboss.j2ee:jar=mdb-test.jar,name=QueueMDB,service=EJB3");
       
       size = (Integer)server.getAttribute(testerName, "MinPoolSize");
       assertEquals(1, size);




More information about the jboss-cvs-commits mailing list