Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 68283 invoked from network); 12 Jan 2009 15:45:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jan 2009 15:45:13 -0000 Received: (qmail 97943 invoked by uid 500); 12 Jan 2009 15:45:13 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 97924 invoked by uid 500); 12 Jan 2009 15:45:13 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 97915 invoked by uid 99); 12 Jan 2009 15:45:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jan 2009 07:45:13 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jan 2009 15:45:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6184D23888A5; Mon, 12 Jan 2009 07:44:52 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r733803 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java Date: Mon, 12 Jan 2009 15:44:48 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090112154452.6184D23888A5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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.