Author: borges
Date: 2011-09-19 11:31:38 -0400 (Mon, 19 Sep 2011)
New Revision: 11365
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteMessagesOnStartupTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/RestartSMTest.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java
Log:
delete constructor used only in tests
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java 2011-09-19
15:30:13 UTC (rev 11364)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java 2011-09-19
15:31:38 UTC (rev 11365)
@@ -54,9 +54,9 @@
import org.hornetq.utils.SimpleIDGenerator;
/**
- *
+ *
* A JournalImplTestBase
- *
+ *
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert
Suconic</a>
*
*/
@@ -131,11 +131,11 @@
Assert.assertFalse(iterNewFiles.hasNext());
}
-
+
// public void testRepeat() throws Exception
// {
// int i = 0 ;
-//
+//
// while (true)
// {
// System.out.println("#test (" + (i++) + ")");
@@ -1746,16 +1746,16 @@
final AtomicLong seqGenerator = new AtomicLong(1);
final ExecutorService executor = Executors.newCachedThreadPool();
-
+
OrderedExecutorFactory factory = new OrderedExecutorFactory(executor);
-
+
final ExecutorService deleteExecutor = Executors.newCachedThreadPool();
- final JournalStorageManager storage = new JournalStorageManager(config, factory);
+ final JournalStorageManager storage = new JournalStorageManager(config, factory,
null);
storage.start();
storage.loadInternalOnly();
-
+
((JournalImpl)storage.getMessageJournal()).setAutoReclaim(false);
final LinkedList<Long> survivingMsgs = new LinkedList<Long>();
@@ -1785,9 +1785,9 @@
storage.storeMessageTransactional(tx, message);
}
ServerMessageImpl message = new
ServerMessageImpl(seqGenerator.incrementAndGet(), 100);
-
+
survivingMsgs.add(message.getMessageID());
-
+
// This one will stay here forever
storage.storeMessage(message);
@@ -1874,9 +1874,9 @@
executor.shutdown();
assertTrue(executor.awaitTermination(10, TimeUnit.SECONDS));
-
+
deleteExecutor.shutdown();
-
+
assertTrue(deleteExecutor.awaitTermination(30, TimeUnit.SECONDS));
storage.stop();
@@ -1894,6 +1894,7 @@
file.mkdir();
}
+ @Override
protected void tearDown() throws Exception
{
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteMessagesOnStartupTest.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteMessagesOnStartupTest.java 2011-09-19
15:30:13 UTC (rev 11364)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/DeleteMessagesOnStartupTest.java 2011-09-19
15:31:38 UTC (rev 11365)
@@ -54,20 +54,20 @@
public void testDeleteMessagesOnStartup() throws Exception
{
createStorage();
-
+
Queue theQueue = new FakeQueue(new SimpleString(""));
HashMap<Long, Queue> queues = new HashMap<Long, Queue>();
queues.put(100l, theQueue);
-
+
ServerMessage msg = new ServerMessageImpl(1, 100);
-
+
journal.storeMessage(msg);
for (int i = 2; i < 100; i++)
{
journal.storeMessage(new ServerMessageImpl(i, 100));
}
-
+
journal.storeReference(100, 1, true);
journal.stop();
@@ -75,21 +75,23 @@
journal.start();
journal.loadBindingJournal(new ArrayList<QueueBindingInfo>(), new
ArrayList<GroupingInfo>());
-
+
journal.loadMessageJournal(new FakePostOffice(), null, null, queues, null, null);
assertEquals(98, deletedMessage.size());
-
+
for (Long messageID : deletedMessage)
{
assertTrue("messageID = " + messageID, messageID.longValue() >= 2
&& messageID <= 99);
}
}
+ @Override
protected JournalStorageManager createJournalStorageManager(Configuration
configuration)
{
- return new JournalStorageManager(configuration, execFactory)
+ return new JournalStorageManager(configuration, execFactory, null)
{
+ @Override
public void deleteMessage(final long messageID) throws Exception
{
System.out.println("message : " + messageID);
@@ -107,6 +109,6 @@
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
-
+
}
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/RestartSMTest.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/RestartSMTest.java 2011-09-19
15:30:13 UTC (rev 11364)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/RestartSMTest.java 2011-09-19
15:31:38 UTC (rev 11365)
@@ -27,7 +27,6 @@
import org.hornetq.core.persistence.QueueBindingInfo;
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.postoffice.PostOffice;
-import org.hornetq.core.server.JournalType;
import org.hornetq.core.server.Queue;
import org.hornetq.tests.unit.core.server.impl.fakes.FakePostOffice;
import org.hornetq.tests.util.ServiceTestBase;
@@ -38,7 +37,7 @@
* A DeleteMessagesRestartTest
*
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert
Suconic</a>
- *
+ *
* Created Mar 2, 2009 10:14:38 AM
*
*
@@ -88,7 +87,7 @@
PostOffice postOffice = new FakePostOffice();
- final JournalStorageManager journal = new JournalStorageManager(configuration,
execFactory);
+ final JournalStorageManager journal = new JournalStorageManager(configuration,
execFactory, null);
try
{
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java 2011-09-19
15:30:13 UTC (rev 11364)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/persistence/StorageManagerTestBase.java 2011-09-19
15:31:38 UTC (rev 11365)
@@ -49,9 +49,9 @@
protected ExecutorService executor;
protected ExecutorFactory execFactory;
-
+
protected JournalStorageManager journal;
-
+
protected JMSStorageManager jmsJournal;
@@ -72,7 +72,7 @@
execFactory = new OrderedExecutorFactory(executor);
File testdir = new File(getTestDir());
-
+
deleteDirectory(testdir);
}
@@ -80,7 +80,7 @@
protected void tearDown() throws Exception
{
executor.shutdown();
-
+
if (journal != null)
{
try
@@ -91,7 +91,7 @@
{
e.printStackTrace(); // >> junit report
}
-
+
journal = null;
}
@@ -105,13 +105,13 @@
{
e.printStackTrace(); // >> junit report
}
-
+
jmsJournal = null;
}
super.tearDown();
}
-
+
/**
* @return
* @throws Exception
@@ -125,7 +125,7 @@
journal.start();
journal.loadBindingJournal(new ArrayList<QueueBindingInfo>(), new
ArrayList<GroupingInfo>());
-
+
Map<Long, Queue> queues = new HashMap<Long, Queue>();
journal.loadMessageJournal(new FakePostOffice(), null, null, queues, null, null);
@@ -136,7 +136,7 @@
*/
protected JournalStorageManager createJournalStorageManager(Configuration
configuration)
{
- return new JournalStorageManager(configuration, execFactory);
+ return new JournalStorageManager(configuration, execFactory, null);
}
/**
@@ -150,7 +150,7 @@
jmsJournal = new JMSJournalStorageManagerImpl(new TimeAndCounterIDGenerator(),
configuration, null);
jmsJournal.start();
-
+
jmsJournal.load();
}
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-09-19
15:30:13 UTC (rev 11364)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-09-19
15:31:38 UTC (rev 11365)
@@ -397,7 +397,7 @@
*/
private JournalStorageManager getStorage()
{
- return new JournalStorageManager(createDefaultConfig(), factory);
+ return new JournalStorageManager(createDefaultConfig(), factory, null);
}
/**
Modified:
branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java 2011-09-19
15:30:13 UTC (rev 11364)
+++
branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java 2011-09-19
15:31:38 UTC (rev 11365)
@@ -95,7 +95,7 @@
ScheduledExecutorService scheduledThreadPool =
Executors.newScheduledThreadPool(ConfigurationImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE);
- journal = new JournalStorageManager(configuration, factory);
+ journal = new JournalStorageManager(configuration, factory, null);
journal.start();
journal.loadBindingJournal(new ArrayList<QueueBindingInfo>(), new
ArrayList<GroupingInfo>());
@@ -120,7 +120,7 @@
journal.stop();
- journal = new JournalStorageManager(configuration, factory);
+ journal = new JournalStorageManager(configuration, factory, null);
journal.start();
journal.loadBindingJournal(new ArrayList<QueueBindingInfo>(), new
ArrayList<GroupingInfo>());
@@ -149,7 +149,7 @@
mapDups.clear();
- journal = new JournalStorageManager(configuration, factory);
+ journal = new JournalStorageManager(configuration, factory, null);
journal.start();
journal.loadBindingJournal(new ArrayList<QueueBindingInfo>(), new
ArrayList<GroupingInfo>());