Author: clebert.suconic(a)jboss.com
Date: 2010-05-17 13:27:15 -0400 (Mon, 17 May 2010)
New Revision: 9240
Modified:
trunk/pom.xml
trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java
Log:
changing public repository in our pom
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-05-17 15:21:45 UTC (rev 9239)
+++ trunk/pom.xml 2010-05-17 17:27:15 UTC (rev 9240)
@@ -293,7 +293,7 @@
</releases>
<id>jboss.release</id>
<name>JBoss releases</name>
- <
url>http://repository.jboss.org/maven2</url>
+
<
url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
@@ -309,7 +309,7 @@
</releases>
<id>jboss.release</id>
<name>JBoss releases</name>
- <
url>http://repository.jboss.org/maven2</url>
+ <
url>https://repository.jboss.org/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
<!--<profiles>
@@ -328,19 +328,6 @@
</profiles>-->
- <distributionManagement>
- <repository>
- <id>repository.jboss.org</id>
- <
name>JBoss.org Release Distribution Repository</name>
-
<
url>dav:https://svn.jboss.org/repos/repository.jboss.org/maven2</ur...
- </repository>
- <snapshotRepository>
- <id>snapshots.jboss.org</id>
- <
name>JBoss.org Development Snapshot Repository</name>
- <
url>dav:https://snapshots.jboss.org/maven2</url>
- </snapshotRepository>
- </distributionManagement>
-
</project>
Modified: trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java 2010-05-17
15:21:45 UTC (rev 9239)
+++
trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java 2010-05-17
17:27:15 UTC (rev 9240)
@@ -13,6 +13,7 @@
package org.hornetq.tests.unit.core.asyncio;
+import java.lang.ref.WeakReference;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
@@ -22,6 +23,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import junit.framework.Assert;
@@ -98,7 +100,56 @@
}
}
+
+ public void testReleaseBuffers() throws Exception
+ {
+ AsynchronousFileImpl controller = new AsynchronousFileImpl(executor,
pollerExecutor);
+ controller.open(FILE_NAME, 10000);
+ WeakReference<ByteBuffer> bufferCheck = new
WeakReference<ByteBuffer>(controller.getHandler());
+ controller.fill(0, 10, 1024, (byte)0);
+
+ ByteBuffer write = AsynchronousFileImpl.newBuffer(1024);
+
+ for (int i = 0 ; i < 1024; i++)
+ {
+ write.put(getSamplebyte(i));
+ }
+ final CountDownLatch latch = new CountDownLatch(1);
+
+ controller.write(0, 1024, write, new AIOCallback()
+ {
+
+ public void onError(int errorCode, String errorMessage)
+ {
+ }
+
+ public void done()
+ {
+ latch.countDown();
+ }
+ });
+
+ assertTrue(latch.await(10, TimeUnit.SECONDS));
+
+ WeakReference<ByteBuffer> bufferCheck2 = new
WeakReference<ByteBuffer>(write);
+
+ AsynchronousFileImpl.destroyBuffer(write);
+
+ write = null;
+
+ forceGC();
+
+ assertNull(bufferCheck2.get());
+
+ controller.close();
+ controller = null;
+
+ forceGC();
+
+ assertNull(bufferCheck.get());
+ }
+
public void testFileNonExistent() throws Exception
{
final AsynchronousFileImpl controller = new AsynchronousFileImpl(executor,
pollerExecutor);