Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void AAAA()
- {
- // stuff and things
- String m_host = "vcatpemd02";
- String m_component = "IFCC";
- String m_tag = "UNITTEST";
- int m_adminPort = 15672;
- int m_trafficPort = 5672;
- boolean connectionGood = false;
- String exchangeName = "testExchange";
- String queueName = "testQueue";
- String messageToSend = "This is the Message To send";
- String user = "admin";
- String password = "9DrSVKSLv6QR";
- try
- {
- RmqUtils theEnv = new RmqUtils(m_host, m_component, m_tag, m_adminPort, m_trafficPort);
- theEnv.createNewRmqEnv(true);
- // Create a user
- boolean thing = theEnv.createUser(false, user, password, ".*", ".*");
- System.out.println(thing);
- // Create a Exchange
- theEnv.makeExchange(exchangeName, RmqEnvironment.MSG_TYPE_DIRECT, true, true);
- //Create a Queue
- theEnv.makeQueue(queueName, true, true);
- // Bind Exchange to Queue
- theEnv.bindQueueToExchange(exchangeName, queueName, "routingKey");
- // Send Message
- theEnv.sendToExchange(exchangeName, messageToSend, user, password);
- // Get Message
- String messageReceived = theEnv.getFromQueue(queueName, user, password, 3000);
- // Compare message sent to message received
- if (messageReceived.equals(messageToSend))
- {
- connectionGood = true;
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- assertTrue(connectionGood);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement