activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r733803 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
Date Mon, 12 Jan 2009 15:44:48 GMT
Author: gtully
Date: Mon Jan 12 07:44:40 2009
New Revision: 733803

URL: http://svn.apache.org/viewvc?rev=733803&view=rev
Log:
resolve AMQ-2062 - add setExceptionListener to amq connection factory

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java?rev=733803&r1=733802&r2=733803&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
Mon Jan 12 07:44:40 2009
@@ -23,6 +23,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 
+import javax.jms.ExceptionListener;
 import javax.jms.JMSException;
 import javax.jms.Session;
 
@@ -157,6 +158,28 @@
         cf = (ActiveMQConnectionFactory)objectsIn.readObject();
         assertEquals(cf.getClientID(), clientID);
     }
+    
+    public void testSetExceptionListener() throws Exception {
+        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        connection = (ActiveMQConnection)cf.createConnection();
+        assertNull(connection.getExceptionListener());
+        
+        ExceptionListener exListener = new ExceptionListener() {
+			public void onException(JMSException arg0) {
+			}
+        };
+        cf.setExceptionListener(exListener);
+        
+        connection = (ActiveMQConnection)cf.createConnection();
+        assertNotNull(connection.getExceptionListener());
+        assertEquals(exListener, connection.getExceptionListener());
+        
+        connection = (ActiveMQConnection)cf.createConnection();
+        assertEquals(exListener, connection.getExceptionListener());
+        
+        assertEquals(exListener, cf.getExceptionListener());
+        
+    }
 
     protected void assertCreateConnection(String uri) throws Exception {
         // Start up a broker with a tcp connector.



Mime
View raw message