ms = new PagingMessageStore("store1");
ms = new SimpleMessageStore("store1");
   public void test8_NDC() throws Throwable   {      Channel channel1 = new Queue(1, ms, pm, true, FULL_SIZE1, PAGE_SIZE1, 0);            State state1 = new ChannelState(channel1, pm, true, true, FULL_SIZE1, PAGE_SIZE1, 0);              //Add some persistent messages, restart server and make sure state loads up ok            Message[] msgs = new Message[100];            for (int i = 0; i < 100; i++)      {         Message m = MessageFactory.createCoreMessage(i, true, null);                          MessageReference ref1 = ms.reference(m);                  state1.addReference(ref1);                  msgs[i] = m;               }            //Shutdown and restart                  ((JDBCPersistenceManager)pm).stop();            ms.stop();            pm =         new JDBCPersistenceManager(sc.getDataSource(), sc.getTransactionManager());      ((JDBCPersistenceManager)pm).start();            ms = new PagingMessageStore("store1");                  channel1 = new Queue(1, ms, pm, true, FULL_SIZE1, PAGE_SIZE1, 0);      state1 = new ChannelState(channel1, pm, true, true, FULL_SIZE1, PAGE_SIZE1, 0);           state1.load();                    //Consume all the messages            for (int i = 0; i < 100; i++)      {          MessageReference ref = state1.removeFirstInMemory();            assertNotNull(ref);         assertEquals(msgs[i].getMessageID(), ref.getMessageID());         Delivery del = new SimpleDelivery(channel1, ref, false);         state1.addDelivery(del);         state1.acknowledge(del);      }           }