Permalink
Browse files

Fixed TransactionHealthTest

  • Loading branch information...
1 parent fd2e308 commit 86b493a8ece3068a3d05a318b06e62efd2a96966 @purplefox purplefox committed Dec 6, 2009
Showing with 13 additions and 8 deletions.
  1. +13 −8 tests/src/org/hornetq/tests/integration/journal/ValidateTransactionHealthTest.java
@@ -20,13 +20,15 @@
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
import org.hornetq.core.config.impl.ConfigurationImpl;
+import org.hornetq.core.journal.Journal;
import org.hornetq.core.journal.LoaderCallback;
import org.hornetq.core.journal.PreparedTransactionInfo;
import org.hornetq.core.journal.RecordInfo;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
import org.hornetq.core.journal.impl.JournalImpl;
import org.hornetq.core.journal.impl.NIOSequentialFileFactory;
+import org.hornetq.core.logging.Logger;
import org.hornetq.tests.util.SpawnedVMSupport;
import org.hornetq.tests.util.UnitTestCase;
@@ -42,6 +44,9 @@
// Constants -----------------------------------------------------
+ private static final Logger log = Logger.getLogger(ValidateTransactionHealthTest.class);
+
+
// Attributes ----------------------------------------------------
private static final int OK = 10;
@@ -114,8 +119,6 @@ public void testNIO2NonTransactional() throws Exception
internalTest("nio2", getTestDir(), 10000, 0, true, true, 1);
}
-
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -297,7 +300,9 @@ public static void main(String args[]) throws Exception
try
{
- appendData(journalType, journalDir, numberOfElements, transactionSize, numberOfThreads);
+ Journal journal = appendData(journalType, journalDir, numberOfElements, transactionSize, numberOfThreads);
+
+ journal.stop();
}
catch (Exception e)
@@ -342,17 +347,17 @@ public void failedTransaction(long transactionID, List<RecordInfo> records, List
}
});
- LocalThreads threads[] = new LocalThreads[numberOfThreads];
+ LocalThread threads[] = new LocalThread[numberOfThreads];
final AtomicLong sequenceTransaction = new AtomicLong();
for (int i = 0; i < numberOfThreads; i++)
{
- threads[i] = new LocalThreads(journal, numberOfElements, transactionSize, sequenceTransaction);
+ threads[i] = new LocalThread(journal, numberOfElements, transactionSize, sequenceTransaction);
threads[i].start();
}
Exception e = null;
- for (LocalThreads t : threads)
+ for (LocalThread t : threads)
{
t.join();
@@ -403,7 +408,7 @@ public static SequentialFileFactory getFactory(String factoryType, String direct
}
}
- static class LocalThreads extends Thread
+ static class LocalThread extends Thread
{
final JournalImpl journal;
@@ -415,7 +420,7 @@ public static SequentialFileFactory getFactory(String factoryType, String direct
Exception e;
- public LocalThreads(JournalImpl journal, long numberOfElements, int transactionSize, AtomicLong nextID)
+ public LocalThread(JournalImpl journal, long numberOfElements, int transactionSize, AtomicLong nextID)
{
super();
this.journal = journal;

0 comments on commit 86b493a

Please sign in to comment.