All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.as.test.jms.auxiliary.CreateTopicSetupTask Maven / Gradle / Ivy

There is a newer version: 35.0.0.Beta1
Show newest version
package org.jboss.as.test.jms.auxiliary;

import org.jboss.as.arquillian.api.ServerSetupTask;
import org.jboss.as.arquillian.container.ManagementClient;
import org.jboss.as.test.integration.common.jms.JMSOperations;
import org.jboss.as.test.integration.common.jms.JMSOperationsProvider;

/**
 * Author: jmartisk
 * Date: 2/27/12
 * Time: 9:06 AM
 */
public class CreateTopicSetupTask implements ServerSetupTask {

    public static final String TOPIC_NAME = "myAwesomeTopic";
    public static final String TOPIC_JNDI_NAME = "topic/myAwesomeTopic";


    private JMSOperations adminOperations;

    @Override
    public void setup(ManagementClient managementClient, String containerId) throws Exception {
        adminOperations = JMSOperationsProvider.getInstance(managementClient);
        adminOperations.createJmsTopic(TOPIC_NAME, TOPIC_JNDI_NAME);
    }

    @Override
    public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
        if (adminOperations != null) {
            adminOperations.removeJmsTopic(TOPIC_NAME);
            adminOperations.close();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy