[jboss-cvs] JBoss Messaging SVN: r2811 - in trunk/tests/src/org/jboss/test/messaging/core: paging and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 27 20:11:39 EDT 2007


Author: timfox
Date: 2007-06-27 20:11:39 -0400 (Wed, 27 Jun 2007)
New Revision: 2811

Modified:
   trunk/tests/src/org/jboss/test/messaging/core/MessagingQueueTestBase.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_2PCTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_NTTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_TTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_2PCTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_NTTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_TTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/PagingTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java
   trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java
Log:
Fixes to paging tests


Modified: trunk/tests/src/org/jboss/test/messaging/core/MessagingQueueTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/MessagingQueueTestBase.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/MessagingQueueTestBase.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -197,43 +197,6 @@
 
    // Channel tests -------------------------------------------------
    
-
-   public void testWithFilter()
-   {
-      Filter f = new SimpleFilter(3);
-                        
-      MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, false, -1, f, false, false);
-      queue.activate();
-      
-      Message m1 = new CoreMessage(1, false, 0, 0, (byte)0, null, null);
-      Message m2 = new CoreMessage(2, false, 0, 0, (byte)0, null, null);
-      Message m3 = new CoreMessage(3, false, 0, 0, (byte)0, null, null);
-      Message m4 = new CoreMessage(4, false, 0, 0, (byte)0, null, null);
-      Message m5 = new CoreMessage(5, false, 0, 0, (byte)0, null, null);
-      
-      MessageReference ref1 = ms.reference(m1);
-      MessageReference ref2 = ms.reference(m2);
-      MessageReference ref3 = ms.reference(m3);
-      MessageReference ref4 = ms.reference(m4);
-      MessageReference ref5 = ms.reference(m5);
-      
-      Delivery del = queue.handle(null, ref1, null);
-      assertFalse(del.isSelectorAccepted());
-      
-      del = queue.handle(null, ref2, null);
-      assertFalse(del.isSelectorAccepted());
-      
-      del = queue.handle(null, ref3, null);
-      assertTrue(del.isSelectorAccepted());
-      
-      del = queue.handle(null, ref4, null);
-      assertFalse(del.isSelectorAccepted());
-      
-      del = queue.handle(null, ref5, null);
-      assertFalse(del.isSelectorAccepted());
-   }
-   
-   
    public void testUnreliableSynchronousDeliveryTwoReceivers() throws Exception
    {
       if (queue.isRecoverable())
@@ -730,20 +693,11 @@
       // no messages in the channel yet
       assertEquals(0, queue.browse(null).size());
 
-      try
-      {
-         tx.commit();
-         fail("this should throw exception");
-      }
-      catch(Exception e)
-      {
-         // OK
-      }
-
-      // still no messages in the channel
-      assertEquals(0, queue.browse(null).size());
-
+      tx.commit();
+        
+      assertEqualSets(refs, queue.browse(null));
    }
+   
   
 
    ///////////
@@ -1357,21 +1311,10 @@
       // no message at the receiver
       assertTrue(r.getMessages().isEmpty());
 
-      try
-      {
-         tx.commit();
-         fail("this should throw exception");
-      }
-      catch(Exception e)
-      {
-         // OK
-      }
+      tx.commit();
 
-      // no messages in the channel
-      assertEquals(0, queue.browse(null).size());
-
-      // no message at the receiver
-      assertTrue(r.getMessages().isEmpty());
+      // messages at the receiver
+      assertEqualSets(refs, r.getMessages());
    }
 
    ///////////

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_2PCTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_2PCTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_2PCTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -63,8 +63,10 @@
    public void testChannelShareNP_2PC() throws Throwable
    {   	   	
       MessagingQueue queue1 = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue1.activate();
       
       MessagingQueue queue2 = new MessagingQueue(1, "queue2", 2, ms, pm, true, -1, null, 50, 10, 5, false, false);
+      queue2.activate();
      
       Message[] msgs = new Message[150];
       

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_NTTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_NTTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_NTTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -62,9 +62,11 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue1 = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue1.activate();
       
       MessagingQueue queue2 = new MessagingQueue(1, "queue2", 2, ms, pm, true, -1, null, 50, 10, 5, false, false);
-     
+      queue2.activate();
+      
       Message[] msgs = new Message[150];
       
       MessageReference[] refs1 = new MessageReference[150];

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_TTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_TTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_NP_TTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -63,9 +63,11 @@
    public void testChannelShareNP_Transactional() throws Throwable
    {
       MessagingQueue queue1 = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue1.activate();
       
       MessagingQueue queue2 = new MessagingQueue(1, "queue2", 2, ms, pm, true, -1, null, 50, 10, 5, false, false);
-                             
+      queue2.activate();                  
+      
       Message[] msgs = new Message[150];
       
       MessageReference[] refs1 = new MessageReference[150];

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_2PCTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_2PCTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_2PCTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -58,9 +58,11 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue1 = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue1.activate();
       
       MessagingQueue queue2 = new MessagingQueue(1, "queue2", 2, ms, pm, true, -1, null, 50, 10, 5, false, false);
-                        
+      queue2.activate();                  
+      
       Message[] msgs = new Message[150];
       
       MessageReference[] refs1 = new MessageReference[150];

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_NTTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_NTTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_NTTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -62,9 +62,11 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue1 = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue1.activate();
       
       MessagingQueue queue2 = new MessagingQueue(1, "queue2", 2, ms, pm, true, -1, null, 50, 10, 5, false, false);
-                
+      queue2.activate();          
+      
       Message[] msgs = new Message[150];
       
       MessageReference[] refs1 = new MessageReference[150];

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_TTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_TTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/ChannelShare_P_TTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -62,9 +62,11 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue1 = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue1.activate();
       
       MessagingQueue queue2 = new MessagingQueue(1, "queue2", 2, ms, pm, true, -1, null, 50, 10, 5, false, false);
-                       
+      queue2.activate();              
+      
       Message[] msgs = new Message[150];
       
       MessageReference[] refs1 = new MessageReference[150];

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/PagingTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/PagingTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/PagingTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -62,6 +62,7 @@
    public void testPaging() throws Exception
    {
       MessagingQueue p = new MessagingQueue(1, "queue0", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      p.activate();
            
       CoreMessage m = null;
 

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_2PCTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -65,6 +65,7 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue.activate();
       
       Message[] msgs = new Message[241];
       

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_NTTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -64,7 +64,8 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
-       
+      queue.activate(); 
+      
       Message[] msgs = new Message[241];
       
       MessageReference[] refs = new MessageReference[241];

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_NP_TTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -65,6 +65,7 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue.activate();
       
       Message[] msgs = new Message[241];
       

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_2PCTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -65,6 +65,7 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue.activate();
       
       Message[] msgs = new Message[241];
       

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_NTTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -64,6 +64,7 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue.activate();
       
       Message[] msgs = new Message[241];
       

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_P_TTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -65,7 +65,8 @@
    public void test1() throws Throwable
    {
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
-        
+      queue.activate();  
+      
       Message[] msgs = new Message[241];
       
       MessageReference[] refs = new MessageReference[241];

Modified: trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java	2007-06-27 23:02:01 UTC (rev 2810)
+++ trunk/tests/src/org/jboss/test/messaging/core/paging/SingleChannel_ReloadTest.java	2007-06-28 00:11:39 UTC (rev 2811)
@@ -66,6 +66,7 @@
    public void testRecoverableQueueCrash() throws Throwable
    {
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue.activate();
       
       Message[] msgs = new Message[200];
       
@@ -127,6 +128,7 @@
       tr.start();
          
       MessagingQueue queue2 = new MessagingQueue(1, "queue1", 1, ms, pm, true, -1, null, 100, 20, 10, false, false);
+      queue2.activate();
       
       queue2.deactivate();
       queue2.load();
@@ -163,6 +165,7 @@
       //Non recoverable queue - eg temporary queue
       
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, false, -1, null, 100, 20, 10, false, false);
+      queue.activate();
          	      
       Message[] msgs = new Message[200];
       
@@ -224,6 +227,7 @@
       tr.start();
 
       MessagingQueue queue2 = new MessagingQueue(1, "queue1", 1, ms, pm, false, -1, null, 100, 20, 10, false, false);
+      queue2.activate();
       
       queue2.deactivate();
       queue2.load();
@@ -254,6 +258,7 @@
       //Non recoverable queue - eg temporary queue
       
       MessagingQueue queue = new MessagingQueue(1, "queue1", 1, ms, pm, false, -1, null, 100, 20, 10, false, false);
+      queue.activate();
         
       Message[] msgs = new Message[200];
       




More information about the jboss-cvs-commits mailing list