[jboss-cvs] JBoss Messaging SVN: r5995 - in trunk: tests/jms-tests/src/org/jboss/test/messaging/jms and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 4 09:59:25 EST 2009


Author: jmesnil
Date: 2009-03-04 09:59:25 -0500 (Wed, 04 Mar 2009)
New Revision: 5995

Removed:
   trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JCAWrapperTest.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/MemLeakTest.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/manual/ManualPagingSoakTest.java
Modified:
   trunk/build-messaging.xml
Log:
removed tests (they were excluded from jms-tests)

Modified: trunk/build-messaging.xml
===================================================================
--- trunk/build-messaging.xml	2009-03-04 14:37:48 UTC (rev 5994)
+++ trunk/build-messaging.xml	2009-03-04 14:59:25 UTC (rev 5995)
@@ -1227,11 +1227,9 @@
                <include name="**/messaging/**/${test-mask}.class"/>
                <include name="**/jms/**/${test-mask}.class"/>
                <include name="**/messaging/util/**/${test-mask}.class"/>
-               <exclude name="**/jms/JCAWrapperTest.class"/>
                <exclude name="**/jms/XARecoveryTest.class"/>
                <exclude name="**/jms/XAResourceRecoveryTest.class"/>
                <exclude name="**/jms/XATest.class"/>
-               <exclude name="**/jms/MemLeakTest.class"/>
                <exclude name="**/jms/stress/**"/>
                <exclude name="**/jms/bridge/**"/>
                <exclude name="**/jms/manual/**"/>

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JCAWrapperTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JCAWrapperTest.java	2009-03-04 14:37:48 UTC (rev 5994)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JCAWrapperTest.java	2009-03-04 14:59:25 UTC (rev 5995)
@@ -1,183 +0,0 @@
-/*
-  * 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.test.messaging.jms;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.transaction.Transaction;
-import javax.transaction.UserTransaction;
-
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.tm.TransactionManagerLocator;
-
-/**
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- *
- * $Id: JCAWrapperTest.java 1019 2006-07-17 17:15:04Z timfox $
- */
-public class JCAWrapperTest extends JMSTestCase
-{
-   // Constants -----------------------------------------------------
-   
-   // Static --------------------------------------------------------
-   
-   // Attributes ----------------------------------------------------
-
-   // Constructors --------------------------------------------------
-   
-   public JCAWrapperTest(String name)
-   {
-      super(name);
-   }
-   
-   // Public --------------------------------------------------------
-
-   public void testSimpleTransactedSend() throws Exception
-   {
-      Transaction suspended = TransactionManagerLocator.getInstance().locate().suspend();
-      
-      Connection conn = null;
-      
-      try
-      {
-         
-         ConnectionFactory mcf = (ConnectionFactory)ic.lookup("java:/JCAConnectionFactory");
-         conn = mcf.createConnection();
-         conn.start();
-   
-         UserTransaction ut = ServerManagement.getUserTransaction();
-   
-         ut.begin();
-   
-         Session s = conn.createSession(true, Session.SESSION_TRANSACTED);
-         MessageProducer p = s.createProducer(queue1);
-         Message m = s.createTextMessage("one");
-   
-         p.send(m);
-   
-         ut.commit();
-   
-         conn.close();
-   
-         ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
-         conn = cf.createConnection();
-         s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         conn.start();
-   
-         TextMessage rm = (TextMessage)s.createConsumer(queue1).receive(500);
-   
-         assertEquals("one", rm.getText());
-
-         conn.close();
-         
-         log.info("**** class is " + mcf);                  
-      }
-      finally
-      {      
-         if (conn != null)
-         {
-         	conn.close();
-         }
-         
-         if (suspended != null)
-         {
-            TransactionManagerLocator.getInstance().locate().resume(suspended);
-         }                  
-      }
-   }
-
-   /**
-    * The difference from the previous test is that we're creating the session using
-    * conn.createSession(false, ...);
-    */
-   public void testSimpleTransactedSend2() throws Exception
-   {
-      Transaction suspended = TransactionManagerLocator.getInstance().locate().suspend();
-      
-      Connection conn = null;
-
-      try
-      {
-         ConnectionFactory mcf = (ConnectionFactory)ic.lookup("java:/JCAConnectionFactory");
-         conn = mcf.createConnection();
-         conn.start();
-
-         UserTransaction ut = ServerManagement.getUserTransaction();
-
-         ut.begin();
-
-         Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer p = s.createProducer(queue1);
-         Message m = s.createTextMessage("one");
-
-         p.send(m);
-
-         ut.commit();
-
-         conn.close();
-
-         ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
-         conn = cf.createConnection();
-         s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         conn.start();
-
-         TextMessage rm = (TextMessage)s.createConsumer(queue1).receive(500);
-
-         assertEquals("one", rm.getText());
-      }
-      finally
-      {         
-         if (conn != null)
-         {
-         	conn.close();
-         }
-
-         if (suspended != null)
-         {
-            TransactionManagerLocator.getInstance().locate().resume(suspended);
-         }
-      }
-   }
-
-   // Package protected ---------------------------------------------
-   
-   // Protected -----------------------------------------------------
-   
-   protected void tearDown() throws Exception
-   {
-   	//We don't want the managed connection pool hanging on to connections
-      ServerManagement.getServer(0).flushManagedConnectionPool();
-      
-   	super.tearDown();   	
-   }
-
-   // Private -------------------------------------------------------
-   
-   // Inner classes -------------------------------------------------
-   
-}
-
-

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/MemLeakTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/MemLeakTest.java	2009-03-04 14:37:48 UTC (rev 5994)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/MemLeakTest.java	2009-03-04 14:59:25 UTC (rev 5995)
@@ -1,700 +0,0 @@
-/*
-  * 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.test.messaging.jms;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.jms.client.JBossConnectionFactory;
-import org.jboss.profiler.jvmti.InventoryDataPoint;
-import org.jboss.profiler.jvmti.JVMTIInterface;
-import org.jboss.test.messaging.JBMServerTestCase;
-
-/**
- * 
- * These tests should be run manually with a profiler running.
- * After running the heap should be inspected to ensure there are no unexpected objects.
- * Ideally we would automate this.
- * 
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class MemLeakTest extends JBMServerTestCase
-{
-   // Constants -----------------------------------------------------
-
-
-   private static final Logger log = Logger.getLogger(MemLeakTest.class);
-
-
-   // Static --------------------------------------------------------
-
-   /*public static void main(String[] args)
-   {
-      try
-      {
-         MemLeakTest tests = new MemLeakTest("MemLeakTest");
-         tests.setUp();
-         tests.testRemotingMemLeaks();
-         tests.tearDown();
-      }
-      catch (Throwable e)
-      {
-         e.printStackTrace();
-      }
-   } */
-
-   // Attributes ----------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public MemLeakTest(String name)
-   {
-      super(name);
-   }
-
-   // TestCase overrides -------------------------------------------
-
-   
-   /** @todo I can't execute this test if executed with testExpressionParginMessages. That's why I renamed it. */
-   public void renamedtestNonTxSendReceiveNP() throws Exception
-   {
-      log.info("testNonTxSendReceiveNP");
-      //Thread.sleep(10000);
-      
-      InitialContext initialContext = getInitialContext();
-      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");
-
-      createQueue("Queue");
-      
-      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
-      
-      Connection conn = cf.createConnection();
-
-      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      MessageProducer prod = sess.createProducer(queue);
-
-      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-      final int NUM_MESSAGES = 1000;
-      
-      //send some messages
-      
-      conn.start();
-      MessageConsumer cons = sess.createConsumer(queue);
-
-      produceMessages(sess, prod, 100, cons);
-      
-      JVMTIInterface jvmti = new JVMTIInterface();
-      Map inventory1=jvmti.produceInventory();
-      log.info("Producing first snapshot");
-      produceMessages(sess, prod, NUM_MESSAGES, cons);
-      log.info("Producing second snapshot");
-      jvmti.forceReleaseOnSoftReferences();
-      jvmti.forceGC();
-      Map inventory2 = jvmti.produceInventory();
-      
-      log.info("inventory1.size=" + inventory1.size());
-      log.info("inventory2.size=" + inventory2.size());
-      
-      assertTrue("Test produced unexpected objects",jvmti.compareInventories(System.out, inventory1,inventory2,null, null, new InventoryDataPoint[] {new InventoryDataPoint(Object.class,10)}));
-            
-      conn.close();
-      
-      conn = null;
-      
-      sess = null;
-      
-      prod = null;
-      
-      cons = null;
-      
-      queue = null;
-      
-      cf = null;
-   }
-
-   private void produceMessages(Session sess, MessageProducer prod, final int NUM_MESSAGES, MessageConsumer cons) throws JMSException
-   {
-      for (int i = 0; i < NUM_MESSAGES; i++)
-      {
-
-         TextMessage m = sess.createTextMessage("hello" + i);
-         
-         prod.send(m);
-         
-         log.info("Sent " + i);
-
-      }
-      //receive
-      
-      for (int i = 0; i < NUM_MESSAGES; i++)
-      {
-         cons.receive();
-         log.info("Received " + i);
-      }
-   }
-   
-   public void testExpressionParsingMessages() throws Exception
-   {
-      log.info("testExpressionParsingMessages");
-      //Thread.sleep(10000);
-      
-      InitialContext initialContext = getInitialContext();
-      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");
-
-      createQueue("Queue");
-      
-      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
-      
-      Connection conn = cf.createConnection();
-
-      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      MessageProducer prod = sess.createProducer(queue);
-
-      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-
-      //send some messages
-      ArrayList payLoad = new ArrayList();
-      for (int i=0;i<100;i++)
-      {
-         payLoad.add("" + i);
-      }
-      conn.start();
-      MessageConsumer cons1 = sess.createConsumer(queue,"target='1'");
-      MessageConsumer cons2 = sess.createConsumer(queue,"target='2'");
-
-      produceMessages(sess, prod, 30, cons1,cons2,payLoad);
-      
-      JVMTIInterface jvmti = new JVMTIInterface();
-      Map inventory1=jvmti.produceInventory();
-      log.info("Producing first snapshot");
-      produceMessages(sess, prod, 10, cons1,cons2,payLoad);
-      produceMessages(sess, prod, 10, cons1,cons2,payLoad);
-      produceMessages(sess, prod, 10, cons1,cons2,payLoad);
-      produceMessages(sess, prod, 10, cons1,cons2,payLoad);
-      produceMessages(sess, prod, 10, cons1,cons2,payLoad);
-      produceMessages(sess, prod, 10, cons1,cons2,payLoad);
-      log.info("Producing second snapshot");
-      Map inventory2 = jvmti.produceInventory();
-      
-      log.info("inventory1.size=" + inventory1.size());
-      log.info("inventory2.size=" + inventory2.size());
-      
-      assertTrue("Test produced unexpected objects",jvmti.compareInventories(System.out, inventory1,inventory2,null, null, new InventoryDataPoint[] {new InventoryDataPoint(Object.class,10)}));
-      
-      conn.close();
-      
-      conn = null;
-      
-      sess = null;
-      
-      prod = null;
-      
-      cons1 = null;
-      cons2 = null;
-      
-      queue = null;
-      
-      cf = null;
-   }
-
-   
-   private void produceMessages(Session sess, MessageProducer prod, final int NUM_MESSAGES, MessageConsumer cons1, MessageConsumer cons2, Object payload) throws Exception
-   {
-      for (int i = 0; i < NUM_MESSAGES; i++)
-      {
-
-         ObjectMessage  m = sess.createObjectMessage();
-         m.setObject((Serializable)payload);
-         if (i%2==0)
-         {
-            m.setStringProperty("target","1");
-         }
-         else
-         {
-            m.setStringProperty("target","2");
-         }
-         
-         
-         prod.send(m);
-         
-         log.info("Sent " + i);
-
-      }
-      //receive
-      
-      for (int i = 0; i < NUM_MESSAGES/2; i++)
-      {
-         cons1.receive();
-         log.info("Received " + i);
-      }
-      log.info("Starting second queue");
-      for (int i = 0; i < NUM_MESSAGES/2; i++)
-      {
-         cons2.receive();
-         log.info("Received " + i);
-      }
-   }
-   
-
-
-   //   public void testManyConns() throws Exception
-//   {
-//      log.info("Pausing");
-//      Thread.sleep(10000);
-//      
-//      InitialContext initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
-//      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");
-//
-//      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
-//      
-//      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
-//      
-//      
-//      for (int i = 0; i < 200; i++)
-//      {
-//      
-//         
-//         Connection conn = cf.createConnection();
-//   
-//         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-//   
-//         MessageProducer prod = sess.createProducer(queue);
-//   
-//         prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-//   
-//         //send a message
-//         
-//         Message m = sess.createTextMessage("hello" + i);
-//   
-//         prod.send(m);
-//         
-//         log.info("Sent " + i);
-//   
-//         conn.start();
-//         
-//         MessageConsumer cons = sess.createConsumer(queue);
-//         
-//         //receive
-//         
-//         m = cons.receive();
-//                              
-//         conn.close();
-//         
-//         log.info("i:" + i);
-//      }
-//
-//      queue = null;
-//      
-//      cf = null;
-//      
-//      Thread.sleep(20 * 60 * 1000);
-//   }
-//   
-//   public void testNonTxSendReceiveP() throws Exception
-//   {
-//      log.info("Pausing");
-//      Thread.sleep(10000);
-//      
-//      InitialContext initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
-//      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");
-//
-//      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
-//      
-//      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
-//      
-//      Connection conn = cf.createConnection();
-//
-//      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-//
-//      MessageProducer prod = sess.createProducer(queue);
-//
-//      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
-//
-//      final int NUM_MESSAGES = 1000;
-//      
-//      //send some messages
-//      
-//      String s = new GUID().toString();
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         TextMessage m = sess.createTextMessage(s);
-//
-//         prod.send(m);
-//         
-//         log.info("Sent " + i);
-//
-//      }
-//      
-//      conn.start();
-//      
-//      MessageConsumer cons = sess.createConsumer(queue);
-//      
-//      //receive
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         Message m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//            
-//      conn.close();
-//      
-//      conn = null;
-//      
-//      sess = null;
-//      
-//      prod = null;
-//      
-//      cons = null;
-//      
-//      queue = null;
-//      
-//      cf = null;
-//      
-//      Thread.sleep(20 * 60 * 1000);
-//   }
-//   
-//   
-//   public void testTxSendReceiveNP() throws Exception
-//   {
-//      log.info("Pausing");
-//      Thread.sleep(10000);
-//      
-//      InitialContext initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
-//      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");
-//
-//      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
-//      
-//      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
-//      
-//      Connection conn = cf.createConnection();
-//
-//      Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
-//
-//      MessageProducer prod = sess.createProducer(queue);
-//
-//      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-//
-//      final int NUM_MESSAGES = 100;
-//      
-//      //send some messages
-//      
-//      String s = new GUID().toString();
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         TextMessage m = sess.createTextMessage(s);
-//
-//         prod.send(m);
-//         
-//         log.info("Sent " + i);
-//
-//      }
-//      
-//      sess.rollback();
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         TextMessage m = sess.createTextMessage(s);
-//
-//         prod.send(m);
-//         
-//         log.info("Sent " + i);
-//
-//      }
-//      
-//      sess.commit();
-//      
-//      conn.start();
-//      
-//      MessageConsumer cons = sess.createConsumer(queue);
-//      
-//      //receive
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         Message m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//      
-//      sess.rollback();
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         Message m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//      
-//      sess.commit();
-//                        
-//      conn.close();
-//      
-//      conn = null;
-//      
-//      sess = null;
-//      
-//      prod = null;
-//      
-//      cons = null;
-//      
-//      queue = null;
-//      
-//      cf = null;
-//      
-//      Thread.sleep(20 * 60 * 1000);
-//   }
-//   
-//   public void testTxSendReceiveP() throws Exception
-//   {
-//      log.info("Pausing");
-//      Thread.sleep(10000);
-//      
-//      InitialContext initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
-//      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");
-//
-//      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
-//      
-//      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
-//      
-//      Connection conn = cf.createConnection();
-//
-//      Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
-//
-//      MessageProducer prod = sess.createProducer(queue);
-//
-//      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-//
-//      final int NUM_MESSAGES = 100;
-//      
-//      //send some messages
-//      
-//      String s = new GUID().toString();
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         TextMessage m = sess.createTextMessage(s);
-//
-//         prod.send(m);
-//         
-//         log.info("Sent " + i);
-//
-//      }
-//      
-//      sess.rollback();
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         TextMessage m = sess.createTextMessage(s);
-//
-//         prod.send(m);
-//         
-//         log.info("Sent " + i);
-//
-//      }
-//      
-//      sess.commit();
-//      
-//      conn.start();
-//      
-//      MessageConsumer cons = sess.createConsumer(queue);
-//      
-//      //receive
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         Message m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//      
-//      sess.rollback();
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         Message m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//      
-//      sess.commit();
-//                        
-//      conn.close();
-//      
-//      conn = null;
-//      
-//      sess = null;
-//      
-//      prod = null;
-//      
-//      cons = null;
-//      
-//      queue = null;
-//      
-//      cf = null;
-//      
-//      Thread.sleep(20 * 60 * 1000);
-//   }
-//   
-//   
-//   public void testSendReceiveClientAckNP() throws Exception
-//   {
-//      log.info("Pausing");
-//      Thread.sleep(10000);
-//      
-//      InitialContext initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
-//      ConnectionFactory cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");
-//
-//      ServerManagement.deployQueue("Queue", 10000, 1000, 1000);
-//      
-//      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
-//      
-//      Connection conn = cf.createConnection();
-//
-//      Session sess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-//
-//      MessageProducer prod = sess.createProducer(queue);
-//
-//      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-//
-//      final int NUM_MESSAGES = 100;
-//      
-//      //send some messages
-//      
-//      for (int i = 0; i < NUM_MESSAGES; i++)
-//      {
-//
-//         TextMessage m = sess.createTextMessage("hello" + i);
-//
-//         prod.send(m);
-//         
-//         log.info("Sent " + i);
-//
-//      }
-//      
-//      conn.start();
-//      
-//      MessageConsumer cons = sess.createConsumer(queue);
-//      
-//      //receive
-//      
-//      Message m = null;
-//      
-//      for (int i = 0; i < NUM_MESSAGES / 2; i++)
-//      {
-//
-//         m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//      
-//      m.acknowledge();
-//      
-//      for (int i = 0; i < NUM_MESSAGES / 2; i++)
-//      {
-//
-//         m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//      
-//      //don't ack
-//      
-//      sess.close();
-//      
-//      sess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-//      
-//      cons = sess.createConsumer(queue);
-//      
-//      //ack the rest
-//      
-//      for (int i = 0; i < NUM_MESSAGES / 2; i++)
-//      {
-//
-//         m = cons.receive();
-//         
-//         log.info("Received " + i);
-//
-//      }
-//      
-//      m.acknowledge();
-//                 
-//      conn.close();
-//      
-//      conn = null;
-//      
-//      sess = null;
-//      
-//      prod = null;
-//      
-//      cons = null;
-//      
-//      queue = null;
-//      
-//      cf = null;
-//      
-//      Thread.sleep(20 * 60 * 1000);
-//   }
-
-
-
-}

Deleted: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/manual/ManualPagingSoakTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/manual/ManualPagingSoakTest.java	2009-03-04 14:37:48 UTC (rev 5994)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/manual/ManualPagingSoakTest.java	2009-03-04 14:59:25 UTC (rev 5995)
@@ -1,173 +0,0 @@
-/*
- * 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.test.messaging.jms.manual;
-
-import java.util.Properties;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import org.jboss.test.messaging.MessagingTestCase;
-
-
-public class ManualPagingSoakTest extends MessagingTestCase
-{
-   protected Context ic1;
- 
-   protected Queue queue;
-   
-   protected Topic topic;
-     
-   protected ConnectionFactory cf;
-        
-   public ManualPagingSoakTest(String name)
-   {
-      super(name);
-   }
-
-   protected void setUp() throws Exception
-   {
-      super.setUp();
-      
-      Properties props1 = new Properties();
-      
-      props1.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
-      props1.put(Context.PROVIDER_URL, "jnp://localhost:1099");
-      props1.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
-      
-      ic1 = new InitialContext(props1);
-                  
-      queue = (Queue)ic1.lookup("queue/testQueue");
-      
-      topic = (Topic)ic1.lookup("topic/testTopic");
-      
-      cf = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-      
-   }
-
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-      
-      ic1.close();
-   }
-
-   /** Use these attributes on testQueue for this test:
-
-      <attribute name="FullSize">10000</attribute>
-      <attribute name="PageSize">1000</attribute>
-      <attribute name="DownCacheSize">1000</attribute>
-    * */
-   public void testPaging() throws Exception
-   {
-      Connection conn = null;
-         
-      try
-      {
-         conn = cf.createConnection();
-
-         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         
-         conn.start();
-         MessageConsumer cons = sess.createConsumer(queue);
-         receiveMessages(cons);
-         cons.close();
-         cons = null;
-
-         conn.stop();
-
-
-
-         MessageProducer prod = sess.createProducer(queue);
-         
-         prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-         
-         final int NUM_MESSAGES = 150000;
-         
-         byte[] bytes = new byte[2048];
-         
-         String s = new String(bytes);
-         
-         for (int i = 0; i < NUM_MESSAGES; i++)
-         {
-            TextMessage tm = sess.createTextMessage(s);
-            
-            prod.send(tm);
-            
-            if (i % 1000 == 0)
-            {
-               log.info("Sent " + i);
-            }
-         }
-         
-         log.info("Receiving");
-         
-         cons = sess.createConsumer(queue);
-         
-         conn.start();
-
-         int numberOfMessages = receiveMessages(cons);
-
-
-         log.info("Received " + numberOfMessages + " messages");
-
-         assertEquals(NUM_MESSAGES, numberOfMessages);   
-
-
-
-      }
-      finally
-      {      
-         if (conn != null) conn.close();
-      }
-   }
-
-   private int receiveMessages(MessageConsumer cons)
-      throws JMSException
-   {
-      TextMessage msg = null;
-
-      int numberOfMessages=0;
-      do
-         {
-            msg = (TextMessage)cons.receive(20000);
-
-         if (msg!=null) numberOfMessages++;
-
-         if (numberOfMessages % 1000 == 0)
-         {
-            log.info("Received " + numberOfMessages);
-         }
-      } while (msg!=null);
-      return numberOfMessages;
-   }
-}




More information about the jboss-cvs-commits mailing list