[jboss-cvs] JBoss Messaging SVN: r8010 - in branches/Branch_1_4: tests/src/org/jboss/test/messaging/jms and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 22 07:47:54 EDT 2010


Author: gaohoward
Date: 2010-04-22 07:47:53 -0400 (Thu, 22 Apr 2010)
New Revision: 8010

Modified:
   branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/TopicTest.java
Log:
JBMESSAGING-1801


Modified: branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2010-04-22 04:02:01 UTC (rev 8009)
+++ branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2010-04-22 11:47:53 UTC (rev 8010)
@@ -35,6 +35,7 @@
 import org.jboss.jms.server.selector.Selector;
 import org.jboss.jms.wireformat.Dispatcher;
 import org.jboss.logging.Logger;
+import org.jboss.messaging.core.contract.Binding;
 import org.jboss.messaging.core.contract.Delivery;
 import org.jboss.messaging.core.contract.DeliveryObserver;
 import org.jboss.messaging.core.contract.Message;
@@ -539,8 +540,13 @@
                   
          ServerPeer sp = sessionEndpoint.getConnectionEndpoint().getServerPeer();
          
-         Queue queue = postOffice.getBindingForQueueName(queueName).queue;        
+         Binding binding = postOffice.getBindingForQueueName(queueName);
          
+         //https://jira.jboss.org/jira/browse/JBMESSAGING-1801
+         if (binding == null) return;
+         
+         Queue queue = binding.queue;        
+         
          ManagedDestination mDest = sp.getDestinationManager().getDestination(destination.getName(), false);
          
          if (!queue.isRecoverable())

Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/TopicTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/TopicTest.java	2010-04-22 04:02:01 UTC (rev 8009)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/TopicTest.java	2010-04-22 11:47:53 UTC (rev 8010)
@@ -21,6 +21,8 @@
   */
 package org.jboss.test.messaging.jms;
 
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
 import java.io.Serializable;
 
 import javax.jms.Connection;
@@ -34,6 +36,8 @@
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 
+import org.jboss.test.messaging.tools.ServerManagement;
+
 /**
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
  * @version <tt>$Revision$</tt>
@@ -158,6 +162,43 @@
       }
    }
 
+   //https://jira.jboss.org/jira/browse/JBMESSAGING-1801
+   //Note: This test need manual examination in the console log!
+   //reason: The NullPointerException occurs at consumer.close().
+   //At the server side stack trace will be printed out but 
+   //at the client side the interceptor just swallows the exception!
+   //so there is no exception occurring at client side, making 
+   //this test appear to be passed.
+   public void testTopicNonDurableSubShutdown() throws Exception
+   {
+      Connection conn = null;
+      
+      try
+      {
+         ServerManagement.deployTopic("Topic2010Apr22");
+         Topic theTopic = (Topic)ic.lookup("/topic/Topic2010Apr22");
+         conn = cf.createConnection();
+
+         Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer consumer = s.createConsumer(theTopic);
+         
+         ServerManagement.undeployTopic("Topic2010Apr22");
+         
+         ByteArrayOutputStream bstream = new ByteArrayOutputStream();
+         
+         System.setErr(new PrintStream(bstream));
+
+         consumer.close();
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
+
    // Package protected ---------------------------------------------
    
    // Protected -----------------------------------------------------




More information about the jboss-cvs-commits mailing list