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/05 14:26:42 UTC

[camel] 06/09: CAMEL-13792 - Rename components to default names, Camel-mina2 to camel-mina - Fixed tests for camel-hl7 and camel-syslog

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 c53bbda407ed6bb0d0d91647cbffb4459a278479
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Aug 5 15:45:31 2019 +0200

    CAMEL-13792 - Rename components to default names, Camel-mina2 to camel-mina - Fixed tests for camel-hl7 and camel-syslog
---
 .../org/apache/camel/component/hl7/HL7ByteArrayRouteTest.java     | 8 ++++----
 .../org/apache/camel/component/hl7/HL7MLLPCodecBoundaryTest.java  | 4 ++--
 .../java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java | 4 ++--
 .../camel/component/hl7/HL7MLLPCodecMessageFloodingTest.java      | 2 +-
 .../apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java   | 4 ++--
 .../camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java     | 4 ++--
 .../java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java     | 4 ++--
 .../test/java/org/apache/camel/component/hl7/HL7RouteTest.java    | 8 ++++----
 components/camel-mllp/README.md                                   | 4 ++--
 components/camel-syslog/src/main/docs/syslog-dataformat.adoc      | 6 +++---
 .../apache/camel/component/syslog/AutomatedConversionTest.java    | 2 +-
 .../org/apache/camel/component/syslog/MinaDataFormatTest.java     | 2 +-
 .../apache/camel/component/syslog/MinaManyUDPMessagesTest.java    | 2 +-
 13 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7ByteArrayRouteTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7ByteArrayRouteTest.java
index 5c0c632..d5a61db 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7ByteArrayRouteTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7ByteArrayRouteTest.java
@@ -64,7 +64,7 @@ public class HL7ByteArrayRouteTest extends HL7TestSupport {
         in.append("\r");
         in.append(line2);
 
-        String out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
+        String out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
 
         String[] lines = out.split("\r");
         assertEquals("MSH|^~\\&|MYSENDER||||200701011539||ADR^A19||||123|||||UNICODE UTF-8", lines[0]);
@@ -87,7 +87,7 @@ public class HL7ByteArrayRouteTest extends HL7TestSupport {
         in.append("\r");
         in.append(line2);
 
-        String out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
+        String out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
         String[] lines = out.split("\r");
         assertEquals("MSH|^~\\&|MYSENDER||||200701011539||ADT^A01||||123|||||UNICODE UTF-8", lines[0]);
         assertEquals("PID|||123||Döe^John", lines[1]);
@@ -109,7 +109,7 @@ public class HL7ByteArrayRouteTest extends HL7TestSupport {
         in.append("\r");
         in.append(line2);
 
-        template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString());
+        template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString());
 
         assertMockEndpointsSatisfied();
     }
@@ -122,7 +122,7 @@ public class HL7ByteArrayRouteTest extends HL7TestSupport {
                 DataFormat hl7 = new HL7DataFormat();
                 // we setup or HL7 listener on port 8888 (using the hl7codec)
                 // and in sync mode so we can return a response
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
                     // we use the HL7 data format to unmarshal from HL7 stream
                     // to the HAPI Message model
                     // this ensures that the camel message has been enriched
diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecBoundaryTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecBoundaryTest.java
index c1f63cf..02418e3 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecBoundaryTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecBoundaryTest.java
@@ -47,7 +47,7 @@ public class HL7MLLPCodecBoundaryTest extends HL7TestSupport {
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         // check presence of correct message type
                         exchange.getIn().getBody(MDM_T02.class);
@@ -71,7 +71,7 @@ public class HL7MLLPCodecBoundaryTest extends HL7TestSupport {
         assertEquals(1022, message.length());
         MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
         mockEndpoint.expectedMessageCount(1);
-        template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", message);
+        template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", message);
         mockEndpoint.assertIsSatisfied();
     }
 
diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java
index ce776fb..b612e38 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecLongTest.java
@@ -46,7 +46,7 @@ public class HL7MLLPCodecLongTest extends HL7TestSupport {
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         assertEquals(70010, exchange.getIn().getBody(byte[].class).length);
                         MDM_T02 input = (MDM_T02)exchange.getIn().getBody(Message.class);
@@ -73,7 +73,7 @@ public class HL7MLLPCodecLongTest extends HL7TestSupport {
         }
         message = message.substring(0, message.length() - 1);
         assertEquals(70010, message.length());
-        String out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", message, String.class);
+        String out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", message, String.class);
         assertEquals("some response", out);
         // END SNIPPET: e2
     }
diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecMessageFloodingTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecMessageFloodingTest.java
index 01c83d2..651d84c 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecMessageFloodingTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecMessageFloodingTest.java
@@ -50,7 +50,7 @@ public class HL7MLLPCodecMessageFloodingTest extends HL7TestSupport {
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").unmarshal().hl7().process(new Processor() {
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").unmarshal().hl7().process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         Message input = exchange.getIn().getBody(Message.class);
                         Message response = input.generateACK();
diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java
index beaec49..e4a8263 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecPlainStringTest.java
@@ -45,7 +45,7 @@ public class HL7MLLPCodecPlainStringTest extends HL7TestSupport {
         mock.expectedBodiesReceived("Bye World");
 
         // send plain hello world as String
-        Object out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", "Hello World", String.class);
+        Object out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", "Hello World", String.class);
 
         assertMockEndpointsSatisfied();
 
@@ -59,7 +59,7 @@ public class HL7MLLPCodecPlainStringTest extends HL7TestSupport {
         return new RouteBuilder() {
             public void configure() throws Exception {
                 // START SNIPPET: e2
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         // use plain String as message format
                         String body = exchange.getIn().getBody(String.class);
diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java
index d350778..acf2f83 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecStandAndEndBytesTest.java
@@ -50,7 +50,7 @@ public class HL7MLLPCodecStandAndEndBytesTest extends HL7TestSupport {
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         Message input = exchange.getIn().getBody(Message.class);
 
@@ -76,7 +76,7 @@ public class HL7MLLPCodecStandAndEndBytesTest extends HL7TestSupport {
         in.append("\r");
         in.append(line2);
 
-        String out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
+        String out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
 
         String[] lines = out.split("\r");
         assertEquals("MSH|^~\\&|MYSENDER||||200701011539||ADR^A19||||123", lines[0]);
diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java
index e3e8dd4..9ef97ef 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7MLLPCodecTest.java
@@ -46,7 +46,7 @@ public class HL7MLLPCodecTest extends HL7TestSupport {
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         Message input = exchange.getIn().getBody(Message.class);
 
@@ -73,7 +73,7 @@ public class HL7MLLPCodecTest extends HL7TestSupport {
         in.append("\n");
         in.append(line2);
 
-        String out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
+        String out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
         // END SNIPPET: e2
 
         String[] lines = out.split("\r");
diff --git a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java
index 9929897..978b3d2 100644
--- a/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java
+++ b/components/camel-hl7/src/test/java/org/apache/camel/component/hl7/HL7RouteTest.java
@@ -61,7 +61,7 @@ public class HL7RouteTest extends HL7TestSupport {
         in.append("\r");
         in.append(line2);
 
-        String out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
+        String out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
 
         String[] lines = out.split("\r");
         assertEquals("MSH|^~\\&|MYSENDER||||200701011539||ADR^A19||||123", lines[0]);
@@ -84,7 +84,7 @@ public class HL7RouteTest extends HL7TestSupport {
         in.append("\r");
         in.append(line2);
 
-        String out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
+        String out = template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString(), String.class);
         String[] lines = out.split("\r");
         assertEquals("MSH|^~\\&|MYSENDER||||200701011539||ADT^A01||||123", lines[0]);
         assertEquals("PID|||123||Doe^John", lines[1]);
@@ -106,7 +106,7 @@ public class HL7RouteTest extends HL7TestSupport {
         in.append("\r");
         in.append(line2);
 
-        template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString());
+        template.requestBody("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", in.toString());
 
         assertMockEndpointsSatisfied();
     }
@@ -119,7 +119,7 @@ public class HL7RouteTest extends HL7TestSupport {
                 DataFormat hl7 = new HL7DataFormat();
                 // we setup or HL7 listener on port 8888 (using the hl7codec)
                 // and in sync mode so we can return a response
-                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
+                from("mina:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
                     // we use the HL7 data format to unmarshal from HL7 stream
                     // to the HAPI Message model
                     // this ensures that the camel message has been enriched
diff --git a/components/camel-mllp/README.md b/components/camel-mllp/README.md
index 1546e24..a35fdc4 100644
--- a/components/camel-mllp/README.md
+++ b/components/camel-mllp/README.md
@@ -55,7 +55,7 @@ provide all of the functionality required to effectively handle the MLLP protoco
 The camel-hl7 Mina2 codec and Netty4 decoder do not handle MLLP Framing errors very well - the component will hang waiting
 for frames to complete in some instances.
 
-While both camel-mina2 and camel-netty4 provide a "timeout" function, it is only applied to Producers.  MLLP Consumers
+While both camel-mina and camel-netty4 provide a "timeout" function, it is only applied to Producers.  MLLP Consumers
 also need to be able to timeout to recover from MLLP framing errors.  Additionally, the timeout functionality of the
 camel-netty4 component is disable after any data is received on the connection, making in ineffective for detecting
 timeouts after the first messages is received.
@@ -64,7 +64,7 @@ Also, neither the Mina2 codec nor the Netty4 decoder interrogate HL7 Acknowledgm
 difficult to use the redelivery and error handling features Camel provides.
 
 The above issues may be addressable by updating/patching the existing components, but there is one more that is not.
-Both camel-netty4 and camel-mina2 are designed to handle a large number of concurrent connections, rapid connect/disconnect
+Both camel-netty4 and camel-mina are designed to handle a large number of concurrent connections, rapid connect/disconnect
 rates, and asynchronous communication.  Forcing, these components to deal with the small number of stateful connections
 inherent to the MLLP protocol seems inappropriate.
 
diff --git a/components/camel-syslog/src/main/docs/syslog-dataformat.adoc b/components/camel-syslog/src/main/docs/syslog-dataformat.adoc
index ec2fb45..b1fc768 100644
--- a/components/camel-syslog/src/main/docs/syslog-dataformat.adoc
+++ b/components/camel-syslog/src/main/docs/syslog-dataformat.adoc
@@ -13,7 +13,7 @@ This component supports the following:
 SyslogMessage model objects.
 * Type Converter from/to SyslogMessage and
 String
-* Integration with the xref:mina2-component.adoc[camel-mina] component.
+* Integration with the xref:mina-component.adoc[camel-mina] component.
 * Integration with the xref:netty4-component.adoc[camel-netty] component.
 * Encoder and decoder for
 the xref:netty4-component.adoc[Netty4 Component] component.
@@ -40,7 +40,7 @@ as its underlying transport layer mechanism.
 The UDP port that has been assigned to syslog is 514.
 
 To expose a Syslog listener service we reuse the existing
-xref:mina2-component.adoc[Mina2 Component] component or xref:netty4-component.adoc[Netty4 Component]
+xref:mina-component.adoc[Mina Component] component or xref:netty4-component.adoc[Netty4 Component]
 where we just use the `Rfc3164SyslogDataFormat` to marshal and unmarshal
 messages. Notice that from *Camel 2.14* onwards the syslog dataformat is
 renamed to `SyslogDataFormat`.
@@ -121,7 +121,7 @@ as an InputStream:
 </camelContext>
 ------------------------------------------------------------------------------------------
 
-The same route using xref:mina2-component.adoc[Mina2 Component]
+The same route using xref:mina-component.adoc[Mina Component]
 
 [source,xml]
 -------------------------------------------------------------------------
diff --git a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/AutomatedConversionTest.java b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/AutomatedConversionTest.java
index e76a179..0e68fa2 100644
--- a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/AutomatedConversionTest.java
+++ b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/AutomatedConversionTest.java
@@ -79,7 +79,7 @@ public class AutomatedConversionTest extends CamelTestSupport {
             @Override
             public void configure() throws Exception {
                 // we setup a Syslog listener on a random port.
-                from("mina2:udp://127.0.0.1:" + serverPort).unmarshal().syslog().process(new Processor() {
+                from("mina:udp://127.0.0.1:" + serverPort).unmarshal().syslog().process(new Processor() {
                     @Override
                     public void process(Exchange ex) {
                         assertTrue(ex.getIn().getBody() instanceof SyslogMessage);
diff --git a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaDataFormatTest.java b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaDataFormatTest.java
index a6ac82f..fc886c4 100644
--- a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaDataFormatTest.java
+++ b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaDataFormatTest.java
@@ -78,7 +78,7 @@ public class MinaDataFormatTest extends CamelTestSupport {
                 DataFormat syslogDataFormat = new SyslogDataFormat();
 
                 // we setup a Syslog  listener on a random port.
-                from("mina2:udp://127.0.0.1:" + serverPort).unmarshal(syslogDataFormat).process(new Processor() {
+                from("mina:udp://127.0.0.1:" + serverPort).unmarshal(syslogDataFormat).process(new Processor() {
                     public void process(Exchange ex) {
                         assertTrue(ex.getIn().getBody() instanceof SyslogMessage);
                     }
diff --git a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaManyUDPMessagesTest.java b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaManyUDPMessagesTest.java
index b19191d..2bedbfc 100644
--- a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaManyUDPMessagesTest.java
+++ b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/MinaManyUDPMessagesTest.java
@@ -75,7 +75,7 @@ public class MinaManyUDPMessagesTest extends CamelTestSupport {
                 DataFormat syslogDataFormat = new SyslogDataFormat();
 
                 // we setup a Syslog  listener on a random port.
-                from("mina2:udp://127.0.0.1:" + serverPort).unmarshal(syslogDataFormat).process(new Processor() {
+                from("mina:udp://127.0.0.1:" + serverPort).unmarshal(syslogDataFormat).process(new Processor() {
                     public void process(Exchange ex) {
                         assertTrue(ex.getIn().getBody() instanceof SyslogMessage);
                     }