[jboss-cvs] JBoss Messaging SVN: r4648 - in trunk/tests/src/org/jboss/messaging/tests: integration/journal and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 7 11:31:06 EDT 2008


Author: clebert.suconic at jboss.com
Date: 2008-07-07 11:31:06 -0400 (Mon, 07 Jul 2008)
New Revision: 4648

Added:
   trunk/tests/src/org/jboss/messaging/tests/integration/journal/
   trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/
   trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/AIOSequentialFileFactoryTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/NIOSequentialFileFactoryTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealAIOJournalImplTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealNIOJournalImplTest.java
Removed:
   trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/AIOSequentialFileFactoryTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/NIOSequentialFileFactoryTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealAIOJournalImplTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealNIOJournalImplTest.java
Log:
Moving real file journal tests to integration

Copied: trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/AIOSequentialFileFactoryTest.java (from rev 4647, trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/AIOSequentialFileFactoryTest.java)
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/AIOSequentialFileFactoryTest.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/AIOSequentialFileFactoryTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+
+package org.jboss.messaging.tests.integration.journal.impl;
+
+import java.io.File;
+import java.nio.ByteBuffer;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.jboss.messaging.core.journal.IOCallback;
+import org.jboss.messaging.core.journal.SequentialFile;
+import org.jboss.messaging.core.journal.SequentialFileFactory;
+import org.jboss.messaging.core.journal.impl.AIOSequentialFileFactory;
+import org.jboss.messaging.tests.unit.core.journal.impl.SequentialFileFactoryTestBase;
+
+/**
+ * 
+ * A AIOSequentialFileFactoryTest
+ * 
+ * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
+ *
+ */
+public class AIOSequentialFileFactoryTest extends SequentialFileFactoryTestBase
+{
+
+   protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") + "/journal-test";
+   
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+
+      File file = new File(journalDir);
+      
+      deleteDirectory(file);
+      
+      file.mkdir();     
+   }
+
+   protected void tearDown() throws Exception
+   {
+      super.tearDown();
+
+      deleteDirectory(new File(journalDir));
+   }
+
+   protected SequentialFileFactory createFactory()
+   {
+      return new AIOSequentialFileFactory(journalDir);
+   }
+   
+   public void testBuffer() throws Exception
+   {
+      SequentialFile file = factory.createSequentialFile("filtetmp.log", 10, 120);
+      file.open();
+      ByteBuffer buff = factory.newBuffer(10);
+      assertEquals(512, buff.limit());
+      file.close();
+   }
+   
+   public void testBlockCallback() throws Exception
+   {
+      class BlockCallback implements IOCallback
+      {         
+         AtomicInteger countDone = new AtomicInteger(0);
+         AtomicInteger countError = new AtomicInteger(0);
+         CountDownLatch blockLatch;
+
+         BlockCallback()
+         {
+            this.blockLatch = new CountDownLatch(1);
+         }
+         
+         public void release()
+         {
+            blockLatch.countDown();
+         }
+         
+         public void done()
+         {            
+            try
+            {
+               blockLatch.await();
+            }
+            catch (InterruptedException e)
+            {
+               e.printStackTrace();
+            }
+
+            countDone.incrementAndGet();
+         }
+
+         public void onError(int errorCode, String errorMessage)
+         {
+            try
+            {
+               blockLatch.await();
+            }
+            catch (InterruptedException e)
+            {
+               e.printStackTrace();
+            }
+            
+            countError.incrementAndGet();
+         }
+      }
+      
+      BlockCallback callback = new BlockCallback();
+      
+      final int NUMBER_OF_RECORDS = 10000;
+      
+      SequentialFile file = factory.createSequentialFile("callbackBlock.log", 1000, 12000);
+      file.open();
+      file.fill(0, 512 * NUMBER_OF_RECORDS, (byte)'a');
+
+      
+      for (int i=0; i<NUMBER_OF_RECORDS; i++)
+      {
+         ByteBuffer buffer = factory.newBuffer(512);
+         
+         buffer.putInt(i + 10);
+         
+         for (int j=buffer.position(); j<buffer.limit(); j++)
+         {
+            buffer.put((byte)'b');
+         }
+         
+         file.write(buffer, callback);
+      }
+      
+      
+      callback.release();
+      file.close();
+      assertEquals(NUMBER_OF_RECORDS, callback.countDone.get());
+      assertEquals(0, callback.countError.get());
+      
+      file.open();
+      
+      ByteBuffer buffer = factory.newBuffer(512);
+
+      for (int i=0; i<NUMBER_OF_RECORDS; i++)
+      {
+         
+         file.read(buffer);
+         buffer.rewind();
+         
+         int recordRead = buffer.getInt();
+         
+         assertEquals(i + 10, recordRead);
+         
+         for (int j=buffer.position(); j<buffer.limit(); j++)
+         {
+            assertEquals((byte)'b', buffer.get());
+         }
+         
+       }
+      
+      
+      file.close();
+   }
+   
+
+}

Copied: trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/NIOSequentialFileFactoryTest.java (from rev 4647, trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/NIOSequentialFileFactoryTest.java)
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/NIOSequentialFileFactoryTest.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/NIOSequentialFileFactoryTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+
+package org.jboss.messaging.tests.integration.journal.impl;
+
+import java.io.File;
+
+import org.jboss.messaging.core.journal.SequentialFileFactory;
+import org.jboss.messaging.core.journal.impl.NIOSequentialFileFactory;
+import org.jboss.messaging.tests.unit.core.journal.impl.SequentialFileFactoryTestBase;
+
+/**
+ * 
+ * A NIOSequentialFileFactoryTest
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public class NIOSequentialFileFactoryTest extends SequentialFileFactoryTestBase
+{		
+	protected String journalDir = System.getProperty("user.home") + "/journal-test";
+		
+	protected void setUp() throws Exception
+	{
+		super.setUp();
+		
+		File file = new File(journalDir);
+		
+		deleteDirectory(file);
+		
+		file.mkdir();		
+	}
+
+	protected SequentialFileFactory createFactory()
+	{
+		return new NIOSequentialFileFactory(journalDir);
+	}
+
+}

Copied: trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealAIOJournalImplTest.java (from rev 4647, trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealAIOJournalImplTest.java)
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealAIOJournalImplTest.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealAIOJournalImplTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+
+package org.jboss.messaging.tests.integration.journal.impl;
+
+import java.io.File;
+
+import org.jboss.messaging.core.asyncio.impl.AsynchronousFileImpl;
+import org.jboss.messaging.core.journal.SequentialFileFactory;
+import org.jboss.messaging.core.journal.impl.AIOSequentialFileFactory;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.tests.unit.core.journal.impl.JournalImplTestUnit;
+
+/**
+ * 
+ * A RealJournalImplTest
+ * you need to define -Djava.library.path=${project-root}/native/src/.libs when calling the JVM
+ * If you are running this test in eclipse you should do:
+ *   I - Run->Open Run Dialog
+ *   II - Find the class on the list (you will find it if you already tried running this testcase before)  
+ *   III - Add -Djava.library.path=<your project place>/native/src/.libs
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
+ *
+ */
+public class RealAIOJournalImplTest extends JournalImplTestUnit
+{
+   private static final Logger log = Logger.getLogger(RealAIOJournalImplTest.class);
+   
+   // Need to run the test over a local disk (no NFS)
+   protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") +  "/journal-test";
+     
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      if (!AsynchronousFileImpl.isLoaded())
+      {
+         fail(String.format("libAIO is not loaded on %s %s %s", 
+               System.getProperty("os.name"), 
+               System.getProperty("os.arch"), 
+               System.getProperty("os.version")));
+      }
+   }
+   
+   protected void tearDown() throws Exception
+   {
+      super.tearDown();
+      deleteDirectory(new File(journalDir));
+   }
+   
+   protected SequentialFileFactory getFileFactory() throws Exception
+   {
+      File file = new File(journalDir);
+      
+      deleteDirectory(file);
+      
+      file.mkdir();     
+      
+      return new AIOSequentialFileFactory(journalDir);
+   }  
+
+   protected int getAlignment()
+   {
+      return 512;
+   }
+   
+}

Copied: trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealNIOJournalImplTest.java (from rev 4647, trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealNIOJournalImplTest.java)
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealNIOJournalImplTest.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/journal/impl/RealNIOJournalImplTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+
+package org.jboss.messaging.tests.integration.journal.impl;
+
+import java.io.File;
+
+import org.jboss.messaging.core.journal.SequentialFileFactory;
+import org.jboss.messaging.core.journal.impl.NIOSequentialFileFactory;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.tests.unit.core.journal.impl.JournalImplTestUnit;
+
+
+/**
+ * 
+ * A RealJournalImplTest
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public class RealNIOJournalImplTest extends JournalImplTestUnit
+{
+   private static final Logger log = Logger.getLogger(RealNIOJournalImplTest.class);
+   
+   protected String journalDir = System.getProperty("user.home") + "/journal-test";
+      
+   protected SequentialFileFactory getFileFactory() throws Exception
+   {
+      File file = new File(journalDir);
+      
+      log.info("deleting directory " + journalDir);
+      
+      deleteDirectory(file);
+      
+      file.mkdir();     
+      
+      return new NIOSequentialFileFactory(journalDir);
+   }
+   
+   protected int getAlignment()
+   {
+      return 1;
+   }
+   
+   
+}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/AIOSequentialFileFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/AIOSequentialFileFactoryTest.java	2008-07-07 13:45:33 UTC (rev 4647)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/AIOSequentialFileFactoryTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */ 
-
-package org.jboss.messaging.tests.unit.core.journal.impl;
-
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.jboss.messaging.core.journal.IOCallback;
-import org.jboss.messaging.core.journal.SequentialFile;
-import org.jboss.messaging.core.journal.SequentialFileFactory;
-import org.jboss.messaging.core.journal.impl.AIOSequentialFileFactory;
-
-/**
- * 
- * A AIOSequentialFileFactoryTest
- * 
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public class AIOSequentialFileFactoryTest extends SequentialFileFactoryTestBase
-{
-
-   protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") + "/journal-test";
-   
-   protected void setUp() throws Exception
-   {
-      super.setUp();
-
-      File file = new File(journalDir);
-      
-      deleteDirectory(file);
-      
-      file.mkdir();     
-   }
-
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-
-      deleteDirectory(new File(journalDir));
-   }
-
-   protected SequentialFileFactory createFactory()
-   {
-      return new AIOSequentialFileFactory(journalDir);
-   }
-   
-   public void testBuffer() throws Exception
-   {
-      SequentialFile file = factory.createSequentialFile("filtetmp.log", 10, 120);
-      file.open();
-      ByteBuffer buff = factory.newBuffer(10);
-      assertEquals(512, buff.limit());
-      file.close();
-   }
-   
-   public void testBlockCallback() throws Exception
-   {
-      class BlockCallback implements IOCallback
-      {         
-         AtomicInteger countDone = new AtomicInteger(0);
-         AtomicInteger countError = new AtomicInteger(0);
-         CountDownLatch blockLatch;
-
-         BlockCallback()
-         {
-            this.blockLatch = new CountDownLatch(1);
-         }
-         
-         public void release()
-         {
-            blockLatch.countDown();
-         }
-         
-         public void done()
-         {            
-            try
-            {
-               blockLatch.await();
-            }
-            catch (InterruptedException e)
-            {
-               e.printStackTrace();
-            }
-
-            countDone.incrementAndGet();
-         }
-
-         public void onError(int errorCode, String errorMessage)
-         {
-            try
-            {
-               blockLatch.await();
-            }
-            catch (InterruptedException e)
-            {
-               e.printStackTrace();
-            }
-            
-            countError.incrementAndGet();
-         }
-      }
-      
-      BlockCallback callback = new BlockCallback();
-      
-      final int NUMBER_OF_RECORDS = 10000;
-      
-      SequentialFile file = factory.createSequentialFile("callbackBlock.log", 1000, 12000);
-      file.open();
-      file.fill(0, 512 * NUMBER_OF_RECORDS, (byte)'a');
-
-      
-      for (int i=0; i<NUMBER_OF_RECORDS; i++)
-      {
-         ByteBuffer buffer = factory.newBuffer(512);
-         
-         buffer.putInt(i + 10);
-         
-         for (int j=buffer.position(); j<buffer.limit(); j++)
-         {
-            buffer.put((byte)'b');
-         }
-         
-         file.write(buffer, callback);
-      }
-      
-      
-      callback.release();
-      file.close();
-      assertEquals(NUMBER_OF_RECORDS, callback.countDone.get());
-      assertEquals(0, callback.countError.get());
-      
-      file.open();
-      
-      ByteBuffer buffer = factory.newBuffer(512);
-
-      for (int i=0; i<NUMBER_OF_RECORDS; i++)
-      {
-         
-         file.read(buffer);
-         buffer.rewind();
-         
-         int recordRead = buffer.getInt();
-         
-         assertEquals(i + 10, recordRead);
-         
-         for (int j=buffer.position(); j<buffer.limit(); j++)
-         {
-            assertEquals((byte)'b', buffer.get());
-         }
-         
-       }
-      
-      
-      file.close();
-   }
-   
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/NIOSequentialFileFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/NIOSequentialFileFactoryTest.java	2008-07-07 13:45:33 UTC (rev 4647)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/NIOSequentialFileFactoryTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */ 
-
-package org.jboss.messaging.tests.unit.core.journal.impl;
-
-import java.io.File;
-
-import org.jboss.messaging.core.journal.SequentialFileFactory;
-import org.jboss.messaging.core.journal.impl.NIOSequentialFileFactory;
-
-/**
- * 
- * A NIOSequentialFileFactoryTest
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class NIOSequentialFileFactoryTest extends SequentialFileFactoryTestBase
-{		
-	protected String journalDir = System.getProperty("user.home") + "/journal-test";
-		
-	protected void setUp() throws Exception
-	{
-		super.setUp();
-		
-		File file = new File(journalDir);
-		
-		deleteDirectory(file);
-		
-		file.mkdir();		
-	}
-
-	protected SequentialFileFactory createFactory()
-	{
-		return new NIOSequentialFileFactory(journalDir);
-	}
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealAIOJournalImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealAIOJournalImplTest.java	2008-07-07 13:45:33 UTC (rev 4647)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealAIOJournalImplTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */ 
-
-package org.jboss.messaging.tests.unit.core.journal.impl;
-
-import java.io.File;
-
-import org.jboss.messaging.core.asyncio.impl.AsynchronousFileImpl;
-import org.jboss.messaging.core.journal.SequentialFileFactory;
-import org.jboss.messaging.core.journal.impl.AIOSequentialFileFactory;
-import org.jboss.messaging.core.logging.Logger;
-
-/**
- * 
- * A RealJournalImplTest
- * you need to define -Djava.library.path=${project-root}/native/src/.libs when calling the JVM
- * If you are running this test in eclipse you should do:
- *   I - Run->Open Run Dialog
- *   II - Find the class on the list (you will find it if you already tried running this testcase before)  
- *   III - Add -Djava.library.path=<your project place>/native/src/.libs
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public class RealAIOJournalImplTest extends JournalImplTestUnit
-{
-   private static final Logger log = Logger.getLogger(RealAIOJournalImplTest.class);
-   
-   // Need to run the test over a local disk (no NFS)
-   protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") +  "/journal-test";
-     
-   @Override
-   protected void setUp() throws Exception
-   {
-      super.setUp();
-      if (!AsynchronousFileImpl.isLoaded())
-      {
-         fail(String.format("libAIO is not loaded on %s %s %s", 
-               System.getProperty("os.name"), 
-               System.getProperty("os.arch"), 
-               System.getProperty("os.version")));
-      }
-   }
-   
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-      deleteDirectory(new File(journalDir));
-   }
-   
-   protected SequentialFileFactory getFileFactory() throws Exception
-   {
-      File file = new File(journalDir);
-      
-      deleteDirectory(file);
-      
-      file.mkdir();     
-      
-      return new AIOSequentialFileFactory(journalDir);
-   }  
-
-   protected int getAlignment()
-   {
-      return 512;
-   }
-   
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealNIOJournalImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealNIOJournalImplTest.java	2008-07-07 13:45:33 UTC (rev 4647)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/RealNIOJournalImplTest.java	2008-07-07 15:31:06 UTC (rev 4648)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */ 
-
-package org.jboss.messaging.tests.unit.core.journal.impl;
-
-import java.io.File;
-
-import org.jboss.messaging.core.journal.SequentialFileFactory;
-import org.jboss.messaging.core.journal.impl.NIOSequentialFileFactory;
-import org.jboss.messaging.core.logging.Logger;
-
-
-/**
- * 
- * A RealJournalImplTest
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class RealNIOJournalImplTest extends JournalImplTestUnit
-{
-   private static final Logger log = Logger.getLogger(RealNIOJournalImplTest.class);
-   
-   protected String journalDir = System.getProperty("user.home") + "/journal-test";
-      
-   protected SequentialFileFactory getFileFactory() throws Exception
-   {
-      File file = new File(journalDir);
-      
-      log.info("deleting directory " + journalDir);
-      
-      deleteDirectory(file);
-      
-      file.mkdir();     
-      
-      return new NIOSequentialFileFactory(journalDir);
-   }
-   
-   protected int getAlignment()
-   {
-      return 1;
-   }
-   
-   
-}




More information about the jboss-cvs-commits mailing list