You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/08/02 12:49:56 UTC

[camel] 03/04: CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-XMPP

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 24adb1dedf76f3f7b457ec5a136c6d0618bf0c32
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Aug 2 14:46:20 2019 +0200

    CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-XMPP
---
 .../org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java     | 3 ++-
 .../org/apache/camel/component/xmpp/XmppDeferredConnectionTest.java | 6 ++++--
 .../java/org/apache/camel/component/xmpp/XmppMultiUserChatTest.java | 6 ++++--
 .../org/apache/camel/component/xmpp/XmppProducerConcurrentTest.java | 6 ++++--
 .../org/apache/camel/component/xmpp/XmppRobustConnectionTest.java   | 6 ++++--
 .../java/org/apache/camel/component/xmpp/XmppRouteChatTest.java     | 6 ++++--
 .../xmpp/XmppRouteMultipleProducersSingleConsumerTest.java          | 6 ++++--
 7 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java
index 55e3f75..f7122a2 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java
@@ -26,6 +26,7 @@ import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManagerFactory;
 
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.vysper.mina.TCPEndpoint;
@@ -108,7 +109,7 @@ public final class EmbeddedXmppTestServer {
         return port;
     }
 
-    public void bindSSLContextTo(JndiRegistry registry) throws Exception {
+    public void bindSSLContextTo(Registry registry) throws Exception {
         KeyStore keyStore = KeyStore.getInstance("JKS");
         keyStore.load(ObjectHelper.loadResourceAsStream("xmppServer.jks"), "secret".toCharArray());
 
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppDeferredConnectionTest.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppDeferredConnectionTest.java
index 5522583..4b924f5 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppDeferredConnectionTest.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppDeferredConnectionTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.xmpp;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Ignore;
@@ -44,8 +46,8 @@ public class XmppDeferredConnectionTest extends CamelTestSupport {
     }
 
     @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
+    protected Registry createCamelRegistry() throws Exception {
+        Registry registry = new SimpleRegistry();
 
         embeddedXmppTestServer.bindSSLContextTo(registry);
 
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppMultiUserChatTest.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppMultiUserChatTest.java
index ddc45c9..f5da4cd 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppMultiUserChatTest.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppMultiUserChatTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.xmpp;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Ignore;
@@ -32,8 +34,8 @@ public class XmppMultiUserChatTest extends CamelTestSupport {
     private EmbeddedXmppTestServer embeddedXmppTestServer;
 
     @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
+    protected Registry createCamelRegistry() throws Exception {
+        Registry registry = new SimpleRegistry();
 
         embeddedXmppTestServer.bindSSLContextTo(registry);
 
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppProducerConcurrentTest.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppProducerConcurrentTest.java
index a93e093..36345ce 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppProducerConcurrentTest.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppProducerConcurrentTest.java
@@ -21,6 +21,8 @@ import java.util.concurrent.Executors;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Ignore;
@@ -32,8 +34,8 @@ public class XmppProducerConcurrentTest extends CamelTestSupport {
     private EmbeddedXmppTestServer embeddedXmppTestServer;
 
     @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
+    protected Registry createCamelRegistry() throws Exception {
+        Registry registry = new SimpleRegistry();
 
         embeddedXmppTestServer.bindSSLContextTo(registry);
 
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRobustConnectionTest.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRobustConnectionTest.java
index 45c3159..9455d07 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRobustConnectionTest.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRobustConnectionTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.xmpp;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Before;
@@ -33,8 +35,8 @@ public class XmppRobustConnectionTest extends CamelTestSupport {
     private EmbeddedXmppTestServer embeddedXmppTestServer;
 
     @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
+    protected Registry createCamelRegistry() throws Exception {
+        Registry registry = new SimpleRegistry();
 
         embeddedXmppTestServer.bindSSLContextTo(registry);
 
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java
index 8b5a48a..41d5702 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.xmpp;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Ignore;
@@ -33,8 +35,8 @@ public class XmppRouteChatTest extends CamelTestSupport {
     private EmbeddedXmppTestServer embeddedXmppTestServer;
 
     @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
+    protected Registry createCamelRegistry() throws Exception {
+        Registry registry = new SimpleRegistry();
 
         embeddedXmppTestServer.bindSSLContextTo(registry);
 
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
index 272a6fa..d0fb1f3 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.xmpp;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.After;
 import org.junit.Ignore;
@@ -30,8 +32,8 @@ public class XmppRouteMultipleProducersSingleConsumerTest extends CamelTestSuppo
     private EmbeddedXmppTestServer embeddedXmppTestServer;
 
     @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
+    protected Registry createCamelRegistry() throws Exception {
+        Registry registry = new SimpleRegistry();
 
         embeddedXmppTestServer.bindSSLContextTo(registry);