You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/05/05 07:43:36 UTC

svn commit: r1334319 - /camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java

Author: davsclaus
Date: Sat May  5 05:43:36 2012
New Revision: 1334319

URL: http://svn.apache.org/viewvc?rev=1334319&view=rev
Log:
CAMEL-5245: Expose management name in camel context mbean.

Modified:
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java

Modified: camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java?rev=1334319&r1=1334318&r2=1334319&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/management/ManagedCamelContextTest.java Sat May  5 05:43:36 2012
@@ -21,7 +21,6 @@ import java.util.Map;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
-import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 
@@ -30,26 +29,15 @@ import org.apache.camel.component.mock.M
  */
 public class ManagedCamelContextTest extends ManagementTestSupport {
 
-    @Override
-    protected CamelContext createCamelContext() throws Exception {
-        CamelContext context = super.createCamelContext();
-        // to force a different management name than the camel id
-        context.getManagementNameStrategy().setNamePattern("19-#name#");
-        return context;
-    }
-
     public void testManagedCamelContext() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
 
         assertTrue("Should be registered", mbeanServer.isRegistered(on));
         String name = (String) mbeanServer.getAttribute(on, "CamelId");
         assertEquals("camel-1", name);
 
-        String managementName = (String) mbeanServer.getAttribute(on, "ManagementName");
-        assertEquals("19-camel-1", managementName);
-
         String uptime = (String) mbeanServer.getAttribute(on, "Uptime");
         assertNotNull(uptime);
 
@@ -97,7 +85,7 @@ public class ManagedCamelContextTest ext
     public void testManagedCamelContextCreateEndpoint() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
 
         assertNull(context.hasEndpoint("seda:bar"));
 
@@ -107,7 +95,7 @@ public class ManagedCamelContextTest ext
 
         assertNotNull(context.hasEndpoint("seda:bar"));
 
-        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=endpoints,name=\"seda://bar\"");
+        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"seda://bar\"");
         boolean registered = mbeanServer.isRegistered(seda);
         assertTrue("Should be registered " + seda, registered);
 
@@ -122,7 +110,7 @@ public class ManagedCamelContextTest ext
     public void testManagedCamelContextRemoveEndpoint() throws Exception {
         MBeanServer mbeanServer = getMBeanServer();
 
-        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=context,name=\"camel-1\"");
+        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=context,name=\"camel-1\"");
 
         assertNull(context.hasEndpoint("seda:bar"));
 
@@ -132,7 +120,7 @@ public class ManagedCamelContextTest ext
 
         assertNotNull(context.hasEndpoint("seda:bar"));
 
-        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=localhost/19-camel-1,type=endpoints,name=\"seda://bar\"");
+        ObjectName seda = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=endpoints,name=\"seda://bar\"");
         boolean registered = mbeanServer.isRegistered(seda);
         assertTrue("Should be registered " + seda, registered);