[jboss-cvs] JBoss Messaging SVN: r5375 - in trunk: tests/src/org/jboss/messaging/tests/integration/asyncio and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Nov 17 16:28:16 EST 2008


Author: clebert.suconic at jboss.com
Date: 2008-11-17 16:28:16 -0500 (Mon, 17 Nov 2008)
New Revision: 5375

Modified:
   trunk/src/main/org/jboss/messaging/core/asyncio/impl/AsynchronousFileImpl.java
   trunk/tests/src/org/jboss/messaging/tests/integration/asyncio/SingleThreadWriteNativeTest.java
Log:
tweaks on AIO

Modified: trunk/src/main/org/jboss/messaging/core/asyncio/impl/AsynchronousFileImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/asyncio/impl/AsynchronousFileImpl.java	2008-11-17 19:05:11 UTC (rev 5374)
+++ trunk/src/main/org/jboss/messaging/core/asyncio/impl/AsynchronousFileImpl.java	2008-11-17 21:28:16 UTC (rev 5375)
@@ -157,10 +157,10 @@
          this.maxIO = maxIO;
          writeSemaphore = new Semaphore(this.maxIO);
 
+         this.fileName = fileName;
+         handler = init(fileName, this.maxIO, log);
          opened = true;
-         this.fileName = fileName;
          addMax(this.maxIO);
-         handler = init(fileName, this.maxIO, log);
       }
       finally
       {
@@ -193,7 +193,10 @@
          }
 
          closeInternal(handler);
-         addMax(maxIO * -1);
+         if (handler != 0)
+         {
+            addMax(maxIO * -1);
+         }
          opened = false;
          handler = 0;
       }

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/asyncio/SingleThreadWriteNativeTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/asyncio/SingleThreadWriteNativeTest.java	2008-11-17 19:05:11 UTC (rev 5374)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/asyncio/SingleThreadWriteNativeTest.java	2008-11-17 21:28:16 UTC (rev 5375)
@@ -98,7 +98,14 @@
          catch (Throwable ignored)
          {
          }
-         controller.close();
+         try
+         {
+            controller.close();
+            fail("Supposed to throw exception as the file wasn't opened");
+         }
+         catch (Throwable ignored)
+         {
+         }
 
       }
    }




More information about the jboss-cvs-commits mailing list