[jboss-cvs] JBoss Messaging SVN: r8088 - in branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801: src/main/org/jboss/jms/server/endpoint and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 30 11:40:14 EDT 2010


Author: jbertram at redhat.com
Date: 2010-09-30 11:40:13 -0400 (Thu, 30 Sep 2010)
New Revision: 8088

Modified:
   branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/.classpath
   branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/tests/src/org/jboss/test/messaging/jms/TopicTest.java
Log:
JBPAPP-5177

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/.classpath
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/.classpath	2010-09-30 14:16:14 UTC (rev 8087)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/.classpath	2010-09-30 15:40:13 UTC (rev 8088)
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="docs/examples/queue-failover/src"/>
-	<classpathentry kind="src" path="integration/EAP4/src"/>
+	<classpathentry kind="src" path="jgroups-src"/>
+	<classpathentry kind="src" path="integration/EAP4/src/main"/>
 	<classpathentry kind="src" path="integration/EAP4/tests-src"/>
 	<classpathentry kind="src" path="docs/examples/bridge/src"/>
 	<classpathentry kind="src" path="docs/examples/stateless-clustered/src"/>

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2010-09-30 14:16:14 UTC (rev 8087)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2010-09-30 15:40:13 UTC (rev 8088)
@@ -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_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/tests/src/org/jboss/test/messaging/jms/TopicTest.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/tests/src/org/jboss/test/messaging/jms/TopicTest.java	2010-09-30 14:16:14 UTC (rev 8087)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP10_JBMESSAGING-1801/tests/src/org/jboss/test/messaging/jms/TopicTest.java	2010-09-30 15:40:13 UTC (rev 8088)
@@ -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