[jboss-cvs] JBoss Messaging SVN: r5444 - in trunk: tests/src/org/jboss/messaging/tests/integration/chunkmessage and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 1 18:32:29 EST 2008


Author: clebert.suconic at jboss.com
Date: 2008-12-01 18:32:29 -0500 (Mon, 01 Dec 2008)
New Revision: 5444

Added:
   trunk/tests/src/org/jboss/messaging/tests/performance/paging/
   trunk/tests/src/org/jboss/messaging/tests/performance/paging/MeasurePagingMultiThreadTest.java
Modified:
   trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
   trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java
   trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/scheduling/ScheduledMessageTest.java
   trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java
   trunk/tests/src/org/jboss/messaging/tests/stress/paging/PageStressTest.java
   trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
Log:
Few tweaks on paging

Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -25,11 +25,11 @@
 import java.text.DecimalFormat;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.jboss.messaging.core.journal.SequentialFile;
@@ -90,11 +90,12 @@
 
    private volatile Page currentPage;
 
-   // positioningGlobalLock protects opening/closing and messing up with
-   // positions (currentPage and IDs)
-   private final Semaphore positioningGlobalLock = new Semaphore(1);
+   private final ReentrantLock writeLock = new ReentrantLock();
 
-   private final ReadWriteLock lock = new ReentrantReadWriteLock();
+   /** 
+    * We need to perform checks on currentPage with minimal locking
+    * */
+   private final ReadWriteLock currentPageLock = new ReentrantReadWriteLock();
 
    private volatile boolean running = false;
 
@@ -181,14 +182,14 @@
 
    public boolean isPaging()
    {
-      lock.readLock().lock();
+      currentPageLock.readLock().lock();
       try
       {
          return currentPage != null;
       }
       finally
       {
-         lock.readLock().unlock();
+         currentPageLock.readLock().unlock();
       }
    }
 
@@ -243,10 +244,8 @@
    //FIXME - why is this public?
    public Page depage() throws Exception
    {
-      positioningGlobalLock.acquire(); // Can't change currentPage or any of ids
-      // without a global lock
-      lock.writeLock().lock(); // Wait pending writes to finish before
-      // entering the block
+      writeLock.lock();
+      currentPageLock.writeLock().lock();  // Make sure no checks are done on currentPage while we are depaging
 
       try
       {
@@ -298,8 +297,8 @@
       }
       finally
       {
-         lock.writeLock().unlock();
-         positioningGlobalLock.release();
+         currentPageLock.writeLock().unlock();
+         writeLock.unlock();
       }
 
    }
@@ -313,11 +312,11 @@
          return false;
       }
       
-      lock.readLock().lock();
+      currentPageLock.readLock().lock();
       
       try
       {
-         // First done without a global lock, to avoid synchronization and increase throuput
+         // First check done concurrently, to avoid synchronization and increase throughput
          if (currentPage == null)
          {
             return false;
@@ -325,87 +324,65 @@
       }
       finally
       {
-         lock.readLock().unlock();
+         currentPageLock.readLock().unlock();
       }
 
 
-      // The only thing single-threaded done on paging is positioning and
-      // check-files (verifying if we need to open a new page file)
-      positioningGlobalLock.acquire();
-      
-      boolean gotReadLock = false;
+      writeLock.lock();
 
-      // After we have it locked we keep all the threads working until we need
-      // to move to a new file (in which case we demand a writeLock, to wait for
-      // the writes to finish)
       try
       {
-         try
+         if (currentPage == null)
          {
-            if (currentPage == null)
+            return false;
+         }
+
+         int bytesToWrite = fileFactory.calculateBlockSize(message.getEncodeSize() + PageImpl.SIZE_RECORD);
+
+         if (pageUsedSize.addAndGet(bytesToWrite) > pageSize && currentPage.getNumberOfMessages() > 0)
+         {
+            // Make sure nothing is currently validating currentPaging
+            currentPageLock.writeLock().lock();
+            try
             {
-               return false;
+               openNewPage();
+               pageUsedSize.addAndGet(bytesToWrite);
             }
-
-            int bytesToWrite = fileFactory.calculateBlockSize(message.getEncodeSize() + PageImpl.SIZE_RECORD);
-   
-            if (pageUsedSize.addAndGet(bytesToWrite) > pageSize && currentPage.getNumberOfMessages() > 0)
+            finally
             {
-               // Wait any pending write on the current page to finish before we
-               // can open another page.
-               lock.writeLock().lock();
-               try
-               {
-                  openNewPage();
-                  // openNewPage will zero pageUsedSize, that's why this is done again
-                  pageUsedSize.addAndGet(bytesToWrite);
-               }
-               finally
-               {
-                  lock.writeLock().unlock();
-               }
+               currentPageLock.writeLock().unlock();
             }
-            // we must get the readLock before we release the synchronizedBlockLock
-            // or else we could end up with files records being added to the
-            // currentPage even if the max size was already achieved.
-            // (Condition tested by PagingStoreTestPage::testConcurrentPaging, The
-            // test would eventually fail, 1 in 100)
-            // This is because the checkSize and positioning has to be done
-            // protected. We only allow writing the file in multi-thread.
-            lock.readLock().lock();
-            
-            gotReadLock = true;
-   
          }
-         finally
-         {
-            positioningGlobalLock.release();
-         }
+ 
+         currentPageLock.readLock().lock();
 
-         // End of a synchronized block..
-
-         if (currentPage != null)
+         try
          {
-            currentPage.write(message);
-            return true;
+            if (currentPage != null)
+            {
+               currentPage.write(message);
+               return true;
+            }
+            else
+            {
+               return false;
+            }
          }
-         else
+         finally
          {
-            return false;
+            currentPageLock.readLock().unlock();
          }
+
       }
       finally
       {
-         if (gotReadLock)
-         {
-            lock.readLock().unlock();
-         }
+         writeLock.unlock();
       }
    }
 
    public void sync() throws Exception
    {
-      lock.readLock().lock();
+      currentPageLock.readLock().lock();
 
       try
       {
@@ -416,13 +393,13 @@
       }
       finally
       {
-         lock.readLock().unlock();
+         currentPageLock.readLock().unlock();
       }
    }
 
    public boolean startDepaging()
    {
-      lock.readLock().lock();
+      currentPageLock.readLock().lock();
       try
       {
          if (currentPage == null)
@@ -448,7 +425,7 @@
       }
       finally
       {
-         lock.readLock().unlock();
+         currentPageLock.readLock().unlock();
       }
    }
 
@@ -473,7 +450,8 @@
    {
       if (running)
       {
-         lock.writeLock().lock();
+         writeLock.lock();
+         currentPageLock.writeLock().lock();
 
          try
          {
@@ -489,7 +467,8 @@
          }
          finally
          {
-            lock.writeLock().unlock();
+            writeLock.unlock();
+            currentPageLock.writeLock().unlock();
          }
       }
    }
@@ -506,7 +485,7 @@
          return;
       }
 
-      lock.writeLock().lock();
+      currentPageLock.writeLock().lock();
 
       firstPageId = Integer.MAX_VALUE;
       currentPageId = 0;
@@ -542,7 +521,7 @@
       }
       finally
       {
-         lock.writeLock().unlock();
+         currentPageLock.writeLock().unlock();
       }
    }
 
@@ -550,7 +529,7 @@
    {
       // First check without any global locks.
       // (Faster)
-      lock.readLock().lock();
+      currentPageLock.readLock().lock();
       try
       {
          if (currentPage != null)
@@ -560,12 +539,12 @@
       }
       finally
       {
-         lock.readLock().unlock();
+         currentPageLock.readLock().unlock();
       }
 
-      // if the first check failed, we do it again under a global lock
-      // (positioningGlobalLock) this time
-      positioningGlobalLock.acquire();
+      // if the first check failed, we do it again under a global currentPageLock
+      // (writeLock) this time
+      writeLock.lock();
 
       try
       {
@@ -582,7 +561,7 @@
       }
       finally
       {
-         positioningGlobalLock.release();
+         writeLock.unlock();
       }
    }
 
@@ -606,7 +585,7 @@
 
    private void openNewPage() throws Exception
    {
-      lock.writeLock().lock();
+      currentPageLock.writeLock().lock();
 
       try
       {
@@ -632,7 +611,7 @@
       }
       finally
       {
-         lock.writeLock().unlock();
+         currentPageLock.writeLock().unlock();
       }
    }
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/chunkmessage/ChunkTestBase.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -40,6 +40,7 @@
 import org.jboss.messaging.core.message.impl.MessageImpl;
 import org.jboss.messaging.core.remoting.impl.ByteBufferWrapper;
 import org.jboss.messaging.core.remoting.spi.MessagingBuffer;
+import org.jboss.messaging.core.server.MessagingService;
 import org.jboss.messaging.tests.util.ServiceTestBase;
 import org.jboss.messaging.util.DataConstants;
 import org.jboss.messaging.util.SimpleString;
@@ -60,7 +61,10 @@
    private static final Logger log = Logger.getLogger(ChunkTestBase.class);
 
    protected final SimpleString ADDRESS = new SimpleString("SimpleAddress");
+   
+   protected MessagingService messagingService;
 
+
    // Attributes ----------------------------------------------------
 
    // Static --------------------------------------------------------

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -46,12 +46,12 @@
 import org.jboss.messaging.core.client.ClientProducer;
 import org.jboss.messaging.core.client.ClientSession;
 import org.jboss.messaging.core.client.ClientSessionFactory;
-import org.jboss.messaging.core.client.ConnectionLoadBalancingPolicy;
 import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
 import org.jboss.messaging.core.config.Configuration;
 import org.jboss.messaging.core.config.TransportConfiguration;
 import org.jboss.messaging.core.logging.Logger;
 import org.jboss.messaging.core.message.Message;
+import org.jboss.messaging.core.server.MessagingService;
 import org.jboss.messaging.jms.client.JBossTextMessage;
 import org.jboss.messaging.tests.util.ServiceTestBase;
 import org.jboss.messaging.tests.util.SpawnedVMSupport;
@@ -82,6 +82,8 @@
    // Attributes ----------------------------------------------------
 
    private ClientSessionFactory sf;
+   
+   private MessagingService messagingService;
 
    // Constructors --------------------------------------------------
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -63,6 +63,7 @@
 import org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl;
 import org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl;
 import org.jboss.messaging.core.remoting.spi.ConnectorFactory;
+import org.jboss.messaging.core.server.MessagingService;
 import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
 import org.jboss.messaging.tests.util.ServiceTestBase;
 
@@ -82,6 +83,8 @@
    private static final long PING_INTERVAL = 500;
 
    // Attributes ----------------------------------------------------
+   
+   private MessagingService messagingService;
 
    // Static --------------------------------------------------------
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/scheduling/ScheduledMessageTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/scheduling/ScheduledMessageTest.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/scheduling/ScheduledMessageTest.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -34,6 +34,7 @@
 import org.jboss.messaging.core.config.Configuration;
 import org.jboss.messaging.core.logging.Logger;
 import org.jboss.messaging.core.message.impl.MessageImpl;
+import org.jboss.messaging.core.server.MessagingService;
 import org.jboss.messaging.core.settings.impl.QueueSettings;
 import org.jboss.messaging.core.transaction.impl.XidImpl;
 import org.jboss.messaging.jms.client.JBossTextMessage;
@@ -53,6 +54,8 @@
    private SimpleString atestq2 = new SimpleString("ascheduledtestq2");
 
    private Configuration configuration;
+   
+   private MessagingService messagingService;
 
    protected void setUp() throws Exception
    {

Added: trunk/tests/src/org/jboss/messaging/tests/performance/paging/MeasurePagingMultiThreadTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/performance/paging/MeasurePagingMultiThreadTest.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/performance/paging/MeasurePagingMultiThreadTest.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -0,0 +1,268 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.messaging.tests.performance.paging;
+
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.concurrent.CountDownLatch;
+
+import org.jboss.messaging.core.client.ClientMessage;
+import org.jboss.messaging.core.client.ClientProducer;
+import org.jboss.messaging.core.client.ClientSession;
+import org.jboss.messaging.core.client.ClientSessionFactory;
+import org.jboss.messaging.core.config.Configuration;
+import org.jboss.messaging.core.exception.MessagingException;
+import org.jboss.messaging.core.remoting.impl.ByteBufferWrapper;
+import org.jboss.messaging.core.remoting.spi.MessagingBuffer;
+import org.jboss.messaging.core.server.MessagingService;
+import org.jboss.messaging.core.settings.impl.QueueSettings;
+import org.jboss.messaging.tests.util.ServiceTestBase;
+import org.jboss.messaging.util.SimpleString;
+
+/**
+ * A MeasurePagingMultiThreadTest
+ *
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * 
+ * Created Dec 1, 2008 1:02:39 PM
+ *
+ *
+ */
+public class MeasurePagingMultiThreadTest extends ServiceTestBase
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   @Override
+   public void tearDown() throws Exception
+   {
+      super.tearDown();
+
+      deleteData();
+   }
+
+   @Override
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      clearData();
+   }
+
+   public void testPagingMultipleSenders() throws Throwable
+   {
+
+      final int NUMBER_OF_THREADS = 18;
+      final int NUMBER_OF_MESSAGES = 50000;
+      final int SIZE_OF_MESSAGE = 1024;
+
+      Configuration config = createDefaultConfig();
+
+      HashMap<String, QueueSettings> settings = new HashMap<String, QueueSettings>();
+
+      config.setPagingMaxGlobalSizeBytes(20 * 1024);
+
+      MessagingService messagingService = createService(true, config, settings);
+      messagingService.start();
+      try
+      {
+
+         final ClientSessionFactory factory = createInVMFactory();
+         final SimpleString adr = new SimpleString("test-adr");
+
+         createDestination(factory, adr);
+
+         // Send some messages to make sure the destination is in page mode before we measure
+         // And that will also help with VM optimizations
+         sendInitialBatch(adr, NUMBER_OF_MESSAGES, SIZE_OF_MESSAGE, factory);
+
+         final CountDownLatch latchAlign = new CountDownLatch(NUMBER_OF_THREADS);
+
+         final CountDownLatch latchStart = new CountDownLatch(1);
+
+         class Sender extends Thread
+         {
+
+            private final ClientSession session;
+
+            private final ClientProducer producer;
+
+            private final ClientMessage msg;
+
+            Throwable e;
+
+            public Sender() throws Exception
+            {
+               session = factory.createSession(false, true, true);
+               producer = session.createProducer(adr);
+               msg = session.createClientMessage(true);
+
+               ByteBuffer buffer = ByteBuffer.allocate(SIZE_OF_MESSAGE);
+               MessagingBuffer msgBuffer = new ByteBufferWrapper(buffer);
+               msg.setBody(msgBuffer);
+
+            }
+
+            // run is not going to close sessions or anything, as we don't want to measure that time
+            // so this will be done in a second time
+            public void cleanUp() throws Exception
+            {
+               session.close();
+            }
+
+            @Override
+            public void run()
+            {
+               try
+               {
+                  latchAlign.countDown();
+                  latchStart.await();
+
+                  long start = System.currentTimeMillis();
+                  sendMessages(NUMBER_OF_MESSAGES, producer, msg);
+                  long end = System.currentTimeMillis();
+
+                  System.out.println("Thread " + Thread.currentThread().getName() +
+                                     " finished sending in " +
+                                     (end - start) +
+                                     " milliseconds");
+               }
+               catch (Throwable e)
+               {
+                  this.e = e;
+               }
+
+            }
+         }
+
+         Sender senders[] = new Sender[NUMBER_OF_THREADS];
+
+         for (int i = 0; i < NUMBER_OF_THREADS; i++)
+         {
+            senders[i] = new Sender();
+            senders[i].start();
+         }
+
+         latchAlign.await();
+
+         long timeStart = System.currentTimeMillis();
+
+         latchStart.countDown();
+
+         for (Thread t : senders)
+         {
+            t.join();
+         }
+
+         long timeEnd = System.currentTimeMillis();
+
+         System.out.println("Total Time: " + (timeEnd - timeStart) +
+                            " milliseconds what represented " +
+                            (NUMBER_OF_MESSAGES * NUMBER_OF_THREADS * 1000 / (timeEnd - timeStart)) +
+                            " per second");
+
+         for (Sender s : senders)
+         {
+            if (s.e != null)
+            {
+               throw s.e;
+            }
+            s.cleanUp();
+         }
+
+      }
+      finally
+      {
+         messagingService.stop();
+
+      }
+
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   /**
+    * @param adr
+    * @param nMessages
+    * @param messageSize
+    * @param factory
+    * @throws MessagingException
+    */
+   private void sendInitialBatch(final SimpleString adr,
+                                 final int nMessages,
+                                 final int messageSize,
+                                 final ClientSessionFactory factory) throws MessagingException
+   {
+      ClientSession session = factory.createSession(false, true, true);
+      ClientProducer producer = session.createProducer(adr);
+      ClientMessage msg = session.createClientMessage(true);
+
+      ByteBuffer buffer = ByteBuffer.allocate(messageSize);
+      MessagingBuffer msgBuffer = new ByteBufferWrapper(buffer);
+      msg.setBody(msgBuffer);
+
+      sendMessages(nMessages, producer, msg);
+   }
+
+   /**
+    * @param nMessages
+    * @param producer
+    * @param msg
+    * @throws MessagingException
+    */
+   private void sendMessages(final int nMessages, final ClientProducer producer, final ClientMessage msg) throws MessagingException
+   {
+      for (int i = 0; i < nMessages; i++)
+      {
+         producer.send(msg);
+      }
+   }
+
+   /**
+    * @param factory
+    * @param adr
+    * @throws MessagingException
+    */
+   private void createDestination(final ClientSessionFactory factory, final SimpleString adr) throws MessagingException
+   {
+      {
+         ClientSession session = factory.createSession(false, false, false);
+         session.createQueue(adr, adr, null, true, false, false);
+         session.close();
+      }
+   }
+
+   // Inner classes -------------------------------------------------
+
+}

Modified: trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/tests/src/org/jboss/messaging/tests/soak/chunk/MessageChunkSoakTest.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -48,7 +48,7 @@
 
    public void testMessageChunkFilePersistence1G() throws Exception
    {
-      testChunks(true, true, 2, 268435456, false, 120000, 0, true);
+      testChunks(true, true, 2, 268435456, false, 300000, 0, true);
    }
 
    // Package protected ---------------------------------------------

Modified: trunk/tests/src/org/jboss/messaging/tests/stress/paging/PageStressTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/stress/paging/PageStressTest.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/tests/src/org/jboss/messaging/tests/stress/paging/PageStressTest.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -37,9 +37,9 @@
    // Constants -----------------------------------------------------
 
    // Attributes ----------------------------------------------------
+   
+   private MessagingService messagingService;
 
-   MessagingService service;
-
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
@@ -78,8 +78,8 @@
          settings.put("page-adr", setting);
       }
 
-      service = createService(true, config, settings);
-      service.start();
+      messagingService = createService(true, config, settings);
+      messagingService.start();
 
       ClientSessionFactory factory = createInVMFactory();
       factory.setBlockOnAcknowledge(true);
@@ -133,12 +133,12 @@
          
          session.close();
          
-         service.stop();
+         messagingService.stop();
          
          System.out.println("server stopped, nr msgs: " + msgs);
 
-         service = createService(true, config, settings);
-         service.start();
+         messagingService = createService(true, config, settings);
+         messagingService.start();
          
          
          factory = createInVMFactory();
@@ -171,7 +171,7 @@
       finally
       {
          session.close();
-         service.stop();
+         messagingService.stop();
       }
 
    }
@@ -207,8 +207,8 @@
          settings.put("page-adr", setting);
       }
 
-      service = createService(true, config, settings);
-      service.start();
+      messagingService = createService(true, config, settings);
+      messagingService.start();
 
       ClientSessionFactory factory = createInVMFactory();
       ClientSession session = null;
@@ -275,7 +275,7 @@
       finally
       {
          session.close();
-         service.stop();
+         messagingService.stop();
       }
 
    }

Modified: trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java	2008-12-01 12:44:59 UTC (rev 5443)
+++ trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java	2008-12-01 23:32:29 UTC (rev 5444)
@@ -81,8 +81,6 @@
 
    protected String temporaryDir = baseDir + "/temporary";
 
-   protected MessagingService messagingService;
-
    // Static --------------------------------------------------------
    private final Logger log = Logger.getLogger(this.getClass());
 




More information about the jboss-cvs-commits mailing list