camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject git commit: Polished.
Date Sat, 01 Jun 2013 17:30:59 GMT
Updated Branches:
  refs/heads/master d5b16f557 -> 1da885090


Polished.

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

Branch: refs/heads/master
Commit: 1da8850907623866acaa648f6378596e79f0db69
Parents: d5b16f5
Author: Babak Vahdat <bvahdat@apache.org>
Authored: Sat Jun 1 19:30:52 2013 +0200
Committer: Babak Vahdat <bvahdat@apache.org>
Committed: Sat Jun 1 19:30:52 2013 +0200

----------------------------------------------------------------------
 .../component/cache/CacheConsumerFIFOTest.java     |   14 ++--
 .../camel/component/cache/CacheConsumerTest.java   |   25 +++----
 .../camel/component/cache/CacheProducerTest.java   |   60 ++++++--------
 .../cache/CacheBasedBodyReplacerTest.java          |   21 ++---
 .../cache/CacheBasedTokenReplacerTest.java         |   21 ++---
 .../cache/CacheBasedXPathElementReplacerTest.java  |   21 ++---
 .../camel/converter/crypto/PGPDataFormat.java      |    3 +-
 .../camel/converter/crypto/HexUtilsTest.java       |   12 ++--
 8 files changed, 78 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerFIFOTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerFIFOTest.java
b/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerFIFOTest.java
index b8a6bc6..1303889 100644
--- a/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerFIFOTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerFIFOTest.java
@@ -33,13 +33,13 @@ public class CacheConsumerFIFOTest extends CacheConsumerTest {
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        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 ------");
+                        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 ------");
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
b/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
index e487b23..8c83549 100755
--- a/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheConsumerTest.java
@@ -29,11 +29,8 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.BaseCacheTest;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class CacheConsumerTest extends BaseCacheTest {
-    protected static final transient Logger LOG = LoggerFactory.getLogger(CacheConsumerTest.class);
 
     @EndpointInject(uri = "mock:result")
     protected MockEndpoint resultEndpoint;
@@ -42,7 +39,7 @@ public class CacheConsumerTest extends BaseCacheTest {
 
     @Test
     public void testReceivingFileFromCache() throws Exception {
-        LOG.debug("Beginning Test ---> testReceivingFileFromCache()");
+        log.debug("Beginning Test ---> testReceivingFileFromCache()");
 
         resultEndpoint.expectedMessageCount(3);
 
@@ -63,12 +60,12 @@ public class CacheConsumerTest extends BaseCacheTest {
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.debug("Completed Test ---> testReceivingFileFromCache()");
+        log.debug("Completed Test ---> testReceivingFileFromCache()");
     }
 
     @Test
     public void testReceivingSerializedObjectFromCache() throws Exception {
-        LOG.debug("Beginning Test ---> testReceivingSerializedObjectFromCache()");
+        log.debug("Beginning Test ---> testReceivingSerializedObjectFromCache()");
 
         resultEndpoint.expectedMessageCount(3);
 
@@ -93,7 +90,7 @@ public class CacheConsumerTest extends BaseCacheTest {
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.debug("Completed Test ---> testReceivingFileFromCache()");
+        log.debug("Completed Test ---> testReceivingFileFromCache()");
     }
 
     @Override
@@ -107,13 +104,13 @@ public class CacheConsumerTest extends BaseCacheTest {
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        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 ------");
+                        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 ------");
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
b/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
index 3e624be..ed550a5 100755
--- a/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheProducerTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.cache;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.util.concurrent.TimeUnit;
@@ -36,8 +37,6 @@ import org.apache.camel.converter.IOConverter;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ReflectionHelper;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class CacheProducerTest extends BaseCacheTest {
     private static final Poetry POETRY;
@@ -46,8 +45,6 @@ public class CacheProducerTest extends BaseCacheTest {
 
     private static final String FILEPATH_TEST_TXT = "src/test/resources/test.txt";
 
-    private static final transient Logger LOG = LoggerFactory.getLogger(CacheProducerTest.class);
-
     @EndpointInject(uri = "mock:CacheProducerTest.result")
     protected MockEndpoint resultEndpoint;
 
@@ -68,15 +65,10 @@ public class CacheProducerTest extends BaseCacheTest {
     private void sendFile(final String path) throws Exception {
         template.send("direct:a", new Processor() {
             public void process(Exchange exchange) throws Exception {
-                // Read from an input stream
-                InputStream is = IOHelper.buffered(new FileInputStream(path));
-
-                byte buffer[] = IOConverter.toBytes(is);
-                is.close();
-
                 // Set the property of the charset encoding
                 exchange.setProperty(Exchange.CHARSET_NAME, "UTF-8");
                 Message in = exchange.getIn();
+                byte buffer[] = context.getTypeConverter().mandatoryConvertTo(byte[].class,
new File(path));
                 in.setBody(buffer);
             }
         });
@@ -131,7 +123,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Add Test---------------");
+        log.debug("------------Beginning CacheProducer Add Test---------------");
         sendOriginalFile();
     }
 
@@ -148,7 +140,7 @@ public class CacheProducerTest extends BaseCacheTest {
         context.start();
         NotifyBuilder notify = new NotifyBuilder(context).whenExactlyDone(1).create();
 
-        LOG.debug("------------Beginning CacheProducer Add Test---------------");
+        log.debug("------------Beginning CacheProducer Add Test---------------");
         sendOriginalFile();
 
         notify.matches(10, TimeUnit.SECONDS);
@@ -167,7 +159,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Add Test---------------");
+        log.debug("------------Beginning CacheProducer Add Test---------------");
         sendOriginalFile();
         Element element = fetchElement("Ralph_Waldo_Emerson");
         assertTrue(element.isEternal());
@@ -185,7 +177,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Add Test---------------");
+        log.debug("------------Beginning CacheProducer Add Test---------------");
         sendOriginalFile();
         Element element = fetchElement("Ralph_Waldo_Emerson");
         assertEquals(24, element.getTimeToIdle());
@@ -203,7 +195,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Add Test---------------");
+        log.debug("------------Beginning CacheProducer Add Test---------------");
         sendOriginalFile();
         Element element = fetchElement("Ralph_Waldo_Emerson");
         assertEquals(42, element.getTimeToLive());
@@ -233,7 +225,7 @@ public class CacheProducerTest extends BaseCacheTest {
         resultEndpoint.expectedMessageCount(0);
         cacheExceptionEndpoint.expectedMessageCount(1);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Add Does Fail On Empty Body Test---------------");
+        log.debug("------------Beginning CacheProducer Add Does Fail On Empty Body Test---------------");
         sendEmptyBody();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -250,7 +242,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Add Test---------------");
+        log.debug("------------Beginning CacheProducer Add Test---------------");
         sendOriginalFile();
     }
 
@@ -265,7 +257,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Update Test---------------");
+        log.debug("------------Beginning CacheProducer Update Test---------------");
         sendSerializedData();
     }
 
@@ -286,7 +278,7 @@ public class CacheProducerTest extends BaseCacheTest {
         });
         cacheExceptionEndpoint.expectedMessageCount(1);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Update Does Fail On Empty Body Test---------------");
+        log.debug("------------Beginning CacheProducer Update Does Fail On Empty Body Test---------------");
         sendEmptyBody();
         cacheExceptionEndpoint.assertIsSatisfied();
     }
@@ -302,7 +294,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Delete Test---------------");
+        log.debug("------------Beginning CacheProducer Delete Test---------------");
         sendUpdatedFile();
     }
 
@@ -323,7 +315,7 @@ public class CacheProducerTest extends BaseCacheTest {
         });
         cacheExceptionEndpoint.expectedMessageCount(0);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Delete Does Not Fail On Empty Body
Test---------------");
+        log.debug("------------Beginning CacheProducer Delete Does Not Fail On Empty Body
Test---------------");
         sendEmptyBody();
         cacheExceptionEndpoint.assertIsSatisfied();
     }
@@ -338,7 +330,7 @@ public class CacheProducerTest extends BaseCacheTest {
             }
         });
         context.start();
-        LOG.debug("------------Beginning CacheProducer Delete All Elements Test---------------");
+        log.debug("------------Beginning CacheProducer Delete All Elements Test---------------");
         sendUpdatedFile();
     }
 
@@ -358,7 +350,7 @@ public class CacheProducerTest extends BaseCacheTest {
         });
         cacheExceptionEndpoint.expectedMessageCount(0);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Delete All Elements Does Not Fail
On Empty Body Test---------------");
+        log.debug("------------Beginning CacheProducer Delete All Elements Does Not Fail
On Empty Body Test---------------");
         sendEmptyBody();
         cacheExceptionEndpoint.assertIsSatisfied();
     }
@@ -382,7 +374,7 @@ public class CacheProducerTest extends BaseCacheTest {
         resultEndpoint.expectedMessageCount(0);
         cacheExceptionEndpoint.expectedMessageCount(1);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Test---------------");
         sendUpdatedFile();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -410,7 +402,7 @@ public class CacheProducerTest extends BaseCacheTest {
         resultEndpoint.expectedMessageCount(0);
         cacheExceptionEndpoint.expectedMessageCount(1);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Does Fail On Empty
Body Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Does Fail On Empty
Body Test---------------");
         sendEmptyBody();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -438,7 +430,7 @@ public class CacheProducerTest extends BaseCacheTest {
         resultEndpoint.expectedMessageCount(0);
         cacheExceptionEndpoint.expectedMessageCount(0);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Test---------------");
         sendUpdatedFile();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -466,7 +458,7 @@ public class CacheProducerTest extends BaseCacheTest {
         resultEndpoint.expectedMessageCount(0);
         cacheExceptionEndpoint.expectedMessageCount(0);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Does Not Fail On
Empty Body Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Does Not Fail On
Empty Body Test---------------");
         sendEmptyBody();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -499,7 +491,7 @@ public class CacheProducerTest extends BaseCacheTest {
         String body = new String(getFileAsByteArray(FILEPATH_UPDATEDTEST_TXT), "UTF-8");
         resultEndpoint.expectedBodiesReceived(body);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Test---------------");
         sendUpdatedFile();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -527,7 +519,7 @@ public class CacheProducerTest extends BaseCacheTest {
         cacheExceptionEndpoint.expectedMessageCount(0);
         resultEndpoint.expectedBodiesReceived(POETRY);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Test---------------");
         sendSerializedData();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -557,7 +549,7 @@ public class CacheProducerTest extends BaseCacheTest {
         cacheExceptionEndpoint.expectedMessageCount(0);
         resultEndpoint.expectedBodiesReceived(POETRY);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Test---------------");
         sendSerializedData();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -589,7 +581,7 @@ public class CacheProducerTest extends BaseCacheTest {
         cacheExceptionEndpoint.expectedMessageCount(0);
         resultEndpoint.expectedBodiesReceived(POETRY);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Query An Elements Test---------------");
+        log.debug("------------Beginning CacheProducer Query An Elements Test---------------");
         sendSerializedData();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -621,7 +613,7 @@ public class CacheProducerTest extends BaseCacheTest {
         cacheExceptionEndpoint.expectedMessageCount(0);
         resultEndpoint.expectedBodiesReceived("Test body");
         context.start();
-        LOG.debug("------------Beginning CacheProducer Check An Element Exists Test---------------");
+        log.debug("------------Beginning CacheProducer Check An Element Exists Test---------------");
         sendOriginalFile();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -652,7 +644,7 @@ public class CacheProducerTest extends BaseCacheTest {
         resultEndpoint.expectedMessageCount(0);
         cacheExceptionEndpoint.expectedMessageCount(0);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Check An Element Does Not Exist Test---------------");
+        log.debug("------------Beginning CacheProducer Check An Element Does Not Exist Test---------------");
         sendOriginalFile();
         resultEndpoint.assertIsSatisfied();
         cacheExceptionEndpoint.assertIsSatisfied();
@@ -686,7 +678,7 @@ public class CacheProducerTest extends BaseCacheTest {
         resultEndpoint.expectedMessageCount(1);
         cacheExceptionEndpoint.expectedMessageCount(0);
         context.start();
-        LOG.debug("------------Beginning CacheProducer Check An Element Does Not Exist After
Expiry Test---------------");
+        log.debug("------------Beginning CacheProducer Check An Element Does Not Exist After
Expiry Test---------------");
         sendOriginalFile();
 
         // simulate the cache element to appear as "expired" (without having to wait for
it to happen)

http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
b/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
index 9143ef8..ebd9c10 100755
--- a/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedBodyReplacerTest.java
@@ -30,11 +30,8 @@ import org.apache.camel.component.BaseCacheTest;
 import org.apache.camel.component.cache.CacheConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class CacheBasedBodyReplacerTest extends BaseCacheTest {
-    private static final transient Logger LOG = LoggerFactory.getLogger(CacheBasedBodyReplacerTest.class);
 
     @EndpointInject(uri = "mock:result")
     protected MockEndpoint resultEndpoint;
@@ -44,7 +41,7 @@ public class CacheBasedBodyReplacerTest extends BaseCacheTest {
 
     @Test
     public void testCacheBasedBodyReplacer() throws Exception {
-        LOG.debug("Beginning Test ---> testCacheBasedBodyReplacer()");
+        log.debug("Beginning Test ---> testCacheBasedBodyReplacer()");
 
         resultEndpoint.expectedMessageCount(1);
 
@@ -68,7 +65,7 @@ public class CacheBasedBodyReplacerTest extends BaseCacheTest {
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.debug("Completed Test ---> testCacheBasedBodyReplacer()");
+        log.debug("Completed Test ---> testCacheBasedBodyReplacer()");
 
     }
 
@@ -86,13 +83,13 @@ public class CacheBasedBodyReplacerTest extends BaseCacheTest {
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        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  ------");
+                        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");

http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
b/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
index bd914b6..9d6c981 100755
--- a/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedTokenReplacerTest.java
@@ -30,11 +30,8 @@ import org.apache.camel.component.BaseCacheTest;
 import org.apache.camel.component.cache.CacheConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class CacheBasedTokenReplacerTest extends BaseCacheTest {
-    private static final transient Logger LOG = LoggerFactory.getLogger(CacheBasedTokenReplacerTest.class);
 
     @EndpointInject(uri = "mock:result")
     protected MockEndpoint resultEndpoint;
@@ -49,7 +46,7 @@ public class CacheBasedTokenReplacerTest extends BaseCacheTest {
 
     @Test
     public void testCacheBasedTokenReplacer() throws Exception {
-        LOG.debug("Beginning Test ---> testCacheBasedTokenReplacer()");
+        log.debug("Beginning Test ---> testCacheBasedTokenReplacer()");
 
         resultEndpoint.expectedMessageCount(1);
 
@@ -79,7 +76,7 @@ public class CacheBasedTokenReplacerTest extends BaseCacheTest {
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.debug("Completed Test ---> testCacheBasedTokenReplacer()");
+        log.debug("Completed Test ---> testCacheBasedTokenReplacer()");
 
     }
 
@@ -99,13 +96,13 @@ public class CacheBasedTokenReplacerTest extends BaseCacheTest {
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        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  ------");
+                        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");

http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
b/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
index 1b4e225..8882cb4 100755
--- a/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/processor/cache/CacheBasedXPathElementReplacerTest.java
@@ -30,11 +30,8 @@ import org.apache.camel.component.BaseCacheTest;
 import org.apache.camel.component.cache.CacheConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class CacheBasedXPathElementReplacerTest extends BaseCacheTest {
-    private static final transient Logger LOG = LoggerFactory.getLogger(CacheBasedXPathElementReplacerTest.class);
 
     @EndpointInject(uri = "mock:result")
     protected MockEndpoint resultEndpoint;
@@ -55,7 +52,7 @@ public class CacheBasedXPathElementReplacerTest extends BaseCacheTest {
 
     @Test
     public void testCacheBasedXPathElementReplacer() throws Exception {
-        LOG.debug("Beginning Test ---> testCacheBasedXPathElementReplacer()");
+        log.debug("Beginning Test ---> testCacheBasedXPathElementReplacer()");
 
         resultEndpoint.expectedMessageCount(1);
 
@@ -82,7 +79,7 @@ public class CacheBasedXPathElementReplacerTest extends BaseCacheTest {
         }
 
         resultEndpoint.assertIsSatisfied();
-        LOG.debug("Completed Test ---> testCacheBasedXPathElementReplacer()");
+        log.debug("Completed Test ---> testCacheBasedXPathElementReplacer()");
 
     }
 
@@ -101,13 +98,13 @@ public class CacheBasedXPathElementReplacerTest extends BaseCacheTest
{
                         Object body = exchange.getIn().getBody();
                         String data = exchange.getContext().getTypeConverter().convertTo(String.class,
body);
 
-                        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  ------");
+                        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");

http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
index 4f315a9..6ef7d8a 100644
--- a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
+++ b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
@@ -136,10 +136,9 @@ public class PGPDataFormat implements DataFormat {
             outputStream = new ArmoredOutputStream(outputStream);
         }
 
-        SecureRandom random = new SecureRandom();
         PGPEncryptedDataGenerator encGen = new PGPEncryptedDataGenerator(new JcePGPDataEncryptorBuilder(PGPEncryptedData.CAST5).
                                                                              setWithIntegrityPacket(integrity).
-                                                                             setSecureRandom(random).
+                                                                             setSecureRandom(new
SecureRandom()).
                                                                              setProvider("BC"));
         encGen.addMethod(new JcePublicKeyKeyEncryptionMethodGenerator(key));
         OutputStream encOut = encGen.open(outputStream, new byte[BUFFER_SIZE]);

http://git-wip-us.apache.org/repos/asf/camel/blob/1da88509/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HexUtilsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HexUtilsTest.java
b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HexUtilsTest.java
index ac32a01..8a41b18 100644
--- a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HexUtilsTest.java
+++ b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/HexUtilsTest.java
@@ -16,24 +16,24 @@
  */
 package org.apache.camel.converter.crypto;
 
-import org.junit.Assert;
+import org.apache.camel.test.junit4.TestSupport;
 import org.junit.Test;
 
 import static org.apache.camel.converter.crypto.HexUtils.byteArrayToHexString;
 import static org.apache.camel.converter.crypto.HexUtils.hexToByteArray;
 
-public class HexUtilsTest {
+public class HexUtilsTest extends TestSupport {
 
     byte[] array = {(byte)0x01, (byte)0x23, (byte)0x45, (byte)0x67, (byte)0x89, (byte)0xAB,
(byte)0xCD, (byte)0xEF};
 
     @Test
     public void testByteArrayToHex() throws Exception {
-        Assert.assertEquals("0123456789abcdef", byteArrayToHexString(array));
+        assertEquals("0123456789abcdef", byteArrayToHexString(array));
     }
 
     @Test
     public void roundtripArray() {
-        Assert.assertArrayEquals(array, hexToByteArray(byteArrayToHexString(array)));
+        assertArrayEquals(array, hexToByteArray(byteArrayToHexString(array)));
     }
 
     @Test
@@ -50,9 +50,9 @@ public class HexUtilsTest {
             String hexString = b.toString().toLowerCase();
             if (b.length() % 2 > 0) {
                 // add the padded byte if odd
-                Assert.assertEquals(hexString + '0', byteArrayToHexString(hexToByteArray(hexString)));
+                assertEquals(hexString + '0', byteArrayToHexString(hexToByteArray(hexString)));
             } else {
-                Assert.assertEquals(hexString, byteArrayToHexString(hexToByteArray(hexString)));
+                assertEquals(hexString, byteArrayToHexString(hexToByteArray(hexString)));
             }
 
         }


Mime
View raw message