/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq.pool;

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;

/**
 * @version $Revision$
 */
public class PooledTopicPublisherTest extends TestSupport {

    private TopicConnection connection;

    public void testPooledConnectionFactory() throws Exception {
        ActiveMQTopic topic = new ActiveMQTopic("test");
        PooledConnectionFactory pcf = new PooledConnectionFactory();
        pcf.setConnectionFactory(new ActiveMQConnectionFactory("vm://test"));

        connection = (TopicConnection) pcf.createConnection();
        TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicPublisher publisher = session.createPublisher(topic);
        publisher.publish(session.createMessage());
    }

    @Override
    protected void tearDown() throws Exception {
        if (connection != null) {
            connection.close();
            connection = null;
        }
    }
}

@@ -832,16 +832,83 @@
 .pool;%0A%0A
+import javax.jms.ExceptionListener;%0Aimport javax.jms.JMSException;%0A
 import j
@@ -1028,41 +1028,8 @@
 n;%0A%0A
-import junit.framework.TestCase;%0A
 impo
@@ -1109,24 +1109,29 @@
 emq.
-test.TestSupport
+command.ActiveMQTopic
 ;%0Aim
@@ -1155,37 +1155,32 @@
 ctivemq.
-command.ActiveMQTopic
+test.TestSupport
 ;%0A%0A/**%0A 
@@ -1861,16 +1861,576 @@
 %0A    %7D%0A%0A
+    %0A    public void testSetGetExceptionListener() throws Exception %7B%0A        PooledConnectionFactory pcf = new PooledConnectionFactory();%0A        pcf.setConnectionFactory(new ActiveMQConnectionFactory(%22vm://test%22));%0A%0A        connection = (TopicConnection) pcf.createConnection();%0A        ExceptionListener listener = new ExceptionListener() %7B%0A            public void onException(JMSException exception) %7B%0A            %7D%0A        %7D;%0A        connection.setExceptionListener(listener);%0A        assertEquals(listener, connection.getExceptionListener());%0A    %7D%0A    %0A
     @Ove

add verifier test for set/get exception listener on pooled connection