camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] git commit: CAMEL-4974: Added santizie option to JMX to hide sensitive information like password in URIs exposed in JMX MBean names and attributes.
Date Mon, 29 Jul 2013 15:45:31 GMT
Updated Branches:
  refs/heads/master a874d23b2 -> 9f3b95f9a


CAMEL-4974: Added santizie option to JMX to hide sensitive information like password in URIs
exposed in JMX MBean names and attributes.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/492a9dc5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/492a9dc5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/492a9dc5

Branch: refs/heads/master
Commit: 492a9dc5a28fe542891779b4458942600855626e
Parents: a874d23
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Jul 29 13:41:07 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Jul 29 13:41:07 2013 +0200

----------------------------------------------------------------------
 .../apache/camel/impl/DefaultCamelContext.java  |  7 ++--
 .../DefaultManagementMBeanAssembler.java        | 28 +++++++++----
 .../DefaultManagementNamingStrategy.java        |  2 +-
 .../camel/management/MBeanInfoAssembler.java    |  7 ++++
 .../camel/management/mbean/ManagedConsumer.java |  2 +-
 .../camel/management/mbean/ManagedEndpoint.java |  2 +-
 .../camel/management/mbean/ManagedProducer.java |  2 +-
 .../camel/management/mbean/ManagedRoute.java    |  2 +-
 .../management/mbean/ManagedSendProcessor.java  |  2 +-
 .../java/org/apache/camel/util/URISupport.java  | 22 +++-------
 .../apache/camel/impl/DefaultEndpointTest.java  |  6 +--
 .../impl/MultipleLifecycleStrategyTest.java     |  2 +-
 .../management/ManagedRouteAddRemoveTest.java   | 42 ++++++++++----------
 .../org/apache/camel/util/URISupportTest.java   |  4 +-
 14 files changed, 69 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index c7e7851..88a7de0 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -1179,9 +1179,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
     }
 
     public ManagementMBeanAssembler getManagementMBeanAssembler() {
-        if (managementMBeanAssembler == null) {
-            managementMBeanAssembler = createManagementMBeanAssembler();
-        }
         return managementMBeanAssembler;
     }
 
@@ -1550,6 +1547,10 @@ public class DefaultCamelContext extends ServiceSupport implements
ModelCamelCon
             // use the classloader that loaded this class
             setApplicationContextClassLoader(this.getClass().getClassLoader());
         }
+        if (managementMBeanAssembler == null) {
+            managementMBeanAssembler = createManagementMBeanAssembler();
+        }
+        addService(managementMBeanAssembler);
 
         if (log.isDebugEnabled()) {
             log.debug("Using ClassResolver={}, PackageScanClassResolver={}, ApplicationContextClassLoader={}",

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/DefaultManagementMBeanAssembler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementMBeanAssembler.java
b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementMBeanAssembler.java
index 725e418..8157a9b 100644
--- a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementMBeanAssembler.java
+++ b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementMBeanAssembler.java
@@ -24,11 +24,14 @@ import javax.management.modelmbean.ModelMBean;
 import javax.management.modelmbean.ModelMBeanInfo;
 import javax.management.modelmbean.RequiredModelMBean;
 
-import org.apache.camel.Service;
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.StaticService;
 import org.apache.camel.api.management.ManagedInstance;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.NotificationSenderAware;
 import org.apache.camel.spi.ManagementMBeanAssembler;
+import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
 import org.slf4j.Logger;
@@ -41,12 +44,20 @@ import org.slf4j.LoggerFactory;
  *
  * @version 
  */
-public class DefaultManagementMBeanAssembler implements ManagementMBeanAssembler, Service
{
+public class DefaultManagementMBeanAssembler extends ServiceSupport implements ManagementMBeanAssembler,
CamelContextAware, StaticService {
     protected final Logger log = LoggerFactory.getLogger(getClass());
-    private final MBeanInfoAssembler assembler;
+    private MBeanInfoAssembler assembler;
+    private CamelContext camelContext;
 
     public DefaultManagementMBeanAssembler() {
-        this.assembler = new MBeanInfoAssembler();
+    }
+
+    public CamelContext getCamelContext() {
+        return camelContext;
+    }
+
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
     }
 
     public ModelMBean assemble(MBeanServer mBeanServer, Object obj, ObjectName name) throws
JMException {
@@ -92,13 +103,14 @@ public class DefaultManagementMBeanAssembler implements ManagementMBeanAssembler
         return mbean;
     }
 
-    @Override
-    public void start() throws Exception {
+    protected void doStart() throws Exception {
+        if (assembler == null) {
+            assembler = new MBeanInfoAssembler(camelContext);
+        }
         ServiceHelper.startService(assembler);
     }
 
-    @Override
-    public void stop() throws Exception {
+    protected void doStop() throws Exception {
         ServiceHelper.stopService(assembler);
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
index 9d22e8e..104103d 100644
--- a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementNamingStrategy.java
@@ -315,7 +315,7 @@ public class DefaultManagementNamingStrategy implements ManagementNamingStrategy
         Boolean sanitize = camelContext != null && camelContext.getManagementStrategy().getManagementAgent().getSanitize();
         if (sanitize != null && sanitize) {
             // use xxxxxx as replacements as * has to be quoted for MBean names
-            answer = URISupport.sanitizeUri(answer, "xxxxxx");
+            answer = URISupport.sanitizeUri(answer);
         }
         return answer;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java
b/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java
index a19c65e..c58f90e 100644
--- a/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java
+++ b/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java
@@ -31,6 +31,7 @@ import javax.management.modelmbean.ModelMBeanInfoSupport;
 import javax.management.modelmbean.ModelMBeanNotificationInfo;
 import javax.management.modelmbean.ModelMBeanOperationInfo;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Service;
 import org.apache.camel.api.management.ManagedAttribute;
 import org.apache.camel.api.management.ManagedNotification;
@@ -58,6 +59,12 @@ public class MBeanInfoAssembler implements Service {
     // which could prevent classloader to unload classes if being referenced from this cache
     private final LRUCache<Class<?>, MBeanAttributesAndOperations> cache = new
LRUWeakCache<Class<?>, MBeanAttributesAndOperations>(1000);
 
+    private final CamelContext camelContext;
+
+    public MBeanInfoAssembler(CamelContext camelContext) {
+        this.camelContext = camelContext;
+    }
+
     @Override
     public void start() throws Exception {
         // noop

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
index 908fe19..05afdbd 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConsumer.java
@@ -41,7 +41,7 @@ public class ManagedConsumer extends ManagedService implements ManagedConsumerMB
         super.init(strategy);
         boolean sanitize = strategy.getManagementAgent().getSanitize() != null ? strategy.getManagementAgent().getSanitize()
: false;
         if (sanitize) {
-            uri = URISupport.sanitizeUri(consumer.getEndpoint().getEndpointUri(), "xxxxxx");
+            uri = URISupport.sanitizeUri(consumer.getEndpoint().getEndpointUri());
         } else {
             uri = consumer.getEndpoint().getEndpointUri();
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedEndpoint.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedEndpoint.java
index e12f93d..f914103 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedEndpoint.java
@@ -37,7 +37,7 @@ public class ManagedEndpoint implements ManagedInstance, ManagedEndpointMBean
{
     public void init(ManagementStrategy strategy) {
         boolean sanitize = strategy.getManagementAgent().getSanitize() != null ? strategy.getManagementAgent().getSanitize()
: false;
         if (sanitize) {
-            uri = URISupport.sanitizeUri(endpoint.getEndpointUri(), "xxxxxx");
+            uri = URISupport.sanitizeUri(endpoint.getEndpointUri());
         } else {
             uri = endpoint.getEndpointUri();
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
index e0e1373..ba298d2 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProducer.java
@@ -41,7 +41,7 @@ public class ManagedProducer extends ManagedService implements ManagedProducerMB
         super.init(strategy);
         boolean sanitize = strategy.getManagementAgent().getSanitize() != null ? strategy.getManagementAgent().getSanitize()
: false;
         if (sanitize) {
-            uri = URISupport.sanitizeUri(producer.getEndpoint().getEndpointUri(), "xxxxxx");
+            uri = URISupport.sanitizeUri(producer.getEndpoint().getEndpointUri());
         } else {
             uri = producer.getEndpoint().getEndpointUri();
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
index d3c2927..13565d8 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
@@ -75,7 +75,7 @@ public class ManagedRoute extends ManagedPerformanceCounter implements TimerList
             String uri = ep.getEndpointUri();
             boolean sanitize = strategy.getManagementAgent().getSanitize() != null ? strategy.getManagementAgent().getSanitize()
: false;
             if (sanitize) {
-                endpointUri = URISupport.sanitizeUri(uri, "xxxxxx");
+                endpointUri = URISupport.sanitizeUri(uri);
             } else {
                 endpointUri = uri;
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSendProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSendProcessor.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSendProcessor.java
index de04f43..b824da8 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSendProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSendProcessor.java
@@ -41,7 +41,7 @@ public class ManagedSendProcessor extends ManagedProcessor implements ManagedSen
         super.init(strategy);
         boolean sanitize = strategy.getManagementAgent().getSanitize() != null ? strategy.getManagementAgent().getSanitize()
: false;
         if (sanitize) {
-            destination = URISupport.sanitizeUri(processor.getDestination().getEndpointUri(),
"xxxxxx");
+            destination = URISupport.sanitizeUri(processor.getDestination().getEndpointUri());
         } else {
             destination = processor.getDestination().getEndpointUri();
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/main/java/org/apache/camel/util/URISupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/URISupport.java b/camel-core/src/main/java/org/apache/camel/util/URISupport.java
index 92a8401..52406f4 100644
--- a/camel-core/src/main/java/org/apache/camel/util/URISupport.java
+++ b/camel-core/src/main/java/org/apache/camel/util/URISupport.java
@@ -68,27 +68,15 @@ public final class URISupport {
      * @return Returns null if the uri is null, otherwise the URI with the passphrase, password
or secretKey sanitized.
      */
     public static String sanitizeUri(String uri) {
-        return sanitizeUri(uri, "******");
-    }
-    
-    /**
-     * Removes detected sensitive information (such as passwords) from the URI and returns
the result.
-     *
-     * @param uri The uri to sanitize.
-     * @param replacement the masked replacement
-     * @see #SECRETS for the matched pattern
-     *
-     * @return Returns null if the uri is null, otherwise the URI with the passphrase, password
or secretKey sanitized.
-     */
-    public static String sanitizeUri(String uri, String replacement) {
+        // use xxxxx as replacement as that works well with JMX also
         String sanitized = uri;
         if (uri != null) {
-            sanitized = SECRETS.matcher(sanitized).replaceAll("$1=" + replacement);
-            sanitized = USERINFO_PASSWORD.matcher(sanitized).replaceFirst("$1" + replacement
+ "$3");
+            sanitized = SECRETS.matcher(sanitized).replaceAll("$1=xxxxxx");
+            sanitized = USERINFO_PASSWORD.matcher(sanitized).replaceFirst("$1xxxxxx$3");
         }
         return sanitized;
     }
-
+    
     /**
      * Removes detected sensitive information (such as passwords) from the
      * <em>path part</em> of an URI (that is, the part without the query
@@ -100,7 +88,7 @@ public final class URISupport {
     public static String sanitizePath(String path) {
         String sanitized = path;
         if (path != null) {
-            sanitized = PATH_USERINFO_PASSWORD.matcher(sanitized).replaceFirst("$1******$3");
+            sanitized = PATH_USERINFO_PASSWORD.matcher(sanitized).replaceFirst("$1xxxxxx$3");
         }
         return sanitized;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointTest.java b/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointTest.java
index 543292a..8104095 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/DefaultEndpointTest.java
@@ -31,11 +31,11 @@ public class DefaultEndpointTest extends ContextTestSupport {
         assertSanitizedUriUnchanged("irc://irc.codehaus.org/camel");
         assertSanitizedUriUnchanged("direct:foo?bar=123&cheese=yes");
         assertSanitizedUriUnchanged("https://issues.apache.org/activemq/secure/AddComment!default.jspa?id=33239");
-        assertEquals("ftp://host.mysite.com/records?passiveMode=true&user=someuser&password=******",
+        assertEquals("ftp://host.mysite.com/records?passiveMode=true&user=someuser&password=xxxxxx",
             URISupport.sanitizeUri("ftp://host.mysite.com/records?passiveMode=true&user=someuser&password=superSecret"));
-        assertEquals("sftp://host.mysite.com/records?user=someuser&privateKeyFile=key.file&privateKeyFilePassphrase=******&knownHostsFile=hosts.list",
+        assertEquals("sftp://host.mysite.com/records?user=someuser&privateKeyFile=key.file&privateKeyFilePassphrase=xxxxxx&knownHostsFile=hosts.list",
             URISupport.sanitizeUri("sftp://host.mysite.com/records?user=someuser&privateKeyFile=key.file&privateKeyFilePassphrase=superSecret&knownHostsFile=hosts.list"));
-        assertEquals("aws-sqs://MyQueue?accessKey=1672t4rflhnhli3&secretKey=******",
+        assertEquals("aws-sqs://MyQueue?accessKey=1672t4rflhnhli3&secretKey=xxxxxx",
             URISupport.sanitizeUri("aws-sqs://MyQueue?accessKey=1672t4rflhnhli3&secretKey=qi472qfberu33dqjncq"));
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/test/java/org/apache/camel/impl/MultipleLifecycleStrategyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/MultipleLifecycleStrategyTest.java
b/camel-core/src/test/java/org/apache/camel/impl/MultipleLifecycleStrategyTest.java
index 5486d77..460e72f 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/MultipleLifecycleStrategyTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/MultipleLifecycleStrategyTest.java
@@ -51,7 +51,7 @@ public class MultipleLifecycleStrategyTest extends TestSupport {
         context.stop();
 
         List<String> expectedEvents = Arrays.asList("onContextStart", "onServiceAdd",
"onServiceAdd", "onServiceAdd",
-                "onServiceAdd", "onServiceAdd", "onServiceAdd", "onServiceAdd", "onServiceAdd",
+                "onServiceAdd", "onServiceAdd", "onServiceAdd", "onServiceAdd", "onServiceAdd",
"onServiceAdd",
                 "onThreadPoolAdd", "onComponentAdd", "onEndpointAdd", "onComponentRemove",
"onContextStop", "onThreadPoolRemove");
         
         assertEquals(expectedEvents, dummy1.getEvents());

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/test/java/org/apache/camel/management/ManagedRouteAddRemoveTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedRouteAddRemoveTest.java
b/camel-core/src/test/java/org/apache/camel/management/ManagedRouteAddRemoveTest.java
index 280cb3d..7e4ddb6 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedRouteAddRemoveTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedRouteAddRemoveTest.java
@@ -53,7 +53,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // number of services
         Set<ObjectName> names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
         
         log.info("Adding 2nd route");
 
@@ -73,7 +73,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Removing 2nd route");
 
@@ -84,7 +84,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Shutting down...");
     }
@@ -100,7 +100,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // number of services
         Set<ObjectName> names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
         
         log.info("Adding 2nd route");
 
@@ -120,7 +120,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Removing 2nd route");
 
@@ -131,7 +131,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Shutting down...");
     }
@@ -147,7 +147,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // number of services
         Set<ObjectName> names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Adding 2nd route");
 
@@ -167,7 +167,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Removing 2nd route");
 
@@ -178,7 +178,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Shutting down...");
     }
@@ -194,7 +194,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // number of services
         Set<ObjectName> names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Adding 2nd route");
 
@@ -224,7 +224,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         // now stop and remove the 2nd route
         log.info("Stopping 2nd route");
@@ -236,7 +236,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Shutting down...");
     }
@@ -252,7 +252,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // number of services
         Set<ObjectName> names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Adding 2nd route");
 
@@ -283,7 +283,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         // now stop and remove the 2nd route
         log.info("Stopping 2nd route");
@@ -295,7 +295,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Shutting down...");
     }
@@ -311,7 +311,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // number of services
         Set<ObjectName> names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Adding 2nd route");
 
@@ -340,7 +340,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         // now stop and remove the 2nd route
         log.info("Stopping 2nd route");
@@ -352,7 +352,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Shutting down...");
     }
@@ -368,7 +368,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // number of services
         Set<ObjectName> names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Adding 2nd route");
 
@@ -398,7 +398,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         // now stop and remove the 2nd route
         log.info("Stopping 2nd route");
@@ -410,7 +410,7 @@ public class ManagedRouteAddRemoveTest extends ManagementTestSupport {
 
         // there should still be the same number of services
         names = mbeanServer.queryNames(on, null);
-        assertEquals(8, names.size());
+        assertEquals(9, names.size());
 
         log.info("Shutting down...");
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/492a9dc5/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java b/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
index d983c90..2c548c7 100644
--- a/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
@@ -203,13 +203,13 @@ public class URISupportTest extends ContextTestSupport {
 
     public void testSanitizeUriWithUserInfo() {
         String uri = "jt400://GEORGE:HARRISON@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.DTAQ";
-        String expected = "jt400://GEORGE:******@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.DTAQ";
+        String expected = "jt400://GEORGE:xxxxxx@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.DTAQ";
         assertEquals(expected, URISupport.sanitizeUri(uri));
     }
     
     public void testSanitizePathWithUserInfo() {
         String path = "GEORGE:HARRISON@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.PGM";
-        String expected = "GEORGE:******@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.PGM";
+        String expected = "GEORGE:xxxxxx@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.PGM";
         assertEquals(expected, URISupport.sanitizePath(path));
     }
     


Mime
View raw message