Examples of TestSupportPageStore


Examples of org.hornetq.core.paging.impl.TestSupportPageStore

                                                            new NullStorageManager(),
                                                            addressSettings);

      managerImpl.start();

      TestSupportPageStore store = (TestSupportPageStore)managerImpl.getPageStore(new SimpleString("simple-test"));

      ServerMessage msg = createMessage(1l, new SimpleString("simple-test"), createRandomBuffer(10));

      Assert.assertFalse(store.page(msg, new RoutingContextImpl(null)));

      store.startPaging();

      Assert.assertTrue(store.page(msg, new RoutingContextImpl(null)));

      Page page = store.depage();

      page.open();

      List<PagedMessage> msgs = page.read(new NullStorageManager());

      page.close();

      Assert.assertEquals(1, msgs.size());

      UnitTestCase.assertEqualsByteArrays(msg.getBodyBuffer().writerIndex(), msg.getBodyBuffer().toByteBuffer().array(), msgs.get(0)
                                                                                          .getMessage()
                                                                                          .getBodyBuffer()
                                                                                          .toByteBuffer()
                                                                                          .array());

      Assert.assertTrue(store.isPaging());

      Assert.assertNull(store.depage());

      Assert.assertFalse(store.page(msg, new RoutingContextImpl(null)));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.