Package org.hornetq.tests.unit.core.postoffice.impl

Examples of org.hornetq.tests.unit.core.postoffice.impl.FakeQueue


    * @throws Exception
    */
   private PageSubscription createNonPersistentCursor(Filter filter) throws Exception
   {
      long id = server.getStorageManager().generateUniqueID();
      FakeQueue queue = new FakeQueue(new SimpleString(filter.toString()), id);
      queueList.add(queue);
     
      PageSubscription subs = lookupCursorProvider().createSubscription(id, filter, false);
     
      queue.setPageSubscription(subs);
     
      return subs;
   }
View Full Code Here


      ManagementServiceImpl managementService = new ManagementServiceImpl(null, conf);
      managementService.setStorageManager(new NullStorageManager());

      SimpleString address = RandomUtil.randomSimpleString();
      managementService.registerAddress(address);
      Queue queue = new FakeQueue(RandomUtil.randomSimpleString());
      managementService.registerQueue(queue, RandomUtil.randomSimpleString(), new FakeStorageManager());

      Object[] addresses = managementService.getResources(AddressControl.class);
      Assert.assertEquals(1, addresses.length);
      Assert.assertTrue(addresses[0] instanceof AddressControl);
      AddressControl addressControl = (AddressControl)addresses[0];
      Assert.assertEquals(address.toString(), addressControl.getAddress());

      Object[] queues = managementService.getResources(QueueControl.class);
      Assert.assertEquals(1, queues.length);
      Assert.assertTrue(queues[0] instanceof QueueControl);
      QueueControl queueControl = (QueueControl)queues[0];
      Assert.assertEquals(queue.getName().toString(), queueControl.getName());
   }
View Full Code Here

   public void testDeleteMessagesOnStartup() throws Exception
   {
      createStorage();
     
      Queue theQueue = new FakeQueue(new SimpleString(""));
      HashMap<Long, Queue> queues = new HashMap<Long, Queue>();
      queues.put(100l, theQueue);
     
      ServerMessage msg = new ServerMessageImpl(1, 100);
     
View Full Code Here

    * @throws Exception
    */
   private PageSubscription createNonPersistentCursor(Filter filter) throws Exception
   {
      long id = server.getStorageManager().generateUniqueID();
      FakeQueue queue = new FakeQueue(new SimpleString(filter.toString()), id);
      queueList.add(queue);
     
      PageSubscription subs = lookupCursorProvider().createSubscription(id, filter, false);
     
      queue.setPageSubscription(subs);
     
      return subs;
   }
View Full Code Here

      ManagementServiceImpl managementService = new ManagementServiceImpl(null, conf);
      managementService.setStorageManager(new NullStorageManager());

      SimpleString address = RandomUtil.randomSimpleString();
      managementService.registerAddress(address);
      Queue queue = new FakeQueue(RandomUtil.randomSimpleString());
      managementService.registerQueue(queue, RandomUtil.randomSimpleString(), new FakeStorageManager());

      Object[] addresses = managementService.getResources(AddressControl.class);
      Assert.assertEquals(1, addresses.length);
      Assert.assertTrue(addresses[0] instanceof AddressControl);
      AddressControl addressControl = (AddressControl)addresses[0];
      Assert.assertEquals(address.toString(), addressControl.getAddress());

      Object[] queues = managementService.getResources(QueueControl.class);
      Assert.assertEquals(1, queues.length);
      Assert.assertTrue(queues[0] instanceof QueueControl);
      QueueControl queueControl = (QueueControl)queues[0];
      Assert.assertEquals(queue.getName().toString(), queueControl.getName());
   }
View Full Code Here

   public void testDeleteMessagesOnStartup() throws Exception
   {
      createStorage();
     
      Queue theQueue = new FakeQueue(new SimpleString(""));
      HashMap<Long, Queue> queues = new HashMap<Long, Queue>();
      queues.put(100l, theQueue);
     
      ServerMessage msg = new ServerMessageImpl(1, 100);
     
View Full Code Here

      PageCursorProvider cursorProvider = lookupCursorProvider();

      PageSubscription cursor = cursorProvider.createSubscription(11, null, false);
      PageSubscriptionImpl cursor2 = (PageSubscriptionImpl)cursorProvider.createSubscription(12, null, false);
     
      this.queueList.add(new FakeQueue(new SimpleString("a"), 11));
     
      this.queueList.add(new FakeQueue(new SimpleString("b"), 12));

      int numberOfPages = addMessages(NUM_MESSAGES, 1024 * 1024);

      System.out.println("NumberOfPages = " + numberOfPages);

View Full Code Here

      PageCursorProvider cursorProvider = lookupCursorProvider();

      PageSubscription cursor = cursorProvider.createSubscription(2, null, false);
     
      queueList.add(new FakeQueue(new SimpleString("tmp"), 2));

      int numberOfPages = addMessages(NUM_MESSAGES, 1024 * 1024);

      System.out.println("NumberOfPages = " + numberOfPages);

View Full Code Here

    * @throws Exception
    */
   private PageSubscription createNonPersistentCursor(Filter filter) throws Exception
   {
      long id = server.getStorageManager().generateUniqueID();
      FakeQueue queue = new FakeQueue(new SimpleString(filter.toString()), id);
      queueList.add(queue);
     
      PageSubscription subs = lookupCursorProvider().createSubscription(id, filter, false);
     
      queue.setPageSubscription(subs);
     
      return subs;
   }
View Full Code Here

    * @throws Exception
    */
   private PageSubscription createNonPersistentCursor(Filter filter) throws Exception
   {
      long id = server.getStorageManager().generateUniqueID();
      FakeQueue queue = new FakeQueue(new SimpleString(filter.toString()), id);
      queueList.add(queue);

      PageSubscription subs = lookupCursorProvider().createSubscription(id, filter, false);

      queue.setPageSubscription(subs);

      return subs;
   }
View Full Code Here

TOP

Related Classes of org.hornetq.tests.unit.core.postoffice.impl.FakeQueue

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.