[jboss-cvs] JBossAS SVN: r91208 - in branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 14 09:11:39 EDT 2009


Author: wolfc
Date: 2009-07-14 09:11:39 -0400 (Tue, 14 Jul 2009)
New Revision: 91208

Removed:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueBean.java
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueRemote.java
Modified:
   branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/unit/MessageInflowTransactionUnitTestCase.java
Log:
JBPAPP-2260: cleanup unit test

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueBean.java	2009-07-14 13:01:24 UTC (rev 91207)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueBean.java	2009-07-14 13:11:39 UTC (rev 91208)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp2260;
-
-import javax.annotation.Resource;
-import javax.ejb.Stateless;
-import javax.jms.DeliveryMode;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.TemporaryQueue;
-import javax.jms.TextMessage;
-
-import org.jboss.logging.Logger;
-
-/**
- * Create some messages on a queue within the same VM.
- * 
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Stateless
-//@TransactionManagement(TransactionManagementType.BEAN)
-public class StressQueueBean implements StressQueueRemote
-{
-   private static final Logger log = Logger.getLogger(StressQueueBean.class);
-   
-   private static final String QUEUE_NAME = "jbpapp2260";
-   
-   @Resource(mappedName="java:/JmsXA")
-   private QueueConnectionFactory factory;
-   
-   @Resource(mappedName="queue/" + QUEUE_NAME)
-   private Queue queue;
-   
-   public void fireMessages(int num) throws Exception
-   {
-      QueueConnection conn = factory.createQueueConnection();
-      try
-      {
-         QueueSession session = conn.createQueueSession(true, QueueSession.SESSION_TRANSACTED);
-         TemporaryQueue replyQueue = session.createTemporaryQueue();
-         QueueReceiver receiver = session.createReceiver(replyQueue);
-         QueueSender sender = session.createSender(queue);
-         conn.start();
-         try
-         {
-            log.info("Firing messages...");
-            
-            for(int i = 0; i < num; i++)
-            {
-               TextMessage msg = session.createTextMessage("message #" + i);
-               msg.setJMSReplyTo(replyQueue);
-               msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
-               msg.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 1);
-         
-               sender.send(msg);
-            }
-            
-            //session.commit();
-            
-            /*
-            log.info("Waiting for replies...");
-            
-            for(int i = 0; i < num; i++)
-            {
-               Message reply = receiver.receive(5000);
-               if(reply == null)
-                  throw new IllegalStateException("received null reply");
-               
-               Serializable obj = ((ObjectMessage) reply).getObject();
-               if(obj instanceof Exception)
-                  throw (Exception) obj;
-            }
-            */
-            
-            log.info("Sleeping...");
-            Thread.sleep(40000);
-            
-            log.info("Done");
-         }
-         finally
-         {
-            //conn.stop();
-            sender.close();
-            receiver.close();
-            session.close();
-         }
-      }
-      finally
-      {
-         conn.close();
-      }
-   }
-}

Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueRemote.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueRemote.java	2009-07-14 13:01:24 UTC (rev 91207)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/StressQueueRemote.java	2009-07-14 13:11:39 UTC (rev 91208)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejb3.test.jbpapp2260;
-
-import javax.ejb.Remote;
-
-/**
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Remote
-public interface StressQueueRemote
-{
-   void fireMessages(int num) throws Exception;
-}

Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/unit/MessageInflowTransactionUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/unit/MessageInflowTransactionUnitTestCase.java	2009-07-14 13:01:24 UTC (rev 91207)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbpapp2260/unit/MessageInflowTransactionUnitTestCase.java	2009-07-14 13:11:39 UTC (rev 91208)
@@ -36,13 +36,10 @@
 import javax.jms.QueueSession;
 import javax.jms.TemporaryQueue;
 import javax.jms.TextMessage;
-import javax.management.ObjectName;
-import javax.transaction.Status;
 
 import junit.framework.Test;
 
 import org.jboss.ejb3.test.common.EJB3TestCase;
-import org.jboss.ejb3.test.jbpapp2260.StressQueueRemote;
 import org.jboss.logging.Logger;
 
 /**
@@ -109,12 +106,6 @@
       }
    }
    
-   public void _testBreak() throws Exception
-   {
-      Object result = sendMessage(QUEUE_NAME, "abort");
-      System.out.println("testBreak: result = " + result);
-   }
-   
    public void testDefault() throws Exception
    {
       Map<String, AtomicInteger> result = (Map<String, AtomicInteger>) sendMessage(QUEUE_NAME, "testDefault");
@@ -125,32 +116,6 @@
       assertEquals(base + 2, result.size());
    }
    
-   public void _testDefault2() throws Exception
-   {
-      StressQueueRemote bean = lookup("StressQueueBean/remote", StressQueueRemote.class);
-      
-      bean.fireMessages(100);
-   }
-   
-   public void _testRuntimeException() throws Exception
-   {
-      ObjectName name = new ObjectName("jboss.j2ee:jar=jbpapp2260.jar,name=TransactionMDB,service=EJB3");
-      getServer().invoke(name, "startDelivery", null, null);
-      try
-      {
-         Object result = sendMessage(QUEUE_NAME, "RuntimeException", 2);
-         assertEquals("Wrong transaction status", Status.STATUS_ACTIVE, result);
-//         result = sendMessage(QUEUE_NAME, "RuntimeException");
-//         assertEquals("Wrong transaction status", Status.STATUS_ACTIVE, result);
-//         result = sendMessage(QUEUE_NAME, "RuntimeException");
-//         assertEquals("Wrong transaction status", Status.STATUS_ACTIVE, result);
-      }
-      finally
-      {
-         getServer().invoke(name, "stopDelivery", null, null);
-      }
-   }
-   
    public void testStress() throws Exception
    {
       Map<String, AtomicInteger> result = (Map<String, AtomicInteger>) sendMessage(QUEUE_NAME, "testDefault");
@@ -211,23 +176,6 @@
       }
    }
    
-   public void _testStress2() throws Exception
-   {
-      StressQueueRemote bean = lookup("StressQueueBean/remote", StressQueueRemote.class);
-      
-      ObjectName name = new ObjectName("jboss.j2ee:jar=jbpapp2260.jar,name=TransactionMDB,service=EJB3");
-      getServer().invoke(name, "startDelivery", null, null);
-      
-      try
-      {
-         bean.fireMessages(100);
-      }
-      finally
-      {
-         getServer().invoke(name, "stopDelivery", null, null);
-      }   
-   }
-   
    public static Test suite() throws Exception
    {
       return getDeploySetup(MessageInflowTransactionUnitTestCase.class, "jbpapp2260.jar");




More information about the jboss-cvs-commits mailing list