[jboss-cvs] JBoss Messaging SVN: r2647 - trunk/tests/src/org/jboss/test/messaging/jms.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 4 07:25:29 EDT 2007


Author: timfox
Date: 2007-05-04 07:25:29 -0400 (Fri, 04 May 2007)
New Revision: 2647

Removed:
   trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java
Modified:
   trunk/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java
Log:
Removed unncessary tests


Deleted: trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java	2007-05-04 11:24:53 UTC (rev 2646)
+++ trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java	2007-05-04 11:25:29 UTC (rev 2647)
@@ -1,224 +0,0 @@
-/*
-   * JBoss, Home of Professional Open Source
-   * Copyright 2005, JBoss Inc., and individual contributors as indicated
-   * 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 org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import javax.naming.InitialContext;
-import javax.jms.ConnectionFactory;
-import javax.jms.Connection;
-import javax.jms.InvalidClientIDException;
-
-/**
- * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
- * @version <tt>$Revision$</tt>
- * $Id$
- */
-public class DuplicateClientIDTest extends MessagingTestCase
-{
-
-   // Constants ------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-   protected InitialContext ic;
-   protected ConnectionFactory cf;
-
-   // Static ---------------------------------------------------------------------------------------
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   public DuplicateClientIDTest(String name)
-   {
-      super(name);
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-
-   public void testDuplicate() throws Exception
-   {
-
-      Connection c1 = null;
-      Connection c2 = null;
-      try
-      {
-
-         c1 = cf.createConnection();
-         c1.setClientID("Duplicated");
-
-         try
-         {
-            c2 = cf.createConnection();
-            c2.setClientID("Duplicated");
-         }
-         catch (InvalidClientIDException e)
-         {
-            // From JMS Spec session 4.3.2 you could have multiple connections with the same
-            // ID... as long as you check for multiple ClientIDs and don't duplicate messages 
-            fail("You could have multiple connections with the same clientID, " +
-               "as long they are not being in use!");
-         }
-      }
-      finally
-      {
-         if (c1 != null) c1.close();
-         if (c2 != null) c2.close();
-      }
-
-      // This clause was added for http://jira.jboss.org/jira/browse/JBMESSAGING-932
-      // If opening a new connection after closing the previous one... this should work
-      try
-      {
-         c1 = cf.createConnection();
-         c1.setClientID("Duplicated");
-      }
-      finally
-      {
-         if (c1 != null) c1.close();
-      }
-
-   }
-
-   //http://jira.jboss.com/jira/browse/JBMESSAGING-816
-   public void testPreconfiguredDuplicateClientID() throws Exception
-   {
-      Connection c1 = null;
-      Connection c2 = null;
-
-      try
-      {
-
-         c1 = cf.createConnection("dilbert", "dogbert");
-         assertNotNull(c1);
-         assertNotNull(c1.getClientID());
-
-         try
-         {
-            c2 = cf.createConnection("dilbert", "dogbert");
-            assertNotNull(c2);
-            assertNotNull(c2.getClientID());
-
-         }
-         catch (InvalidClientIDException e)
-         {
-            // From JMS Spec session 4.3.2 you could have multiple connections with the same
-            // ID... as long as you check for multiple ClientIDs and don't duplicate messages
-            fail("You could have multiple connections with the same clientID, " +
-               "as long they are not being in use!");
-         }
-      }
-      finally
-      {
-         if (c1 != null)
-         {
-            c1.close();
-         }
-         if (c2 != null)
-         {
-            c2.close();
-         }
-      }
-
-      // This clause was added for http://jira.jboss.org/jira/browse/JBMESSAGING-932
-      // If opening a new connection after closing the previous one... this should work
-      try
-      {
-         c1 = cf.createConnection("dilbert", "dogbert");
-         assertNotNull(c1);
-         assertNotNull(c1.getClientID());
-      }
-      finally
-      {
-         if (c1 != null)
-         {
-            c1.close();
-         }
-      }
-
-
-   }
-
-   public void testNotDuplicateClientID() throws Exception
-   {
-      // Validates if there is anything dirty on the session that could damage a regular connection
-      Connection c0 = null;
-      Connection c1 = null;
-      Connection c2 = null;
-      try
-      {
-         c0 = cf.createConnection("dilbert", "dogbert");
-         
-         assertEquals("dilbert-id", c0.getClientID());
-         
-         c1 = cf.createConnection();
-         
-         assertNull(c1.getClientID());
-         
-         c2 = cf.createConnection();
-         
-         assertNull(c2.getClientID());
-      }
-      finally
-      {
-         if (c0 != null)
-         {
-            c0.close();
-         }
-         if (c1 != null)
-         {
-            c1.close();
-         }
-         if (c2 != null)
-         {
-            c2.close();
-         }
-      }
-   }
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   protected void setUp() throws Exception
-   {
-      super.setUp();
-
-      ServerManagement.start("all");
-
-      ic = new InitialContext(ServerManagement.getJNDIEnvironment());
-
-      cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-
-
-   }
-
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-   }
-
-   // Private --------------------------------------------------------------------------------------
-
-   // Inner classes --------------------------------------------------------------------------------
-
-}

Modified: trunk/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java	2007-05-04 11:24:53 UTC (rev 2646)
+++ trunk/tests/src/org/jboss/test/messaging/jms/MessageConsumerTest.java	2007-05-04 11:25:29 UTC (rev 2647)
@@ -342,58 +342,6 @@
    }
 
 
-   public void testRedeliveryToCompetingConsumerOnSubscription() throws Exception
-   {
-      Connection conn = cf.createConnection();
-
-      conn.setClientID("wibble");
-
-      Session sessSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      MessageProducer prod = sessSend.createProducer(topic);
-
-      conn.start();
-
-      Session sessConsume1 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-      MessageConsumer cons1 = sessConsume1.createDurableSubscriber(topic, "sub1");
-
-      TextMessage tm = sessSend.createTextMessage();
-
-      tm.setText("Your mum");
-
-      prod.send(tm);
-
-      TextMessage tm2 = (TextMessage)cons1.receive();
-
-      assertNotNull(tm2);
-
-      assertEquals("Your mum", tm2.getText());
-
-      //Don't ack
-
-      //Create another consumer
-
-      Session sessConsume2 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
-      MessageConsumer cons2 = sessConsume2.createDurableSubscriber(topic, "sub1");
-
-      //this should cancel message and cause delivery to other consumer
-
-      sessConsume1.close();
-
-      TextMessage tm3 = (TextMessage)cons2.receive(1000);
-
-      assertNotNull(tm3);
-
-      assertEquals("Your mum", tm3.getText());
-
-      tm3.acknowledge();
-
-      conn.close();
-
-   }
-
    /**
     * The simplest possible receive() test for a non-persistent message.
     */




More information about the jboss-cvs-commits mailing list