[jboss-cvs] JBoss Messaging SVN: r2645 - branches/Branch_1_0_1_SP/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:17:30 EDT 2007
Author: timfox
Date: 2007-05-04 07:17:30 -0400 (Fri, 04 May 2007)
New Revision: 2645
Removed:
branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java
Log:
Removed unnecessary test
Deleted: branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java
===================================================================
--- branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java 2007-05-04 10:00:21 UTC (rev 2644)
+++ branches/Branch_1_0_1_SP/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java 2007-05-04 11:17:30 UTC (rev 2645)
@@ -1,226 +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 javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.InvalidClientIDException;
-import javax.naming.InitialContext;
-
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-
-
-/**
-* @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 --------------------------------------------------------------------------------
-
-}
More information about the jboss-cvs-commits
mailing list