Updated Branches:
  refs/heads/master 7817d1434 -> c4f236e8e

CAMEL-6238: camel-jsonpath component.


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

Branch: refs/heads/master
Commit: c4f236e8e382b89f27837aafdb4b28542b86a2c2
Parents: 7817d14
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sun Oct 6 16:37:50 2013 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sun Oct 6 16:37:50 2013 +0200

----------------------------------------------------------------------
 components/camel-jsonpath/pom.xml               |  7 +++-
 .../org/apache/camel/jsonpath/JSonPath.java     |  2 +-
 .../apache/camel/jsonpath/JSonPathEngine.java   |  4 +-
 .../apache/camel/jsonpath/JsonPathLanguage.java | 10 ++---
 .../camel/itest/karaf/CamelJsonPathTest.java    | 40 ++++++++++++++++++++
 5 files changed, 53 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c4f236e8/components/camel-jsonpath/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-jsonpath/pom.xml 
b/components/camel-jsonpath/pom.xml
index 22033a8..a8514cb 100644
--- a/components/camel-jsonpath/pom.xml
+++ b/components/camel-jsonpath/pom.xml
@@ -15,7 +15,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
 
   <modelVersion>4.0.0</modelVersion>
 
@@ -31,6 +32,8 @@
   <description>Camel JSON Path Language</description>
 
   <properties>
+    <!-- need to import spi as felix-bundle-plugin has a bug and do not 
include this package despite we use in the source code -->
+    
<camel.osgi.import.before.defaults>org.apache.camel.spi;${camel.osgi.import.strict.version}</camel.osgi.import.before.defaults>
     <camel.osgi.export.pkg>org.apache.camel.jsonpath.*</camel.osgi.export.pkg>
     
<camel.osgi.export.service>org.apache.camel.spi.LanguageResolver;language=jsonpath</camel.osgi.export.service>
   </properties>
@@ -40,7 +43,7 @@
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-core</artifactId>
     </dependency>
-     <dependency>
+    <dependency>
       <groupId>com.jayway.jsonpath</groupId>
       <artifactId>json-path</artifactId>
       <version>${json-path-version}</version>

http://git-wip-us.apache.org/repos/asf/camel/blob/c4f236e8/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPath.java
----------------------------------------------------------------------
diff --git 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPath.java
 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPath.java
index 601d64c..354875c 100644
--- 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPath.java
+++ 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPath.java
@@ -35,6 +35,6 @@ import org.apache.camel.language.LanguageAnnotation;
 @Documented
 @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
 @LanguageAnnotation(language = "jsonpath")
-public @interface JSonPath {
+public @interface JsonPath {
     String value();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/c4f236e8/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPathEngine.java
----------------------------------------------------------------------
diff --git 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPathEngine.java
 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPathEngine.java
index 745ce0e..4724199 100644
--- 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPathEngine.java
+++ 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JSonPathEngine.java
@@ -27,13 +27,13 @@ import org.apache.camel.Exchange;
 import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.WrappedFile;
 
-public class JSonPathEngine {
+public class JsonPathEngine {
 
     private final String expression;
     private final JsonPath path;
     private final Configuration configuration;
 
-    public JSonPathEngine(String expression) {
+    public JsonPathEngine(String expression) {
         this.expression = expression;
         this.configuration = Configuration.defaultConfiguration();
         this.path = JsonPath.compile(expression);

http://git-wip-us.apache.org/repos/asf/camel/blob/c4f236e8/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathLanguage.java
----------------------------------------------------------------------
diff --git 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathLanguage.java
 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathLanguage.java
index b53ce36..1b313e7 100644
--- 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathLanguage.java
+++ 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathLanguage.java
@@ -28,9 +28,9 @@ public class JsonPathLanguage extends LanguageSupport {
 
     @Override
     public Predicate createPredicate(final String predicate) {
-        final JSonPathEngine engine;
+        final JsonPathEngine engine;
         try {
-            engine = new JSonPathEngine(predicate);
+            engine = new JsonPathEngine(predicate);
         } catch (Exception e) {
             throw new ExpressionIllegalSyntaxException(predicate, e);
         }
@@ -54,9 +54,9 @@ public class JsonPathLanguage extends LanguageSupport {
 
     @Override
     public Expression createExpression(final String expression) {
-        final JSonPathEngine engine;
+        final JsonPathEngine engine;
         try {
-            engine = new JSonPathEngine(expression);
+            engine = new JsonPathEngine(expression);
         } catch (Exception e) {
             throw new ExpressionIllegalSyntaxException(expression, e);
         }
@@ -78,7 +78,7 @@ public class JsonPathLanguage extends LanguageSupport {
         };
     }
 
-    private Object evaluateJsonPath(Exchange exchange, JSonPathEngine engine) 
throws Exception {
+    private Object evaluateJsonPath(Exchange exchange, JsonPathEngine engine) 
throws Exception {
         return engine.read(exchange);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/c4f236e8/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJsonPathTest.java
----------------------------------------------------------------------
diff --git 
a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJsonPathTest.java
 
b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJsonPathTest.java
new file mode 100644
index 0000000..a86cdde
--- /dev/null
+++ 
b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJsonPathTest.java
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.itest.karaf;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+
+@RunWith(JUnit4TestRunner.class)
+public class CamelJsonpathTest extends AbstractFeatureTest {
+
+    public static final String COMPONENT = 
extractName(CamelJsonpathTest.class);
+
+    @Test
+    public void test() throws Exception {
+        testLanguage(COMPONENT);
+    }
+
+    @Configuration
+    public static Option[] configure() {
+        return configure(COMPONENT);
+    }
+
+}
\ No newline at end of file

Reply via email to