ARTEMIS-3776 just my OCD applying aesthetic tweaks to recediveOW.groovy

This commit is contained in:
Clebert Suconic 2022-04-13 12:34:30 -04:00
parent bc17acd6da
commit ccfd4b7a62
2 changed files with 19 additions and 19 deletions

View File

@ -18,29 +18,29 @@
import org.apache.activemq.artemis.tests.compatibility.GroovyRun
import javax.jms.Connection
import javax.jms.MessageConsumer
import java.util.Date;
import java.util.UUID;
import javax.jms.ConnectionFactory;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import org.apache.activemq.ActiveMQConnectionFactory;
{
final ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("failover:(tcp://localhost:61616)");
connection = cf.createConnection();
try {
final ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("failover:(tcp://localhost:61616)");
connection = cf.createConnection();
final int numberOfMessages = Integer.parseInt(arg[0])
final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
final Queue queue = session.createQueue("Test");
final MessageConsumer consumer = session.createConsumer(queue)
connection.start();
final int numberOfMessages = Integer.parseInt(arg[0])
final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
final Queue queue = session.createQueue("Test");
final MessageConsumer consumer = session.createConsumer(queue)
connection.start();
for (int i = 0; i < numberOfMessages; i++) {
final TextMessage tm = (TextMessage)consumer.receive(1000);
GroovyRun.assertNotNull(tm)
GroovyRun.assertEquals("m" + i, tm.getText());
}
connection.close();
for (int i = 0; i < numberOfMessages; i++) {
final TextMessage tm = (TextMessage) consumer.receive(1000);
GroovyRun.assertNotNull(tm)
GroovyRun.assertEquals("m" + i, tm.getText());
}
} finally {
connection.close();
}
}

View File

@ -50,4 +50,4 @@ import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
finally {
if (c != null) c.close();
}
}
}