You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/01/23 09:05:17 UTC

[1/2] camel git commit: Fixed json dataformat name to use the chosen library so the name is correct. Fixed OSGi unit test that tests this.

Repository: camel
Updated Branches:
  refs/heads/master 921ae155f -> 003d4d05c


Fixed json dataformat name to use the chosen library so the name is correct. Fixed OSGi unit test that tests this.


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

Branch: refs/heads/master
Commit: 3c97afe7bcef40ca44d2f98d5f17133500c8df06
Parents: 921ae15
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jan 23 09:04:09 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jan 23 09:04:09 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/model/DataFormatDefinition.java     | 5 +++--
 .../org/apache/camel/model/dataformat/JsonDataFormat.java     | 6 ++++++
 .../apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java | 7 +++----
 3 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3c97afe7/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java b/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
index d8ad895..c4e9cf9 100644
--- a/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java
@@ -109,8 +109,9 @@ public class DataFormatDefinition extends IdentifiedType {
      * Factory method to create the data format instance
      */
     protected DataFormat createDataFormat(RouteContext routeContext) {
-        if (dataFormatName != null) {
-            return routeContext.getCamelContext().resolveDataFormat(dataFormatName);
+        // must use getDataFormatName() as we need special logic in json dataformat
+        if (getDataFormatName() != null) {
+            return routeContext.getCamelContext().resolveDataFormat(getDataFormatName());
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/3c97afe7/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java b/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
index 242bf0b..edd3a8c 100644
--- a/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
+++ b/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java
@@ -190,6 +190,12 @@ public class JsonDataFormat extends DataFormatDefinition {
     }
 
     @Override
+    public String getDataFormatName() {
+        // json data format is special as the name can be from different bundles
+        return "json-" + library.name().toLowerCase();
+    }
+
+    @Override
     protected DataFormat createDataFormat(RouteContext routeContext) {
         if (library == JsonLibrary.XStream) {
             setProperty(routeContext.getCamelContext(), this, "dataFormatName", "json-xstream");

http://git-wip-us.apache.org/repos/asf/camel/blob/3c97afe7/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
index 9d6a158..d4ae39e 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
@@ -72,8 +72,7 @@ public class CamelBlueprintTest extends OSGiBlueprintTestSupport {
 
     @Test
     public void testRouteWithMissingDataFormat() throws Exception {
-        // paxexam-karaf-container doesn't support start stop bundle well, the bundle is started when it is deployed by default.
-        /*
+        getInstalledBundle("CamelBlueprintTestBundle3").stop();
         getInstalledBundle("org.apache.camel.camel-jackson").stop();
         try {
             getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 500);
@@ -86,8 +85,8 @@ public class CamelBlueprintTest extends OSGiBlueprintTestSupport {
             fail("The blueprint container should not be available");
         } catch (Exception e) {
         }
-        getInstalledBundle("org.apache.camel.camel-jackson").start();*/
-        
+
+        getInstalledBundle("org.apache.camel.camel-jackson").start();
         getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 10000);
         getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle3)", 10000);
     }


[2/2] camel git commit: Karaf 2.4.1 version in osgi tests, but they pickup the version from the pom.xml so I dont think this code matter anymore.

Posted by da...@apache.org.
Karaf 2.4.1 version in osgi tests, but they pickup the version from the pom.xml so I dont think this code matter anymore.


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

Branch: refs/heads/master
Commit: 003d4d05c8f691a2f11d61e7988f1c05aefa1475
Parents: 3c97afe
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Jan 23 09:04:58 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Jan 23 09:04:58 2015 +0100

----------------------------------------------------------------------
 .../org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/003d4d05/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
index bf01f80..a0a31a0 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
@@ -160,7 +160,7 @@ public class OSGiIntegrationTestSupport extends CamelTestSupport {
         }
         if (karafVersion == null) {
             // setup the default version of it
-            karafVersion = "2.4.0";
+            karafVersion = "2.4.1";
         }
         return karafVersion;
     }