[hornetq-commits] JBoss hornetq SVN: r9740 - in branches/Branch_New_Paging: tests/src/org/hornetq/tests/integration/paging and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Sep 30 18:56:46 EDT 2010


Author: clebert.suconic at jboss.com
Date: 2010-09-30 18:56:46 -0400 (Thu, 30 Sep 2010)
New Revision: 9740

Modified:
   branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
   branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCacheTest.java
Log:
small tweak

Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java	2010-09-30 22:31:47 UTC (rev 9739)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java	2010-09-30 22:56:46 UTC (rev 9740)
@@ -136,6 +136,11 @@
       
       return cache;
    }
+   
+   public int getCacheSize()
+   {
+      return softCache.size();
+   }
 
    // Package protected ---------------------------------------------
 

Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCacheTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCacheTest.java	2010-09-30 22:31:47 UTC (rev 9739)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCacheTest.java	2010-09-30 22:56:46 UTC (rev 9740)
@@ -65,7 +65,7 @@
 
       StorageManager storageManager = server.getStorageManager();
 
-      final int NUM_MESSAGES = 1000;
+      final int NUM_MESSAGES = 300;
 
       pageStore.startPaging();
 
@@ -92,9 +92,13 @@
          System.out.println("Page " + i + " had " + cache.getNumberOfMessages() + " messages");
 
       }
-
-      System.out.println("Go check!");
-      Thread.sleep(50000);
+      
+      assertTrue(cursorProvider.getCacheSize() < numberOfPages);
+      
+      System.out.println("Cache size = " + cursorProvider.getCacheSize());
+      assertEquals(numberOfPages, pageStore.getNumberOfPages());
+      
+      
    }
 
    // Package protected ---------------------------------------------



More information about the hornetq-commits mailing list