[hornetq-commits] JBoss hornetq SVN: r11374 - in branches/HORNETQ-720_Replication: tests/integration-tests/src/test/java/org/hornetq/tests/integration/client and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Sep 20 07:53:57 EDT 2011


Author: borges
Date: 2011-09-20 07:53:56 -0400 (Tue, 20 Sep 2011)
New Revision: 11374

Removed:
   branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/TestSupportPageStore.java
Modified:
   branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
   branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java
   branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java
   branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
Log:
Delete TestSupportPageStore which serves no purpose.

Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java	2011-09-20 01:20:26 UTC (rev 11373)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java	2011-09-20 11:53:56 UTC (rev 11374)
@@ -67,7 +67,7 @@
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  *
  */
-public class PagingStoreImpl implements TestSupportPageStore
+public class PagingStoreImpl implements PagingStore
 {
    // Constants -----------------------------------------------------
 

Deleted: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/TestSupportPageStore.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/TestSupportPageStore.java	2011-09-20 01:20:26 UTC (rev 11373)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/TestSupportPageStore.java	2011-09-20 11:53:56 UTC (rev 11374)
@@ -1,25 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.core.paging.impl;
-
-import org.hornetq.core.paging.PagingStore;
-
-/**
- * All the methods required to TestCases on  PageStoreImpl
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public interface TestSupportPageStore extends PagingStore
-{
-}

Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java	2011-09-20 01:20:26 UTC (rev 11373)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java	2011-09-20 11:53:56 UTC (rev 11374)
@@ -55,7 +55,6 @@
 import org.hornetq.core.paging.PagingManager;
 import org.hornetq.core.paging.PagingStore;
 import org.hornetq.core.paging.cursor.impl.PagePositionImpl;
-import org.hornetq.core.paging.impl.TestSupportPageStore;
 import org.hornetq.core.persistence.OperationContext;
 import org.hornetq.core.persistence.impl.journal.OperationContextImpl;
 import org.hornetq.core.server.HornetQServer;
@@ -70,7 +69,7 @@
  * A PagingTest
  *
  * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
- * 
+ *
  * Created Dec 5, 2008 8:25:58 PM
  *
  *
@@ -967,6 +966,7 @@
 
             threads[start - 1] = new Thread()
             {
+               @Override
                public void run()
                {
                   try
@@ -1214,7 +1214,7 @@
     * - Consume the entire destination (not in page mode any more)
     * - Add stuff to a transaction again
     * - Check order
-    * 
+    *
     */
    public void testDepageDuringTransaction() throws Exception
    {
@@ -1355,9 +1355,9 @@
     * - Consume the entire destination (not in page mode any more)
     * - Add stuff to a transaction again
     * - Check order
-    * 
+    *
     *  Test under discussion at : http://community.jboss.org/thread/154061?tstart=0
-    * 
+    *
     */
    public void testDepageDuringTransaction2() throws Exception
    {
@@ -1680,6 +1680,7 @@
 
          Thread producerThread = new Thread()
          {
+            @Override
             public void run()
             {
                ClientSession sessionProducer = null;
@@ -1808,6 +1809,7 @@
 
          Thread producerThread = new Thread()
          {
+            @Override
             public void run()
             {
                ClientSession sessionProducer = null;
@@ -1962,7 +1964,7 @@
             message.getBodyBuffer().writeBytes(body);
             message.putIntProperty(new SimpleString("id"), i);
 
-            TestSupportPageStore store = (TestSupportPageStore)server.getPostOffice()
+            PagingStore store = server.getPostOffice()
                                                                      .getPagingManager()
                                                                      .getPageStore(PagingTest.ADDRESS);
 
@@ -2806,7 +2808,7 @@
          catch (Throwable ignored)
          {
          }
-         
+
          OperationContextImpl.clearContext();
       }
 
@@ -3181,6 +3183,7 @@
 
          Thread consumeThread = new Thread()
          {
+            @Override
             public void run()
             {
                ClientSession sessionConsumer = null;
@@ -3584,7 +3587,7 @@
             message.setBodyInputStream(createFakeLargeStream(messageSize));
 
             producer.send(message);
-            
+
             if ((i + 1) % 2 == 0)
             {
                session.commit();
@@ -3598,27 +3601,27 @@
          ClientConsumer cons = session.createConsumer(ADDRESS);
 
          ClientMessage msg = null;
-         
+
          for (int msgNr = 0 ; msgNr < 2; msgNr++)
          {
             for (int i = 0 ; i < 5; i++)
             {
                msg = cons.receive(5000);
-      
+
                assertNotNull(msg);
-      
+
                msg.acknowledge();
-      
+
                assertEquals("str" + msgNr, msg.getStringProperty("id"));
-   
+
                for (int j = 0; j < messageSize; j++)
                {
                   assertEquals(getSamplebyte(j), msg.getBodyBuffer().readByte());
                }
-   
+
                session.rollback();
             }
-            
+
             pgStoreDLA.startPaging();
          }
 
@@ -3639,27 +3642,27 @@
             });
 
          }
-         
+
          assertNull(cons.receiveImmediate());
 
          cons.close();
-         
+
          sf.close();
-         
+
          locator.close();
-         
+
          server.stop();
-         
+
          server.start();
-         
+
          locator = createInVMNonHALocator();
-         
+
          sf = locator.createSessionFactory();
-         
+
          session = sf.createSession(false, false);
-         
+
          session.start();
-         
+
          cons = session.createConsumer(ADDRESS);
 
          for (int i = 2; i < 100; i++)
@@ -3678,9 +3681,9 @@
                }
             });
          }
-         
+
          cons.close();
-         
+
          cons = session.createConsumer("DLA");
 
          for (int msgNr = 0 ; msgNr < 2; msgNr++)
@@ -3688,38 +3691,38 @@
             msg = cons.receive(5000);
 
             assertNotNull(msg);
-            
+
             assertEquals("str" + msgNr, msg.getStringProperty("id"));
 
             for (int i = 0; i < messageSize; i++)
             {
                assertEquals(getSamplebyte(i), msg.getBodyBuffer().readByte());
             }
-   
+
             msg.acknowledge();
          }
-         
+
          cons.close();
-         
+
          cons = session.createConsumer(ADDRESS);
-         
+
          session.commit();
-         
+
          assertNull(cons.receiveImmediate());
-         
+
          long timeout = System.currentTimeMillis() + 5000;
-         
+
          pgStoreAddress = server.getPagingManager().getPageStore(ADDRESS);
-         
+
          pgStoreAddress.getCursorProvider().getSubscription(server.locateQueue(ADDRESS).getID()).cleanupEntries();
-         
+
          pgStoreAddress.getCursorProvider().cleanup();
-         
+
          while (timeout > System.currentTimeMillis() && pgStoreAddress.isPaging())
          {
             Thread.sleep(50);
          }
-         
+
          assertFalse(pgStoreAddress.isPaging());
 
          session.commit();
@@ -3791,7 +3794,7 @@
             message = session.createMessage(true);
 
             message.putStringProperty("id", "str" + i);
-            
+
             message.setExpiration(System.currentTimeMillis() + 2000);
 
             if (i % 2 == 0)
@@ -3809,7 +3812,7 @@
             }
 
             producer.send(message);
-            
+
             if ((i + 1) % 2 == 0)
             {
                session.commit();
@@ -3821,30 +3824,30 @@
          }
 
          session.commit();
-         
+
          sf.close();
-         
+
          locator.close();
-         
+
          server.stop();
-         
+
          Thread.sleep(3000);
-         
+
          server.start();
-         
+
          locator = createInVMNonHALocator();
-         
+
          sf = locator.createSessionFactory();
-         
+
          session = sf.createSession(false, false);
-         
+
          session.start();
-         
+
          ClientConsumer consAddr = session.createConsumer(ADDRESS);
-         
+
          assertNull(consAddr.receive(1000));
-         
-         
+
+
          ClientConsumer cons = session.createConsumer("DLA");
 
          for (int i = 0; i < 500; i++)
@@ -3863,22 +3866,22 @@
                }
             });
          }
-         
+
          assertNull(cons.receiveImmediate());
-         
+
          session.commit();
-         
+
          cons.close();
-         
+
          long timeout = System.currentTimeMillis() + 5000;
-         
+
          pgStoreAddress = server.getPagingManager().getPageStore(ADDRESS);
-         
+
          while (timeout > System.currentTimeMillis() && pgStoreAddress.isPaging())
          {
             Thread.sleep(50);
          }
-         
+
          assertFalse(pgStoreAddress.isPaging());
 
          session.close();

Modified: branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java	2011-09-20 01:20:26 UTC (rev 11373)
+++ branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java	2011-09-20 11:53:56 UTC (rev 11374)
@@ -23,9 +23,9 @@
 import org.hornetq.api.core.SimpleString;
 import org.hornetq.core.paging.Page;
 import org.hornetq.core.paging.PagedMessage;
+import org.hornetq.core.paging.PagingStore;
 import org.hornetq.core.paging.impl.PagingManagerImpl;
 import org.hornetq.core.paging.impl.PagingStoreFactoryNIO;
-import org.hornetq.core.paging.impl.TestSupportPageStore;
 import org.hornetq.core.persistence.impl.nullpm.NullStorageManager;
 import org.hornetq.core.server.ServerMessage;
 import org.hornetq.core.server.impl.RoutingContextImpl;
@@ -40,7 +40,7 @@
 import org.hornetq.utils.OrderedExecutorFactory;
 
 /**
- * 
+ *
  * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
  *
  */
@@ -64,13 +64,13 @@
       AddressSettings settings = new AddressSettings();
       settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
       addressSettings.setDefault(settings);
-      
-      
+
+
       PagingStoreFactoryNIO storeFactory = new PagingStoreFactoryNIO(getPageDir(),
                                                                      100, null,
                                 new OrderedExecutorFactory(Executors.newCachedThreadPool()),
                                 true);
-      
+
       storeFactory.setPostOffice(new FakePostOffice());
 
       PagingManagerImpl managerImpl = new PagingManagerImpl(storeFactory,
@@ -79,7 +79,7 @@
 
       managerImpl.start();
 
-      TestSupportPageStore store = (TestSupportPageStore)managerImpl.getPageStore(new SimpleString("simple-test"));
+      PagingStore store = managerImpl.getPageStore(new SimpleString("simple-test"));
 
       ServerMessage msg = createMessage(1l, new SimpleString("simple-test"), createRandomBuffer(10));
 

Modified: branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java	2011-09-20 01:20:26 UTC (rev 11373)
+++ branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java	2011-09-20 11:53:56 UTC (rev 11374)
@@ -40,7 +40,6 @@
 import org.hornetq.core.paging.PagingStoreFactory;
 import org.hornetq.core.paging.impl.PageTransactionInfoImpl;
 import org.hornetq.core.paging.impl.PagingStoreImpl;
-import org.hornetq.core.paging.impl.TestSupportPageStore;
 import org.hornetq.core.persistence.StorageManager;
 import org.hornetq.core.persistence.impl.nullpm.NullStorageManager;
 import org.hornetq.core.postoffice.PostOffice;
@@ -153,7 +152,8 @@
 
       AddressSettings addressSettings = new AddressSettings();
       addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      TestSupportPageStore storeImpl = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
+      PagingStore storeImpl =
+               new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                            null,
                                                            100,
                                                            createMockManager(),
@@ -218,7 +218,8 @@
 
       AddressSettings addressSettings = new AddressSettings();
       addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      TestSupportPageStore storeImpl = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
+      PagingStoreImpl storeImpl =
+               new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                            null,
                                                            100,
                                                            createMockManager(),
@@ -294,7 +295,8 @@
 
       AddressSettings addressSettings = new AddressSettings();
       addressSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
-      TestSupportPageStore storeImpl = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
+      PagingStore storeImpl =
+               new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                            null,
                                                            100,
                                                            createMockManager(),
@@ -442,7 +444,8 @@
       settings.setPageSizeBytes(MAX_SIZE);
       settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
 
-      final TestSupportPageStore storeImpl = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
+      final PagingStore storeImpl =
+               new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                                  null,
                                                                  100,
                                                                  createMockManager(),
@@ -606,7 +609,8 @@
          fileTmp.close();
       }
 
-      TestSupportPageStore storeImpl2 = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
+      PagingStore storeImpl2 =
+               new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                             null,
                                                             100,
                                                             createMockManager(),
@@ -692,7 +696,8 @@
       settings.setPageSizeBytes(MAX_SIZE);
       settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
 
-      final TestSupportPageStore storeImpl = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
+      final PagingStore storeImpl =
+               new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                                  null,
                                                                  100,
                                                                  createMockManager(),
@@ -735,7 +740,8 @@
       settings.setPageSizeBytes(MAX_SIZE);
       settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
 
-      final TestSupportPageStore storeImpl = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
+      final PagingStore storeImpl =
+               new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                                  null,
                                                                  100,
                                                                  createMockManager(),



More information about the hornetq-commits mailing list