You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2015/03/02 06:39:29 UTC

[3/3] camel git commit: CAMEL-8346 Poilsh the test code

CAMEL-8346 Poilsh the test code


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

Branch: refs/heads/master
Commit: d0b5f0498c957e436de23a4dd192dccefdec6838
Parents: 9a10aa8
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Mar 2 13:37:40 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Mar 2 13:39:04 2015 +0800

----------------------------------------------------------------------
 .../org/apache/camel/jsonpath/JsonPathSourceTest.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d0b5f049/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathSourceTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathSourceTest.java b/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathSourceTest.java
index aeb85e9..24b8cb4 100644
--- a/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathSourceTest.java
+++ b/components/camel-jsonpath/src/test/java/org/apache/camel/jsonpath/JsonPathSourceTest.java
@@ -23,13 +23,20 @@ import java.nio.charset.Charset;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.file.FileConsumer;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.AfterClass;
 import org.junit.Test;
 
+
 public class JsonPathSourceTest extends CamelTestSupport {
     private static final String MESSAGE1 = "Joseph und seine Br\u00fcder";
     private static final String MESSAGE2 = "G\u00f6tzend\u00e4mmerung";
-       
+    private static final Charset DEFAULT_CHARSET = Charset.defaultCharset();   
 
+    @AfterClass
+    public static void setDefaultCharsetBack() {
+        switchToDefaultCharset(DEFAULT_CHARSET.displayName());
+    }
+     
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
@@ -95,12 +102,13 @@ public class JsonPathSourceTest extends CamelTestSupport {
         assertMockEndpointsSatisfied();
     }
 
-    private void switchToDefaultCharset(String charset) {
+    private static void switchToDefaultCharset(String charset) {
         try {
             Field defaultCharset = Charset.class.getDeclaredField("defaultCharset");
             defaultCharset.setAccessible(true);
             defaultCharset.set(null, Charset.forName(charset));
         } catch (Exception e) {
+            // Do nothing here
         }
     }