You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/02/09 17:08:53 UTC

svn commit: r376333 - in /incubator/servicemix/trunk/servicemix-core/src: main/java/org/apache/servicemix/jbi/servicedesc/InternalEndpoint.java test/java/org/apache/servicemix/jbi/servicedesc/InternalEndpointTest.java

Author: gnodet
Date: Thu Feb  9 08:08:50 2006
New Revision: 376333

URL: http://svn.apache.org/viewcvs?rev=376333&view=rev
Log:
Fix typo causing problems when activating 2 endpoints with the same service name on the same component

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/InternalEndpoint.java
    incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/servicedesc/InternalEndpointTest.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/InternalEndpoint.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/InternalEndpoint.java?rev=376333&r1=376332&r2=376333&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/InternalEndpoint.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/servicedesc/InternalEndpoint.java Thu Feb  9 08:08:50 2006
@@ -115,7 +115,7 @@
         if (obj != null && obj instanceof InternalEndpoint){
             InternalEndpoint other = (InternalEndpoint)obj;
             result = other.getComponentNameSpace().equals(this.getComponentNameSpace()) && 
-                     other.serviceName.equals(this.serviceName);
+                     other.serviceName.equals(this.serviceName) &&
                      other.endpointName.equals(this.endpointName);
         }
         return result;

Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/servicedesc/InternalEndpointTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/servicedesc/InternalEndpointTest.java?rev=376333&r1=376332&r2=376333&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/servicedesc/InternalEndpointTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/servicedesc/InternalEndpointTest.java Thu Feb  9 08:08:50 2006
@@ -49,5 +49,20 @@
         assertNotNull(outE.getServiceName());
         assertNotNull(outE.getEndpointName());
     }
+    
+    public void testEquals() throws Exception {
+        ComponentNameSpace cns = new ComponentNameSpace("myContainer", "myName", "myId");
+        InternalEndpoint e1 = new InternalEndpoint(cns, "myEndpoint1", new QName("myService"));
+        InternalEndpoint e2 = new InternalEndpoint(cns, "myEndpoint2", new QName("myService"));
+        assertFalse(e1.equals(e2));
+        e2 = new InternalEndpoint(cns, "myEndpoint", new QName("myService2"));
+        assertFalse(e1.equals(e2));
+        ComponentNameSpace cns2 = new ComponentNameSpace("myContainer", "myName", "myId2");
+        e2 = new InternalEndpoint(cns2, "myEndpoint1", new QName("myService"));
+        assertFalse(e1.equals(e2));
+        cns2 = new ComponentNameSpace("myContainer", "myName", "myId");
+        e2 = new InternalEndpoint(cns2, "myEndpoint1", new QName("myService"));
+        assertTrue(e1.equals(e2));
+    }
 
 }