mirror of https://github.com/apache/activemq.git
add verifier test for set/get exception listener on pooled connection
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@763947 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
97ed8c0283
commit
bcbb1ec1de
|
@ -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 @@ public class PooledTopicPublisherTest extends TestSupport {
|
|||
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) {
|
||||
|
|
Loading…
Reference in New Issue