Author: borges
Date: 2011-11-04 05:12:29 -0400 (Fri, 04 Nov 2011)
New Revision: 11656
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java
Log:
clean up
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-03
13:42:42 UTC (rev 11655)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-04
09:12:29 UTC (rev 11656)
@@ -1783,9 +1783,9 @@
// Inner classes
// --------------------------------------------------------------------------------
- class FailbackChecker implements Runnable
+ private class FailbackChecker implements Runnable
{
- boolean restarting = false;
+ private boolean restarting = false;
public void run()
{
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java 2011-11-03
13:42:42 UTC (rev 11655)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java 2011-11-04
09:12:29 UTC (rev 11656)
@@ -79,6 +79,7 @@
public class PagingTest extends ServiceTestBase
{
private ServerLocator locator;
+ static final int MESSAGE_SIZE = 1024; // 1k
public PagingTest(final String name)
{
@@ -119,8 +120,7 @@
@Override
protected void tearDown() throws Exception
{
- locator.close();
-
+ closeServerLocator(locator);
super.tearDown();
}
@@ -140,8 +140,6 @@
server.start();
- final int messageSize = 1024;
-
final int numberOfMessages = 5000;
final int numberOfTX = 10;
@@ -166,11 +164,11 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
ByteBuffer bb = ByteBuffer.wrap(body);
- for (int j = 1; j <= messageSize; j++)
+ for (int j = 1; j <= MESSAGE_SIZE; j++)
{
bb.put(getSamplebyte(j));
}
@@ -373,8 +371,8 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 1000;
try
@@ -395,11 +393,11 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
ByteBuffer bb = ByteBuffer.wrap(body);
- for (int j = 1; j <= messageSize; j++)
+ for (int j = 1; j <= MESSAGE_SIZE; j++)
{
bb.put(getSamplebyte(j));
}
@@ -520,8 +518,8 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 1000;
try
@@ -542,11 +540,11 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
ByteBuffer bb = ByteBuffer.wrap(body);
- for (int j = 1; j <= messageSize; j++)
+ for (int j = 1; j <= MESSAGE_SIZE; j++)
{
bb.put(getSamplebyte(j));
}
@@ -591,16 +589,12 @@
assertEquals(numberOfMessages, queue.getMessageCount());
- LinkedList<Xid> xids = new LinkedList<Xid>();
-
- int msgReceived = 0;
ClientSession sessionConsumer = sf.createSession(false, false, false);
sessionConsumer.start();
ClientConsumer consumer = sessionConsumer.createConsumer(PagingTest.ADDRESS);
for (int msgCount = 0; msgCount < numberOfMessages; msgCount++)
{
log.info("Received " + msgCount);
- msgReceived++;
ClientMessage msg = consumer.receiveImmediate();
if (msg == null)
{
@@ -697,16 +691,12 @@
// assertEquals(numberOfMessages, queue.getMessageCount());
- xids = new LinkedList<Xid>();
-
- msgReceived = 0;
sessionConsumer = sf.createSession(false, false, false);
sessionConsumer.start();
consumer = sessionConsumer.createConsumer(PagingTest.ADDRESS);
for (int msgCount = 0; msgCount < numberOfMessages; msgCount++)
{
log.info("Received " + msgCount);
- msgReceived++;
ClientMessage msg = consumer.receiveImmediate();
if (msg == null)
{
@@ -758,8 +748,8 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 5000;
final int numberOfTX = 10;
@@ -786,11 +776,11 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
ByteBuffer bb = ByteBuffer.wrap(body);
- for (int j = 1; j <= messageSize; j++)
+ for (int j = 1; j <= MESSAGE_SIZE; j++)
{
bb.put(getSamplebyte(j));
}
@@ -940,8 +930,8 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 6;
final int numberOfTX = 2;
@@ -970,11 +960,11 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
ByteBuffer bb = ByteBuffer.wrap(body);
- for (int j = 1; j <= messageSize; j++)
+ for (int j = 1; j <= MESSAGE_SIZE; j++)
{
bb.put(getSamplebyte(j));
}
@@ -1104,8 +1094,8 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 1000;
try
@@ -1130,7 +1120,7 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
for (int i = 0; i < numberOfMessages; i++)
{
@@ -1264,15 +1254,15 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 3000;
- final byte[] body = new byte[messageSize];
+ final byte[] body = new byte[MESSAGE_SIZE];
ByteBuffer bb = ByteBuffer.wrap(body);
- for (int j = 1; j <= messageSize; j++)
+ for (int j = 1; j <= MESSAGE_SIZE; j++)
{
bb.put(getSamplebyte(j));
}
@@ -1540,15 +1530,15 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 3000;
- final byte[] body = new byte[messageSize];
+ final byte[] body = new byte[MESSAGE_SIZE];
ByteBuffer bb = ByteBuffer.wrap(body);
- for (int j = 1; j <= messageSize; j++)
+ for (int j = 1; j <= MESSAGE_SIZE; j++)
{
bb.put(getSamplebyte(j));
}
@@ -1873,8 +1863,6 @@
server.start();
- final int messageSize = 1024; // 1k
-
try
{
ServerLocator locator = createInVMNonHALocator();
@@ -1890,7 +1878,7 @@
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
// HornetQBuffer bodyLocal = HornetQChannelBuffers.buffer(DataConstants.SIZE_INT
* numberOfIntegers);
ClientMessage message = null;
@@ -2017,8 +2005,8 @@
server.start();
- final int messageSize = 1024; // 1k
+
try
{
ServerLocator locator = createInVMNonHALocator();
@@ -2028,7 +2016,7 @@
ClientSessionFactory sf = locator.createSessionFactory();
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
ClientSession sessionTransacted = sf.createSession(null, null, false, false,
false, false, 0);
ClientProducer producerTransacted =
sessionTransacted.createProducer(PagingTest.ADDRESS);
@@ -2167,8 +2155,8 @@
server.start();
- final int messageSize = 1024; // 1k
+
try
{
ServerLocator locator = createInVMNonHALocator();
@@ -2178,7 +2166,7 @@
ClientSessionFactory sf = locator.createSessionFactory();
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
ClientSession sessionTransacted = sf.createSession(null, null, false, false,
false, false, 0);
ClientProducer producerTransacted =
sessionTransacted.createProducer(PagingTest.ADDRESS);
@@ -2302,7 +2290,7 @@
final AtomicInteger errors = new AtomicInteger(0);
- final int messageSize = 1024; // 1k
+
final int numberOfMessages = 10000;
ServerLocator locator = createInVMNonHALocator();
@@ -2316,7 +2304,7 @@
final ClientSessionFactory sf = locator.createSessionFactory();
- final byte[] body = new byte[messageSize];
+ final byte[] body = new byte[MESSAGE_SIZE];
Thread producerThread = new Thread()
{
@@ -2433,7 +2421,7 @@
final AtomicInteger errors = new AtomicInteger(0);
- final int messageSize = 1024;
+
final int numberOfMessages = 2000;
try
@@ -2445,7 +2433,7 @@
final CountDownLatch ready = new CountDownLatch(1);
- final byte[] body = new byte[messageSize];
+ final byte[] body = new byte[MESSAGE_SIZE];
Thread producerThread = new Thread()
{
@@ -3945,8 +3933,8 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 200;
try
@@ -3980,7 +3968,7 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
for (int i = 0; i < numberOfMessages; i++)
{
@@ -4070,8 +4058,8 @@
server.start();
- final int messageSize = 1024;
+
final int numberOfMessages = 1000;
try
@@ -4097,7 +4085,7 @@
ClientMessage message = null;
- byte[] body = new byte[messageSize];
+ byte[] body = new byte[MESSAGE_SIZE];
for (int i = 0; i < numberOfMessages; i++)
{
@@ -4193,8 +4181,8 @@
server.start();
- final int messageSize = 1024;
+
ServerLocator locator = null;
ClientSessionFactory sf = null;
ClientSession session = null;
@@ -4227,7 +4215,7 @@
message.putStringProperty("id", "str" + i);
- message.setBodyInputStream(createFakeLargeStream(messageSize));
+ message.setBodyInputStream(createFakeLargeStream(MESSAGE_SIZE));
producer.send(message);
@@ -4255,7 +4243,7 @@
assertEquals("str" + msgNr,
msg.getStringProperty("id"));
- for (int j = 0; j < messageSize; j++)
+ for (int j = 0; j < MESSAGE_SIZE; j++)
{
assertEquals(getSamplebyte(j), msg.getBodyBuffer().readByte());
}
@@ -4370,7 +4358,7 @@
assertEquals("str" + msgNr,
msg.getStringProperty("id"));
- for (int i = 0; i < messageSize; i++)
+ for (int i = 0; i < MESSAGE_SIZE; i++)
{
assertEquals(getSamplebyte(i), msg.getBodyBuffer().readByte());
}