activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r763947 - /activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java
Date Fri, 10 Apr 2009 14:32:22 GMT
Author: gtully
Date: Fri Apr 10 14:32:21 2009
New Revision: 763947

URL: http://svn.apache.org/viewvc?rev=763947&view=rev
Log:
add verifier test for set/get exception listener on pooled connection

Modified:
    activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java

Modified: activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java?rev=763947&r1=763946&r2=763947&view=diff
==============================================================================
--- activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java
(original)
+++ activemq/trunk/activemq-pool/src/test/java/org/apache/activemq/pool/PooledTopicPublisherTest.java
Fri Apr 10 14:32:21 2009
@@ -16,15 +16,16 @@
  */
 package org.apache.activemq.pool;
 
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
 import javax.jms.Session;
 import javax.jms.TopicConnection;
 import javax.jms.TopicPublisher;
 import javax.jms.TopicSession;
 
-import junit.framework.TestCase;
 import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.test.TestSupport;
 import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.test.TestSupport;
 
 /**
  * @version $Revision$
@@ -44,6 +45,20 @@
         publisher.publish(session.createMessage());
     }
 
+    
+    public void testSetGetExceptionListener() throws Exception {
+        PooledConnectionFactory pcf = new PooledConnectionFactory();
+        pcf.setConnectionFactory(new ActiveMQConnectionFactory("vm://test"));
+
+        connection = (TopicConnection) pcf.createConnection();
+        ExceptionListener listener = new ExceptionListener() {
+            public void onException(JMSException exception) {
+            }
+        };
+        connection.setExceptionListener(listener);
+        assertEquals(listener, connection.getExceptionListener());
+    }
+    
     @Override
     protected void tearDown() throws Exception {
         if (connection != null) {



Mime
View raw message