sendUsing(_local, 5, 100);
sendUsing(_local, 5, 100);
sendUsing(_local, 5, 100);
Thread.sleep(2000);
ManagedBroker test = _jmxUtils.getManagedBroker("test");
ManagedBroker dev = _jmxUtils.getManagedBroker("development");
ManagedBroker local = _jmxUtils.getManagedBroker("localhost");
if (!isBroker010())
{
long total = 0;
long data = 0;
for (ManagedConnection mc : _jmxUtils.getAllManagedConnections())
{
total += mc.getTotalMessagesReceived();
data += mc.getTotalDataReceived();
}
assertEquals("Incorrect connection total", 45, total);
assertEquals("Incorrect connection data", 4500, data);
}
assertEquals("Incorrect server total", 45, _jmxUtils.getServerInformation().getTotalMessagesReceived());
assertEquals("Incorrect server data", 4500, _jmxUtils.getServerInformation().getTotalDataReceived());
if (!isBroker010())
{
long testTotal = 0;
long testData = 0;
for (ManagedConnection mc : _jmxUtils.getManagedConnections("test"))
{
testTotal += mc.getTotalMessagesReceived();
testData += mc.getTotalDataReceived();
}
assertEquals("Incorrect test connection total", 10, testTotal);
assertEquals("Incorrect test connection data", 1000, testData);
}
assertEquals("Incorrect test vhost total", 10, test.getTotalMessagesReceived());
assertEquals("Incorrect test vhost data", 1000, test.getTotalDataReceived());
if (!isBroker010())
{
long devTotal = 0;
long devData = 0;
for (ManagedConnection mc : _jmxUtils.getManagedConnections("development"))
{
devTotal += mc.getTotalMessagesReceived();
devData += mc.getTotalDataReceived();
}
assertEquals("Incorrect test connection total", 20, devTotal);
assertEquals("Incorrect test connection data", 2000, devData);
}
assertEquals("Incorrect development total", 20, dev.getTotalMessagesReceived());
assertEquals("Incorrect development data", 2000, dev.getTotalDataReceived());
if (!isBroker010())
{
long localTotal = 0;
long localData = 0;
for (ManagedConnection mc : _jmxUtils.getManagedConnections("localhost"))
{
localTotal += mc.getTotalMessagesReceived();
localData += mc.getTotalDataReceived();
}
assertEquals("Incorrect test connection total", 15, localTotal);
assertEquals("Incorrect test connection data", 1500, localData);
}
assertEquals("Incorrect localhost total", 15, local.getTotalMessagesReceived());
assertEquals("Incorrect localhost data", 1500, local.getTotalDataReceived());
}