[jboss-cvs] JBoss Messaging SVN: r6938 - trunk/tests/src/org/jboss/messaging/tests/unit/core/asyncio.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed May 20 11:21:42 EDT 2009
Author: clebert.suconic at jboss.com
Date: 2009-05-20 11:21:42 -0400 (Wed, 20 May 2009)
New Revision: 6938
Modified:
trunk/tests/src/org/jboss/messaging/tests/unit/core/asyncio/AsynchronousFileTest.java
Log:
Speeding up test
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/asyncio/AsynchronousFileTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/asyncio/AsynchronousFileTest.java 2009-05-20 15:12:00 UTC (rev 6937)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/asyncio/AsynchronousFileTest.java 2009-05-20 15:21:42 UTC (rev 6938)
@@ -543,7 +543,7 @@
try
{
- final int NUMBER_LINES = 10000;
+ final int NUMBER_LINES = 1000;
final int SIZE = 1024;
controller.open(FILE_NAME, 1000);
@@ -556,7 +556,7 @@
for (int i = 0; i < NUMBER_LINES; i++)
{
- if (i % 1000 == 0)
+ if (i % 100 == 0)
{
System.out.println("Wrote " + i + " lines");
}
@@ -583,11 +583,9 @@
readBuffer = AsynchronousFileImpl.newBuffer(SIZE);
- Thread t = null;
-
for (int i = 0; i < NUMBER_LINES; i++)
{
- if (i % 1000 == 0)
+ if (i % 100 == 0)
{
System.out.println("Read " + i + " lines");
}
@@ -598,34 +596,6 @@
controller.read(i * SIZE, SIZE, readBuffer, aio);
- // at the first 20 lines, we will force a lot of garbage, to make sure the pointers are well isolated from Garbage Collection
- if (i < 20)
- {
- if (t != null)
- {
- t.join();
- }
-
- t = new Thread()
- {
- public void run()
- {
- // Force a lot of garbage during reading, to make sure the memory read is well isolated from
- // garbage collection
- WeakReference<Object> garbage = new WeakReference<Object>(new Object());
- // Stays in loop until GC kicks in to clean up this reference
- while (garbage.get() != null)
- {
- @SuppressWarnings("unused")
- byte[] garbage2 = new byte[10 * 1024 * 1024]; // More Garbage
- }
-
- }
- };
-
- t.start();
- }
-
latch.await();
assertFalse(aio.errorCalled);
assertTrue(aio.doneCalled);
More information about the jboss-cvs-commits
mailing list