Package org.jboss.test.messaging.core

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


      {
         // we test only recoverable channels now
         return;
      }

      BrokenReceiver brokenReceiver = new BrokenReceiver(2);
      assertTrue(queue.add(brokenReceiver));

      MessageReference ref = createReference(0, false, "payload");
      SimpleDeliveryObserver observer = new SimpleDeliveryObserver();

      Transaction tx = tr.createTransaction();


      log.debug("sending message 1");

      // transacted send, non-reliable message, one message
      // for a transactional send, handle() return value is unspecified
      queue.handle(observer, ref, tx);

      ref = createReference(1, false, "payload");

      log.debug("sending message 2");
      queue.handle(observer, ref, tx);

      ref = createReference(2, false, "payload");

      log.debug("sending message 3");
      queue.handle(observer, ref, tx);

      // no messages in the channel
      assertEquals(0, queue.browse().size());

      tx.commit();

      assertEquals(2, queue.browse().size());
      assertEquals(1, brokenReceiver.getMessages().size());
   }
View Full Code Here

TOP

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

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.