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/06/21 14:10:05 UTC

[camel] branch master updated (edb162b -> d91998c)

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

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


    from edb162b  CAMEL-13663: camel-main-maven-plugin to generte spring-boot tooling metadata to fool Java editors to have code completions for Camel Main application.properties files.
     new 97bd629  Camel-Nats: Use BindToRegistry annotation where possible in tests
     new d91998c  Camel-Nats: Fixed CS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../nats/NatsConsumerWithConnectionLoadTest.java   | 22 +++++++++-------------
 .../camel/component/nats/NatsProducerTLSTest.java  | 14 +++++---------
 2 files changed, 14 insertions(+), 22 deletions(-)


[camel] 01/02: Camel-Nats: Use BindToRegistry annotation where possible in tests

Posted by ac...@apache.org.
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 97bd6290eafc2e131398573bfb7d0298fe030140
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 21 16:06:05 2019 +0200

    Camel-Nats: Use BindToRegistry annotation where possible in tests
---
 .../nats/NatsConsumerWithConnectionLoadTest.java   | 22 +++++++++-------------
 .../camel/component/nats/NatsProducerTLSTest.java  | 16 +++++++---------
 2 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerWithConnectionLoadTest.java b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerWithConnectionLoadTest.java
index eccf3e2..c87ea8b 100644
--- a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerWithConnectionLoadTest.java
+++ b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsConsumerWithConnectionLoadTest.java
@@ -24,10 +24,10 @@ import io.nats.client.Nats;
 import io.nats.client.Options;
 import io.nats.client.Options.Builder;
 
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
 import org.junit.Test;
 
 public class NatsConsumerWithConnectionLoadTest extends NatsTestSupport {
@@ -39,6 +39,14 @@ public class NatsConsumerWithConnectionLoadTest extends NatsTestSupport {
     protected MockEndpoint mockResultEndpoint1;
     
     private Connection connection;
+    
+    @BindToRegistry("connection")
+    public Connection connection() throws IllegalStateException, IOException, InterruptedException {
+        Builder options = new Options.Builder();
+        options.server("nats://" + getNatsUrl());
+        connection = Nats.connect(options.build());
+        return connection;
+    }
 
     @Test
     public void testLoadConsumer() throws InterruptedException, IOException, TimeoutException {
@@ -54,18 +62,6 @@ public class NatsConsumerWithConnectionLoadTest extends NatsTestSupport {
         mockResultEndpoint.assertIsSatisfied();
         mockResultEndpoint1.assertIsSatisfied();
     }
-    
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        
-        Builder options = new Options.Builder();
-        options.server("nats://" + getNatsUrl());
-        connection = Nats.connect(options.build());
-        registry.bind("connection", connection);
-        
-        return registry;
-    }
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
diff --git a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java
index a0b8774..f1d91dc 100644
--- a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java
+++ b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java
@@ -16,8 +16,8 @@
  */
 package org.apache.camel.component.nats;
 
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.support.jsse.KeyManagersParameters;
 import org.apache.camel.support.jsse.KeyStoreParameters;
 import org.apache.camel.support.jsse.SSLContextParameters;
@@ -31,20 +31,18 @@ import org.junit.Test;
  */
 @Ignore("Require a running Nats server")
 public class NatsProducerTLSTest extends CamelTestSupport {
-    
+   
+
+	@BindToRegistry("ssl")
+	SSLContextParameters ssl = createSSLContextParameters();
+
+	
     @Test
     public void sendTest() throws Exception {
         
         template.sendBody("direct:send", "pippo");
     }
     
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        registry.bind("ssl", createSSLContextParameters());
-        return registry;
-    }
-    
     private SSLContextParameters createSSLContextParameters() {
         SSLContextParameters sslContextParameters = new SSLContextParameters();
 


[camel] 02/02: Camel-Nats: Fixed CS

Posted by ac...@apache.org.
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 d91998ce8d8ca67db3eb1b5a2f963689c39e9e58
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 21 16:09:19 2019 +0200

    Camel-Nats: Fixed CS
---
 .../java/org/apache/camel/component/nats/NatsProducerTLSTest.java   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java
index f1d91dc..f15ab7b 100644
--- a/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java
+++ b/components/camel-nats/src/test/java/org/apache/camel/component/nats/NatsProducerTLSTest.java
@@ -32,11 +32,9 @@ import org.junit.Test;
 @Ignore("Require a running Nats server")
 public class NatsProducerTLSTest extends CamelTestSupport {
    
+    @BindToRegistry("ssl")
+    SSLContextParameters ssl = createSSLContextParameters();
 
-	@BindToRegistry("ssl")
-	SSLContextParameters ssl = createSSLContextParameters();
-
-	
     @Test
     public void sendTest() throws Exception {