[jboss-cvs] JBoss Messaging SVN: r4384 - trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 4 11:36:38 EDT 2008


Author: jmesnil
Date: 2008-06-04 11:36:38 -0400 (Wed, 04 Jun 2008)
New Revision: 4384

Modified:
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/ConnectorRegistryTest.java
Log:
added testRemoveUnknownLocation()

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/ConnectorRegistryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/ConnectorRegistryTest.java	2008-06-04 15:27:34 UTC (rev 4383)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/ConnectorRegistryTest.java	2008-06-04 15:36:38 UTC (rev 4384)
@@ -10,11 +10,14 @@
 import static org.jboss.messaging.tests.integration.core.remoting.mina.TestSupport.PORT;
 import junit.framework.TestCase;
 
+import org.jboss.messaging.core.client.Location;
 import org.jboss.messaging.core.client.impl.ConnectionParamsImpl;
+import org.jboss.messaging.core.client.impl.LocationImpl;
 import org.jboss.messaging.core.config.Configuration;
 import org.jboss.messaging.core.remoting.ConnectorRegistry;
 import org.jboss.messaging.core.remoting.NIOConnector;
 import org.jboss.messaging.core.remoting.PacketDispatcher;
+import org.jboss.messaging.core.remoting.TransportType;
 import org.jboss.messaging.core.remoting.impl.ConnectorRegistryImpl;
 import org.jboss.messaging.core.remoting.impl.PacketDispatcherImpl;
 import org.jboss.messaging.tests.unit.core.remoting.impl.ConfigurationHelper;
@@ -184,6 +187,17 @@
       assertNull(registry.removeConnector(config1.getLocation()));
       assertNotNull(registry.removeConnector(config2.getLocation()));
    }
+   
+   public void testRemoveUnknownLocation() throws Exception
+   {
+      Location location = new LocationImpl(TransportType.TCP, "whatever", PORT);
+      try {
+         registry.removeConnector(location);
+         fail("removing a connector for an unknown location throws an IllegalStateException");
+      } catch (IllegalStateException e)
+      {
+      }
+   }
 
    // Package protected ---------------------------------------------
 




More information about the jboss-cvs-commits mailing list