You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2019/02/05 13:04:02 UTC
[camel] branch master updated: [CAMEL-13002] Fix camel-slack osgi
feature, make them part of the build, disable those that do not work
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new cfd9ea1 [CAMEL-13002] Fix camel-slack osgi feature, make them part of the build, disable those that do not work
cfd9ea1 is described below
commit cfd9ea1e726151922e0c5f93c2b42128cb0c59d2
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Feb 5 14:03:41 2019 +0100
[CAMEL-13002] Fix camel-slack osgi feature, make them part of the build, disable those that do not work
---
.../camel/component/slack/SlackComponentVerifierExtension.java | 6 +-----
.../java/org/apache/camel/component/slack/SlackProducer.java | 7 ++-----
platforms/karaf/features/pom.xml | 10 ++++++----
3 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackComponentVerifierExtension.java b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackComponentVerifierExtension.java
index eb4b0d6..e68e4e3 100644
--- a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackComponentVerifierExtension.java
+++ b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackComponentVerifierExtension.java
@@ -35,7 +35,6 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;
-import org.json.simple.JSONObject;
import static org.apache.camel.component.slack.utils.SlackUtils.readResponse;
@@ -143,10 +142,7 @@ public class SlackComponentVerifierExtension extends DefaultComponentVerifierExt
jsonMap.put("text", message.getText());
// Generate a JSONObject
- JSONObject jsonObject = new JSONObject(jsonMap);
-
- // Return the string based on the JSON Object
- return JSONObject.toJSONString(jsonObject);
+ return new JsonObject(jsonMap).toJson();
}
}
diff --git a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackProducer.java b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackProducer.java
index c46b340..6fbe2a7 100644
--- a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackProducer.java
+++ b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackProducer.java
@@ -26,12 +26,12 @@ import org.apache.camel.Exchange;
import org.apache.camel.component.slack.helper.SlackMessage;
import org.apache.camel.support.DefaultProducer;
import org.apache.camel.support.ExchangeHelper;
+import org.apache.camel.util.json.JsonObject;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
-import org.json.simple.JSONObject;
public class SlackProducer extends DefaultProducer {
@@ -101,11 +101,8 @@ public class SlackProducer extends DefaultProducer {
buildAttachmentJson(jsonMap, attachments);
}
- // Generate a JSONObject
- JSONObject jsonObject = new JSONObject(jsonMap);
-
// Return the string based on the JSON Object
- return JSONObject.toJSONString(jsonObject);
+ return new JsonObject(jsonMap).toJson();
}
private void buildAttachmentJson(Map<String, Object> jsonMap, List<SlackMessage.Attachment> attachments) {
diff --git a/platforms/karaf/features/pom.xml b/platforms/karaf/features/pom.xml
index 2646e10..fe639db 100644
--- a/platforms/karaf/features/pom.xml
+++ b/platforms/karaf/features/pom.xml
@@ -160,6 +160,11 @@
<!-- validating using karaf 4.x -->
<profile>
<id>validate</id>
+ <activation>
+ <property>
+ <name>!skipTests</name>
+ </property>
+ </activation>
<build>
<plugins>
<plugin>
@@ -180,11 +185,8 @@
<feature>framework</feature>
</framework>
<features>
- <!-- camel-blueprint uses blueprint but its feature name is different in karaf 3.x vs 4.x -->
- <!-- camel-cdi requires to install a cdi provider first -->
- <!-- camel-cxf uses blueprint but its feature name is different in karaf 3.x vs 4.x -->
<!-- camel-ignite requires to install apache ignite first -->
- <feature>camel|camel-(?!(blueprint|cdi|cxf|ignite))*</feature>
+ <feature>camel|camel-(?!(ignite|nats|pgevent|script-groovy|spring-redis|spring-security))*</feature>
</features>
<configuration>file://${project.build.directory}/classes/config.properties</configuration>
</configuration>