Package org.jboss.test.messaging.core

Examples of org.jboss.test.messaging.core.SimpleCondition


            createClusteredPostOffice(3, "testgroup", sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue2", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
            office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);

         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office3, 3, "queue3", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
            office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);

         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);

         //This will make it fail after casting but before persisting the message in the db
         office1.setFail(true, false, false);

         Transaction tx = tr.createTransaction();

         final int NUM_MESSAGES = 10;

         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            Message msg = CoreMessageFactory.createCoreMessage(i, true, null);

            MessageReference ref = ms.reference(msg);

            office1.route(ref, new SimpleCondition("topic1"), tx);
         }

         Thread.sleep(1000);

         List msgs = receiver1.getMessages();
View Full Code Here


            createClusteredPostOffice(3, "testgroup", sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue2", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);

         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office3, 3, "queue3", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);

         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);

         //This will make it fail after casting and persisting the message in the db
         office1.setFail(false, true, false);

         Transaction tx = tr.createTransaction();

         final int NUM_MESSAGES = 10;

         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            Message msg = CoreMessageFactory.createCoreMessage(i, true, null);

            MessageReference ref = ms.reference(msg);

            office1.route(ref, new SimpleCondition("topic1"), tx);
         }

         Thread.sleep(1000);

         List msgs = receiver1.getMessages();
View Full Code Here

         office = createPostOffice();
        
         PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding1 =
            office.bindQueue(new SimpleCondition("condition1"), queue1);
        
         PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding2 =
            office.bindQueue(new SimpleCondition("condition1"), queue2);
        
         PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding3 =
            office.bindQueue(new SimpleCondition("condition1"), queue3);
        
         PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding4 =
            office.bindQueue(new SimpleCondition("condition1"), queue4);
        
         PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding5 =
            office.bindQueue(new SimpleCondition("condition2"), queue5);
        
         PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding6 =
            office.bindQueue(new SimpleCondition("condition2"), queue6);
        
         PagingFilteredQueue queue7 = new PagingFilteredQueue("queue7", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding7 =
            office.bindQueue(new SimpleCondition("condition2"), queue7);
        
         PagingFilteredQueue queue8 = new PagingFilteredQueue("queue8", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding8 =
            office.bindQueue(new SimpleCondition("condition2"), queue8);
        
        
         Collection bindings = office.getBindingsForCondition(new SimpleCondition("dummy"));
         assertNotNull(bindings);
         assertTrue(bindings.isEmpty());
        
         //We don't match on substrings
         bindings = office.getBindingsForCondition(new SimpleCondition("condition123"));
         assertNotNull(bindings);
         assertTrue(bindings.isEmpty());
        
         //We don't currently support hierarchies
         bindings = office.getBindingsForCondition(new SimpleCondition("condition1.subcondition"));
         assertNotNull(bindings);
         assertTrue(bindings.isEmpty());
        
         //We currently just do an exact match
         bindings = office.getBindingsForCondition(new SimpleCondition("condition1"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         Iterator iter = bindings.iterator();
         assertEquivalent((Binding)iter.next(), binding1);
         assertEquivalent((Binding)iter.next(), binding2);
         assertEquivalent((Binding)iter.next(), binding3);
         assertEquivalent((Binding)iter.next(), binding4);
        
         bindings = office.getBindingsForCondition(new SimpleCondition("condition2"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent((Binding)iter.next(), binding5);
View Full Code Here

        
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
        
         PagingFilteredQueue queue2 =
            new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
        
         PagingFilteredQueue queue3 =
            new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
        
         PagingFilteredQueue queue4 =
            new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue4);
        
         PagingFilteredQueue queue5 =
            new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue5);
        
         PagingFilteredQueue queue6 =
            new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue6);
     
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);
         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue4.add(receiver4);
         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue5.add(receiver5);
         SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue6.add(receiver6);
        
         queue1.deactivate();
         queue2.deactivate();
         queue5.deactivate();
         queue6.deactivate();
        
         assertFalse(queue1.isActive());     
         assertFalse(queue2.isActive());
         assertFalse(queue5.isActive());
         assertFalse(queue6.isActive());
         assertTrue(queue3.isActive());
         assertTrue(queue4.isActive());     
        
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);
        
         boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
        
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver2.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver3.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
         Message msgRec = (Message)msgs.get(0);
         assertTrue(msg1 == msgRec);
         receiver3.acknowledge(msgRec, null);
         msgs = queue3.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty())
        
         msgs = receiver4.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver5.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver6.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver3.clear();
                    
         Message msg2 = CoreMessageFactory.createCoreMessage(2);     
         MessageReference ref2 = ms.reference(msg2);
        
         routed = postOffice.route(ref2, new SimpleCondition("topic2"), null);     
         assertTrue(routed);
        
         msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
View Full Code Here

        
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("condition1"), queue1);
             
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue1.add(receiver1);
  
         assertTrue(queue1.isActive());
  
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);
        
         boolean routed =
            postOffice.route(ref1, new SimpleCondition("this won't match anything"), null);
        
         assertFalse(routed);
              
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
View Full Code Here

     
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, filter);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
        
         PagingFilteredQueue queue2 =
            new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
        
         PagingFilteredQueue queue3 =
            new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
        
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);
        
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);        
         boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
         Message msg2 = CoreMessageFactory.createCoreMessage(2);     
         MessageReference ref2 = ms.reference(msg2);        
         routed = postOffice.route(ref2, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
         Message msg3 = CoreMessageFactory.createCoreMessage(3);     
         MessageReference ref3 = ms.reference(msg3);        
         routed = postOffice.route(ref3, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
        
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
View Full Code Here

     
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
        
         PagingFilteredQueue queue2 =
            new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
        
         PagingFilteredQueue queue3 =
            new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
        
         PagingFilteredQueue queue4 =
            new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, true,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue4);
        
         PagingFilteredQueue queue5 =
            new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, true,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue5);
        
         PagingFilteredQueue queue6 =
            new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, true,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue6);
     
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue3.add(receiver3);
         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue4.add(receiver4);
         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue5.add(receiver5);
         SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue6.add(receiver6);
        
         assertTrue(queue1.isActive());     
         assertTrue(queue2.isActive());
         assertTrue(queue3.isActive());     
         assertTrue(queue4.isActive());
         assertTrue(queue5.isActive());     
         assertTrue(queue6.isActive());
        
         Message msg1 = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);     
         MessageReference ref1 = ms.reference(msg1);
        
         boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
        
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
         Message msgRec = (Message)msgs.get(0);
         assertTrue(msg1 == msgRec);
         receiver1.acknowledge(msgRec, null);
         msgs = queue1.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver2.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
         msgRec = (Message)msgs.get(0);
         assertTrue(msg1 == msgRec);
         receiver2.acknowledge(msgRec, null);
         msgs = queue2.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver3.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
         msgRec = (Message)msgs.get(0);
         assertTrue(msg1 == msgRec);
         receiver3.acknowledge(msgRec, null);
         msgs = queue3.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver4.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver5.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver6.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver1.clear();
         receiver2.clear();
         receiver3.clear();
        
        
         Message msg2 = CoreMessageFactory.createCoreMessage(2, persistentMessage, null);     
         MessageReference ref2 = ms.reference(msg2);
        
         routed = postOffice.route(ref2, new SimpleCondition("topic2"), null);     
         assertTrue(routed);
        
         msgs = receiver4.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
View Full Code Here

     
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
        
         PagingFilteredQueue queue2 =
            new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, true,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
         
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue1.add(receiver1);

         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue2.add(receiver2);
  
         assertTrue(queue1.isActive());
         assertTrue(queue2.isActive());
  
         Message msg1 = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);     
         MessageReference ref1 = ms.reference(msg1);
        
         Message msg2 = CoreMessageFactory.createCoreMessage(2, persistentMessage, null);     
         MessageReference ref2 = ms.reference(msg2);
        
         Transaction tx = tr.createTransaction();
        
         boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), tx);           
         assertTrue(routed);
         routed = postOffice.route(ref2, new SimpleCondition("topic1"), tx);           
         assertTrue(routed);
              
         List msgs = queue1.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = queue2.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         tx.commit();
        
         msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertEquals(2, msgs.size());
         Message msgRec1 = (Message)msgs.get(0);
         Message msgRec2 = (Message)msgs.get(1);
         assertTrue(msgRec1 == msg1);
         assertTrue(msgRec2 == msg2);
        
         msgs = receiver2.getMessages();
         assertNotNull(msgs);
         assertEquals(2, msgs.size());
         msgRec1 = (Message)msgs.get(0);
         msgRec2 = (Message)msgs.get(1);
         assertTrue(msgRec1 == msg1);
         assertTrue(msgRec2 == msg2);
        
         //Acknowledge non transactionally
         receiver1.acknowledge(msgRec1, null);
         receiver1.acknowledge(msgRec2, null);
        
         receiver2.acknowledge(msgRec1, null);
         receiver2.acknowledge(msgRec2, null);
  
         msgs = queue1.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver1.clear();
        
         msgs = queue2.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver2.clear();
             
         Message msg3 = CoreMessageFactory.createCoreMessage(3, persistentMessage, null);     
         MessageReference ref3 = ms.reference(msg3);
        
         Message msg4 = CoreMessageFactory.createCoreMessage(4, persistentMessage, null);     
         MessageReference ref4 = ms.reference(msg4);
        
         tx = tr.createTransaction();
        
         routed = postOffice.route(ref3, new SimpleCondition("topic1"), tx);           
         assertTrue(routed);
         routed = postOffice.route(ref4, new SimpleCondition("topic1"), tx);           
         assertTrue(routed);
              
         msgs = queue1.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = queue2.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         tx.rollback();
        
         msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver1.clear();
        
         msgs = receiver2.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver2.clear();
        
        
         Message msg5 = CoreMessageFactory.createCoreMessage(5, persistentMessage, null);     
         MessageReference ref5 = ms.reference(msg5);
        
         Message msg6 = CoreMessageFactory.createCoreMessage(6, persistentMessage, null);     
         MessageReference ref6 = ms.reference(msg6);
              
         routed = postOffice.route(ref5, new SimpleCondition("topic1"), null);           
         assertTrue(routed);
         routed = postOffice.route(ref6, new SimpleCondition("topic1"), null);           
         assertTrue(routed);
        
         msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertEquals(2, msgs.size());
         msgRec1 = (Message)msgs.get(0);
         msgRec2 = (Message)msgs.get(1);
         assertTrue(msgRec1 == msg5);
         assertTrue(msgRec2 == msg6);
        
         msgs = receiver2.getMessages();
         assertNotNull(msgs);
         assertEquals(2, msgs.size());
         msgRec1 = (Message)msgs.get(0);
         msgRec2 = (Message)msgs.get(1);
         assertTrue(msgRec1 == msg5);
         assertTrue(msgRec2 == msg6);
        
         //Acknowledge transactionally
        
         tx = tr.createTransaction();
        
         receiver1.acknowledge(msgRec1, tx);
         receiver1.acknowledge(msgRec2, tx);
        
         receiver2.acknowledge(msgRec1, tx);
         receiver2.acknowledge(msgRec2, tx);
        
         int deliveringCount = queue1.getDeliveringCount();
         assertEquals(2, deliveringCount);
        
         deliveringCount = queue2.getDeliveringCount();
         assertEquals(2, deliveringCount);
        
         tx.commit();
        
         msgs = queue1.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
              
         receiver1.clear();
        
         msgs = queue2.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
              
         receiver2.clear();
        
         Message msg7 = CoreMessageFactory.createCoreMessage(7, persistentMessage, null);     
         MessageReference ref7 = ms.reference(msg7);
        
         Message msg8 = CoreMessageFactory.createCoreMessage(8, persistentMessage, null);     
         MessageReference ref8 = ms.reference(msg8);
              
         routed = postOffice.route(ref7, new SimpleCondition("topic1"), null);           
         assertTrue(routed);
         routed = postOffice.route(ref8, new SimpleCondition("topic1"), null);           
         assertTrue(routed);
        
         msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertEquals(2, msgs.size());
View Full Code Here

            new PagingFilteredQueue("durableQueue", channelIDManager.getID(), ms, pm, true, true,
                                    -1, null);
        
        
         Binding binding1 =
            office1.bindQueue(new SimpleCondition("condition1"), queue1);
        
         //Binding twice with the same name should fail     
         try
         {
            office1.bindQueue(new SimpleCondition("condition1"), queue1);
            fail();
         }
         catch (IllegalArgumentException e)
         {
            //Ok
         }
              
         //Bind one non durable
         PagingFilteredQueue queue2 =
            new PagingFilteredQueue("nonDurableQueue", channelIDManager.getID(), ms, pm, true,
                                    false, -1, null);
        
         Binding binding2 =
            office1.bindQueue(new SimpleCondition("condition2"), queue2);
        
         //Check they're there
        
         Binding binding3 = office1.getBindingForQueueName("durableQueue");
         assertNotNull(binding3);
View Full Code Here

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);

         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);

         Message msg = CoreMessageFactory.createCoreMessage(1, true, null);

         MessageReference ref = ms.reference(msg);

         office1.route(ref, new SimpleCondition("queue1"), null);

         Thread.sleep(2000);

         // Messages should all be in queue1
View Full Code Here

TOP

Related Classes of org.jboss.test.messaging.core.SimpleCondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.