// Path: test-automation-framework/org.wso2.carbon.automation.engine/src/main/java/org/wso2/carbon/automation/engine/exceptions/AutomationFrameworkException.java
// public class AutomationFrameworkException extends Exception {
//     public AutomationFrameworkException(String message) {
//         super(message);
//     }
// 
//     public AutomationFrameworkException(String message, Throwable e) {
//         super(message, e);
//     }
// 
//     public AutomationFrameworkException(Throwable e) {
//         super(e);
//     }
// }


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
import org.wso2.carbon.automation.extensions.servers.jmsserver.controller.config.JMSBrokerConfiguration;
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
    public void stopConsuming() {
        if (consumer != null) {
            try {
                consumer.close();
            } catch (JMSException e) {
                //ignore
            }
        }
        if (session != null) {
            try {
                session.close();
            } catch (JMSException e) {
                //ignore
            }
        }
        if (connection != null) {
            try {
                connection.close();
            } catch (JMSException e) {
                //ignore
            }
        }
    }

    /**
     * this will returns all the message received  from the topic after the subscription
     *
     * @return
     * @throws AutomationFrameworkException
     */
// Path: test-automation-framework/org.wso2.carbon.automation.engine/src/main/java/org/wso2/carbon/automation/engine/exceptions/AutomationFrameworkException.java
// public class AutomationFrameworkException extends Exception {
//     public AutomationFrameworkException(String message) {
//         super(message);
//     }
// 
//     public AutomationFrameworkException(String message, Throwable e) {
//         super(message, e);
//     }
// 
//     public AutomationFrameworkException(Throwable e) {
//         super(e);
//     }
// }


// Path: test-automation-framework/org.wso2.carbon.automation.extensions/src/main/java/org/wso2/carbon/automation/extensions/servers/jmsserver/client/JMSTopicMessageConsumer.java
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
import org.wso2.carbon.automation.extensions.servers.jmsserver.controller.config.JMSBrokerConfiguration;
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

    public void stopConsuming() {
        if (consumer != null) {
            try {
                consumer.close();
            } catch (JMSException e) {
                //ignore
            }
        }
        if (session != null) {
            try {
                session.close();
            } catch (JMSException e) {
                //ignore
            }
        }
        if (connection != null) {
            try {
                connection.close();
            } catch (JMSException e) {
                //ignore
            }
        }
    }

    /**
     * this will returns all the message received  from the topic after the subscription
     *
     * @return
     * @throws AutomationFrameworkException
     */
    public List<String> getMessages() throws AutomationFrameworkException {