Skip to content

Commit

Permalink
changing public repository in our pom
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed May 17, 2010
1 parent ad81660 commit cd54b0d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 15 deletions.
17 changes: 2 additions & 15 deletions pom.xml
Expand Up @@ -293,7 +293,7 @@ Copyright 2009 Red Hat, Inc.
</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>

Expand All @@ -309,7 +309,7 @@ Copyright 2009 Red Hat, Inc.
</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>
Expand All @@ -328,19 +328,6 @@ Copyright 2009 Red Hat, Inc.
</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</url>
</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>

Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -98,6 +100,55 @@ public void testOpenClose() throws Exception

}
}

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
{
Expand Down

0 comments on commit cd54b0d

Please sign in to comment.