Search in sources :

Example 1 with RabbitMQStore

use of org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore in project wso2-synapse by wso2.

the class RabbitMQStoreTest method init.

@BeforeClass
public static void init() throws NoSuchFieldException {
    rabbitMQStore = new RabbitMQStore();
    // Accessing private variable using reflection
    connectionFactory = RabbitMQStore.class.getDeclaredField("connectionFactory");
    connectionFactory.setAccessible(true);
    // Setting parameters of the RabbitMQStore
    Map<String, Object> temp = new HashMap<>();
    temp.put(RabbitMQStore.USERNAME, USERNAME);
    temp.put(RabbitMQStore.PASSWORD, PASSWORD);
    temp.put(RabbitMQStore.HOST_NAME, HOST);
    temp.put(RabbitMQStore.HOST_PORT, PORT);
    temp.put(RabbitMQStore.VIRTUAL_HOST, VIRTUAL_HOST);
    temp.put(RabbitMQStore.QUEUE_NAME, QUEUE);
    rabbitMQStore.setParameters(temp);
    AxisConfiguration axisConfiguration = new AxisConfiguration();
    configurationContext = new ConfigurationContext(axisConfiguration);
    SynapseConfiguration synapseConfiguration = new SynapseConfiguration();
    Axis2SynapseEnvironment env = new Axis2SynapseEnvironment(configurationContext, synapseConfiguration);
    rabbitMQStore.init(env);
}
Also used : AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) ConfigurationContext(org.apache.axis2.context.ConfigurationContext) Axis2SynapseEnvironment(org.apache.synapse.core.axis2.Axis2SynapseEnvironment) HashMap(java.util.HashMap) RabbitMQStore(org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore) SynapseConfiguration(org.apache.synapse.config.SynapseConfiguration) BeforeClass(org.junit.BeforeClass)

Aggregations

HashMap (java.util.HashMap)1 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)1 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)1 SynapseConfiguration (org.apache.synapse.config.SynapseConfiguration)1 Axis2SynapseEnvironment (org.apache.synapse.core.axis2.Axis2SynapseEnvironment)1 RabbitMQStore (org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore)1 BeforeClass (org.junit.BeforeClass)1