camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r817604 - in /camel/trunk/components/camel-cache/src: main/java/org/apache/camel/component/cache/ main/java/org/apache/camel/processor/cache/ test/java/org/apache/camel/component/cache/ test/java/org/apache/camel/processor/cache/
Date Tue, 22 Sep 2009 11:26:40 GMT
Author: davsclaus
Date: Tue Sep 22 11:26:40 2009
New Revision: 817604

URL: http://svn.apache.org/viewvc?rev=817604&view=rev
Log:
CAMEL-2008: Applied patch with thanks to Ashwin Karpe.

Modified:
    camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheConsumer.java
    camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheEventListener.java
    camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheProducer.java
    camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedMessageBodyReplacer.java
    camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedTokenReplacer.java
    camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedXPathReplacer.java
    camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheValidate.java
    camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
    camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
    camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
    camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
    camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java

Modified: camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheConsumer.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheConsumer.java
(original)
+++ camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheConsumer.java
Tue Sep 22 11:26:40 2009
@@ -83,7 +83,7 @@
                     null);
             cache.getCacheEventNotificationService().registerListener(cacheEventListener);
             cacheManager.addCache(cache);
-            LOG.info("Added a new cache: " + cache.getName());  
+            LOG.debug("Added a new cache: " + cache.getName());  
         }
     }
     

Modified: camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheEventListener.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheEventListener.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheEventListener.java
(original)
+++ camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheEventListener.java
Tue Sep 22 11:26:40 2009
@@ -42,34 +42,46 @@
     }
 
     public void notifyElementEvicted(Ehcache cache, Element element) {
-        LOG.info("Element" + element.toString() + " is being evicted from cache " + cache.getName());
-        
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Element" + element.toString() + " is being evicted from cache " +
cache.getName());
+        }
     }
 
     public void notifyElementExpired(Ehcache cache, Element element) {
-        LOG.info("Element" + element.toString() + " has expired in cache " + cache.getName());
       
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Element" + element.toString() + " has expired in cache " + cache.getName());
      
+        }
     }
 
     public void notifyElementPut(Ehcache cache, Element element)
         throws CacheException {
-        LOG.info("Element" + element.toString() + " has just been added/put in cache " +
cache.getName());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Element" + element.toString() + " has just been added/put in cache
" + cache.getName());
+        }
         dispatchExchange(cache, element, "ADD");
     }
 
     public void notifyElementRemoved(Ehcache cache, Element element)
         throws CacheException {
-        LOG.info("Element" + element.toString() + " has just been removed from cache " +
cache.getName());
+        
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Element" + element.toString() + " has just been removed from cache
" + cache.getName());
+        }
         dispatchExchange(cache, element, "DELETE");        
     }
 
     public void notifyElementUpdated(Ehcache cache, Element element)
         throws CacheException {
-        LOG.info("Element" + element.toString() + " has just been updated in cache " + cache.getName());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Element" + element.toString() + " has just been updated in cache "
+ cache.getName());
+        }
         dispatchExchange(cache, element, "UPDATE");            
     }
 
     public void notifyRemoveAll(Ehcache cache) {
-        LOG.info("Cache " + cache.getName() + " is being emptied and all elements removed");
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Cache " + cache.getName() + " is being emptied and all elements removed");
+        }
         dispatchExchange(cache, null, "DELETEALL");
         
     }
@@ -77,7 +89,9 @@
     private void dispatchExchange(Ehcache cache, Element element, String operation) {
         Exchange exchange;
         
-        LOG.info("Consumer Dispatching the Exchange containing the Element " + element.toString()
+ " in cache " + cache.getName());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Consumer Dispatching the Exchange containing the Element " + element.toString()
+ " in cache " + cache.getName());
+        }
         if (element == null) {
             exchange = cacheConsumer.getEndpoint().createCacheExchange(operation, "", "");
         } else {

Modified: camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheProducer.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheProducer.java
(original)
+++ camel/trunk/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheProducer.java
Tue Sep 22 11:26:40 2009
@@ -47,18 +47,15 @@
 
     @Override
     protected void doStart() throws Exception {
-        LOG.info("In CacheProducer.start()");
         super.doStart();
     }
 
     @Override
     protected void doStop() throws Exception {
-        LOG.info("In CacheProducer.stop()");
         super.doStop();
     }
 
     public void process(Exchange exchange) throws Exception {
-        LOG.info("In CacheProducer.process()");
         Object body = exchange.getIn().getBody();
         InputStream is = exchange.getContext().getTypeConverter().convertTo(InputStream.class,
body);
         
@@ -72,10 +69,12 @@
         // Cache the buffer to the specified Cache against the specified key 
         cacheManager = new CacheManagerFactory().instantiateCacheManager();
         
-        LOG.info("Cache Name: " + config.getCacheName());
+        LOG.debug("Cache Name: " + config.getCacheName());
         if (cacheManager.cacheExists(config.getCacheName())) {
-            LOG.info("Found an existing cache: " + config.getCacheName());
-            LOG.info("Cache " + config.getCacheName() + " currently contains " + cacheManager.getCache(config.getCacheName()).getSize()
+ " elements");
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Found an existing cache: " + config.getCacheName());
+                LOG.debug("Cache " + config.getCacheName() + " currently contains " + cacheManager.getCache(config.getCacheName()).getSize()
+ " elements");
+            }
             cache = cacheManager.getCache(config.getCacheName());
         } else {
             cache = new Cache(config.getCacheName(), 
@@ -90,7 +89,7 @@
                     config.getDiskExpiryThreadIntervalSeconds(), 
                     null);
             cacheManager.addCache(cache);
-            LOG.info("Added a new cache: " + cache.getName());            
+            LOG.debug("Added a new cache: " + cache.getName());            
         }
        
         
@@ -109,16 +108,16 @@
 
     private void performCacheOperation(String operation, String key, byte[] buffer) {
         if (operation.equalsIgnoreCase("DELETEALL")) {
-            LOG.info("Deleting All elements from the Cache");
+            LOG.debug("Deleting All elements from the Cache");
             cache.removeAll();
         } else if (operation.equalsIgnoreCase("ADD")) {
-            LOG.info("Adding an element with key " + key + " into the Cache");
+            LOG.debug("Adding an element with key " + key + " into the Cache");
             cache.put(new Element(key, buffer), true);
         } else if (operation.equalsIgnoreCase("UPDATE")) {
-            LOG.info("Updating an element with key " + key + " into the Cache");
+            LOG.debug("Updating an element with key " + key + " into the Cache");
             cache.put(new Element(key, buffer), true);
         } else if (operation.equalsIgnoreCase("DELETE")) {
-            LOG.info("Deleting an element with key " + key + " into the Cache");
+            LOG.debug("Deleting an element with key " + key + " into the Cache");
             cache.remove(key, true);
         }
     }

Modified: camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedMessageBodyReplacer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedMessageBodyReplacer.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedMessageBodyReplacer.java
(original)
+++ camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedMessageBodyReplacer.java
Tue Sep 22 11:26:40 2009
@@ -49,7 +49,9 @@
 
         if (isValid(cacheManager, cacheName, key)) {
             cache = cacheManager.getCache(cacheName);
-            LOG.info("Replacing Message Body from CacheName " + cacheName + " for key " +
key);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Replacing Message Body from CacheName " + cacheName + " for key
" + key);
+            }
             exchange.getIn().setHeader("CACHE_KEY", key);
             exchange.getIn().setBody(cache.get(key).getObjectValue());
         }

Modified: camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedTokenReplacer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedTokenReplacer.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedTokenReplacer.java
(original)
+++ camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedTokenReplacer.java
Tue Sep 22 11:26:40 2009
@@ -53,8 +53,10 @@
 
         if (isValid(cacheManager, cacheName, key)) {
             cache = cacheManager.getCache(cacheName);
-            LOG.info("Replacing Token " + replacementToken + "in Message with value stored
against key "
-                     + key + " in CacheName " + cacheName);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Replacing Token " + replacementToken + "in Message with value
stored against key "
+                         + key + " in CacheName " + cacheName);
+            }
             exchange.getIn().setHeader("CACHE_KEY", key);
             Object body = exchange.getIn().getBody();
             InputStream is = exchange.getContext().getTypeConverter().convertTo(InputStream.class,
body);

Modified: camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedXPathReplacer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedXPathReplacer.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedXPathReplacer.java
(original)
+++ camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheBasedXPathReplacer.java
Tue Sep 22 11:26:40 2009
@@ -67,8 +67,10 @@
 
         if (isValid(cacheManager, cacheName, key)) {
             cache = cacheManager.getCache(cacheName);
-            LOG.info("Replacing XPath value " + xpath + "in Message with value stored against
key " + key
-                     + " in CacheName " + cacheName);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Replacing XPath value " + xpath + "in Message with value stored
against key " + key
+                        + " in CacheName " + cacheName);
+            }
             exchange.getIn().setHeader("CACHE_KEY", key);
             Object body = exchange.getIn().getBody();
             InputStream is = exchange.getContext().getTypeConverter().convertTo(InputStream.class,
body);

Modified: camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheValidate.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheValidate.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheValidate.java
(original)
+++ camel/trunk/components/camel-cache/src/main/java/org/apache/camel/processor/cache/CacheValidate.java
Tue Sep 22 11:26:40 2009
@@ -26,28 +26,29 @@
     private static final transient Log LOG = LogFactory.getLog(CacheValidate.class);
 
     public boolean isValid(CacheManager cacheManager, String cacheName, String key) {
-        LOG.info("Cache Name: " + cacheName);
+        LOG.debug("Cache Name: " + cacheName);
         if (!cacheManager.cacheExists(cacheName)) {
-            LOG
-                .info("No existing Cache found with name: "
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("No existing Cache found with name: "
                       + cacheName
                       + ". Please ensure a cache is first instantiated using a Cache Consumer
or Cache Producer");
-            LOG.info("Replacement will not be performed since the cache " + cacheName
+                LOG.debug("Replacement will not be performed since the cache " + cacheName
                      + "does not presently exist");
+            }
             return false;
         }
 
-        LOG.info("Found an existing cache: " + cacheName);
-        LOG.info("Cache " + cacheName + " currently contains " + cacheManager.getCache(cacheName).getSize()
+        LOG.debug("Found an existing cache: " + cacheName);
+        LOG.debug("Cache " + cacheName + " currently contains " + cacheManager.getCache(cacheName).getSize()
                  + " elements");
         Ehcache cache = cacheManager.getCache(cacheName);
         if (!cache.isKeyInCache(key)) {
-            LOG
-                .info("No Key with name: "
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("No Key with name: "
                       + key
                       + "presently exists in the cache. It is also possible that the key
may have expired in the cache");
-            LOG
-                .info("Replacement will not be performed until an appropriate key/value pair
is added to (or) found in the cache.");
+                LOG.debug("Replacement will not be performed until an appropriate key/value
pair is added to (or) found in the cache.");
+            }
             return false;
 
         }

Modified: camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
(original)
+++ camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
Tue Sep 22 11:26:40 2009
@@ -43,7 +43,7 @@
 
     @Test
     public void testReceivingFileFromCache() throws Exception {
-        LOG.info("Beginning Test ---> testReceivingFileFromCache()");
+        LOG.debug("Beginning Test ---> testReceivingFileFromCache()");
 
         resultEndpoint.expectedMessageCount(3);
 
@@ -64,7 +64,7 @@
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.info("Completed Test ---> testReceivingFileFromCache()");
+        LOG.debug("Completed Test ---> testReceivingFileFromCache()");
     }
 
     @Override
@@ -78,12 +78,14 @@
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        LOG.info("------- Cache Event Notification ---------");
-                        LOG.info("Received notification for the following activity in cache
TestCache1:");
-                        LOG.info("Operation = " + operation);
-                        LOG.info("key = " + key);
-                        LOG.info("value = " + data);
-                        LOG.info("------ End Cache Event Notification ------");
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("------- Cache Event Notification ---------");
+                            LOG.debug("Received notification for the following activity in
cache TestCache1:");
+                            LOG.debug("Operation = " + operation);
+                            LOG.debug("key = " + key);
+                            LOG.debug("value = " + data);
+                            LOG.debug("------ End Cache Event Notification ------");
+                        }
                     }
 
                 }).to("mock:result");

Modified: camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
(original)
+++ camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
Tue Sep 22 11:26:40 2009
@@ -86,7 +86,7 @@
             }
         });
         context.start();
-        LOG.info("------------Beginning CacheProducer Add Test---------------");
+        LOG.debug("------------Beginning CacheProducer Add Test---------------");
         sendFile();
     }
     
@@ -101,7 +101,7 @@
             }
         });
         context.start();
-        LOG.info("------------Beginning CacheProducer Update Test---------------");
+        LOG.debug("------------Beginning CacheProducer Update Test---------------");
         sendUpdatedFile();
     }
     
@@ -116,7 +116,7 @@
             }
         });
         context.start();
-        LOG.info("------------Beginning CacheProducer Delete Test---------------");
+        LOG.debug("------------Beginning CacheProducer Delete Test---------------");
         sendUpdatedFile();
     }
     
@@ -138,7 +138,7 @@
             }
         });
         context.start();
-        LOG.info("------------Beginning CacheProducer Delete All Elements Test---------------");
+        LOG.debug("------------Beginning CacheProducer Delete All Elements Test---------------");
         sendUpdatedFile();
     }    
     

Modified: camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
(original)
+++ camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
Tue Sep 22 11:26:40 2009
@@ -45,7 +45,7 @@
 
     @Test
     public void testCacheBasedBodyReplacer() throws Exception {
-        LOG.info("Beginning Test ---> testCacheBasedBodyReplacer()");
+        LOG.debug("Beginning Test ---> testCacheBasedBodyReplacer()");
 
         resultEndpoint.expectedMessageCount(1);
 
@@ -69,7 +69,7 @@
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.info("Completed Test ---> testCacheBasedBodyReplacer()");
+        LOG.debug("Completed Test ---> testCacheBasedBodyReplacer()");
 
     }
 
@@ -87,12 +87,14 @@
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        LOG.info("------- Payload Replacement Results ---------");
-                        LOG.info("The following Payload was replaced from Cache: TestCache1");
-                        LOG.info("key = " + key);
-                        LOG.info("Before value = Hello World");
-                        LOG.info("After value = " + data);
-                        LOG.info("------ End  ------");
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("------- Payload Replacement Results ---------");
+                            LOG.debug("The following Payload was replaced from Cache: TestCache1");
+                            LOG.debug("key = " + key);
+                            LOG.debug("Before value = Hello World");
+                            LOG.debug("After value = " + data);
+                            LOG.debug("------ End  ------");
+                        }
                     }
                 }).to("mock:result");
 

Modified: camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
(original)
+++ camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
Tue Sep 22 11:26:40 2009
@@ -50,7 +50,7 @@
 
     @Test
     public void testCacheBasedTokenReplacer() throws Exception {
-        LOG.info("Beginning Test ---> testCacheBasedTokenReplacer()");
+        LOG.debug("Beginning Test ---> testCacheBasedTokenReplacer()");
 
         resultEndpoint.expectedMessageCount(1);
 
@@ -80,7 +80,7 @@
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.info("Completed Test ---> testCacheBasedTokenReplacer()");
+        LOG.debug("Completed Test ---> testCacheBasedTokenReplacer()");
 
     }
 
@@ -100,12 +100,14 @@
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        LOG.info("------- Payload Replacement Results ---------");
-                        LOG.info("The following Payload was replaced from Cache: TestCache1");
-                        LOG.info("key = " + key);
-                        LOG.info("Before Value = " + quote);
-                        LOG.info("After value = " + data);
-                        LOG.info("------ End  ------");
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("------- Payload Replacement Results ---------");
+                            LOG.debug("The following Payload was replaced from Cache: TestCache1");
+                            LOG.debug("key = " + key);
+                            LOG.debug("Before Value = " + quote);
+                            LOG.debug("After value = " + data);
+                            LOG.debug("------ End  ------");
+                        }
                     }
                 }).to("mock:result");
 

Modified: camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java?rev=817604&r1=817603&r2=817604&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
(original)
+++ camel/trunk/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
Tue Sep 22 11:26:40 2009
@@ -55,7 +55,7 @@
 
     @Test
     public void testCacheBasedXPathElementReplacer() throws Exception {
-        LOG.info("Beginning Test ---> testCacheBasedXPathElementReplacer()");
+        LOG.debug("Beginning Test ---> testCacheBasedXPathElementReplacer()");
 
         resultEndpoint.expectedMessageCount(1);
 
@@ -82,7 +82,7 @@
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.info("Completed Test ---> testCacheBasedXPathElementReplacer()");
+        LOG.debug("Completed Test ---> testCacheBasedXPathElementReplacer()");
 
     }
 
@@ -101,12 +101,14 @@
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        LOG.info("------- Payload Replacement Results ---------");
-                        LOG.info("The following Payload was replaced from Cache: TestCache1");
-                        LOG.info("key = " + key);
-                        LOG.info("Before Value = " + xmlFragment);
-                        LOG.info("After value = " + data);
-                        LOG.info("------ End  ------");
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("------- Payload Replacement Results ---------");
+                            LOG.debug("The following Payload was replaced from Cache: TestCache1");
+                            LOG.debug("key = " + key);
+                            LOG.debug("Before Value = " + xmlFragment);
+                            LOG.debug("After value = " + data);
+                            LOG.debug("------ End  ------");
+                        }
                     }
                 }).to("mock:result");
 



Mime
View raw message