camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r686463 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/model/dataformat/ camel-core/src/test/java/org/apache/camel/is...
Date Sat, 16 Aug 2008 08:17:54 GMT
Author: davsclaus
Date: Sat Aug 16 01:17:53 2008
New Revision: 686463

URL: http://svn.apache.org/viewvc?rev=686463&view=rev
Log:
CAMEL-823: Added hl7 as known dataformat to the builders.

Added:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
  (contents, props changed)
      - copied, changed from r686454, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/SerializationDataFormat.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/ThreadErrorHandlerTest.java
  (contents, props changed)
    activemq/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/dataformat/hl7/HL7DataFormatTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java?rev=686463&r1=686462&r2=686463&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
Sat Aug 16 01:17:53 2008
@@ -20,6 +20,7 @@
 import org.apache.camel.model.dataformat.ArtixDSContentType;
 import org.apache.camel.model.dataformat.ArtixDSDataFormat;
 import org.apache.camel.model.dataformat.CsvDataFormat;
+import org.apache.camel.model.dataformat.HL7DataFormat;
 import org.apache.camel.model.dataformat.DataFormatType;
 import org.apache.camel.model.dataformat.JaxbDataFormat;
 import org.apache.camel.model.dataformat.SerializationDataFormat;
@@ -98,6 +99,13 @@
     }
 
     /**
+     * Uses the HL7 data format
+     */
+    public T hl7() {
+        return dataFormat(new HL7DataFormat());
+    }
+
+    /**
      * Uses the JAXB data format
      */
     public T jaxb() {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java?rev=686463&r1=686462&r2=686463&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java
Sat Aug 16 01:17:53 2008
@@ -26,6 +26,7 @@
 import org.apache.camel.Processor;
 import org.apache.camel.model.dataformat.ArtixDSDataFormat;
 import org.apache.camel.model.dataformat.CsvDataFormat;
+import org.apache.camel.model.dataformat.HL7DataFormat;
 import org.apache.camel.model.dataformat.DataFormatType;
 import org.apache.camel.model.dataformat.JaxbDataFormat;
 import org.apache.camel.model.dataformat.SerializationDataFormat;
@@ -50,6 +51,7 @@
     @XmlElements({
     @XmlElement(required = false, name = "artixDS", type = ArtixDSDataFormat.class),
     @XmlElement(required = false, name = "csv", type = CsvDataFormat.class),
+    @XmlElement(required = false, name = "hl7", type = HL7DataFormat.class),
     @XmlElement(required = false, name = "jaxb", type = JaxbDataFormat.class),
     @XmlElement(required = false, name = "serialization", type = SerializationDataFormat.class),
     @XmlElement(required = false, name = "string", type = StringDataFormat.class),

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java?rev=686463&r1=686462&r2=686463&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java
Sat Aug 16 01:17:53 2008
@@ -35,5 +35,4 @@
         super("org.apache.camel.dataformat.csv.CsvDataFormat");
     }
 
-
 }
\ No newline at end of file

Copied: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
(from r686454, activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java?p2=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java&p1=activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java&r1=686454&r2=686463&rev=686463&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/CsvDataFormat.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
Sat Aug 16 01:17:53 2008
@@ -23,17 +23,17 @@
 import org.apache.camel.spi.DataFormat;
 
 /**
- * Represents a CSV (Comma Separated Values) {@link DataFormat}
+ * Represents a HL7 {@link org.apache.camel.spi.DataFormat}.
  *
+ * @see <a href="http://activemq.apache.org/camel/hl7.html">HL7 documentation</a>.
  * @version $Revision$
  */
-@XmlRootElement(name = "csv")
+@XmlRootElement(name = "hl7")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class CsvDataFormat extends DataFormatType {
+public class HL7DataFormat extends DataFormatType {
 
-    public CsvDataFormat() {
-        super("org.apache.camel.dataformat.csv.CsvDataFormat");
+    public HL7DataFormat() {
+        super("org.apache.camel.dataformat.hl7.HL7DataFormat");
     }
 
-
 }
\ No newline at end of file

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/HL7DataFormat.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/SerializationDataFormat.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/SerializationDataFormat.java?rev=686463&r1=686462&r2=686463&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/SerializationDataFormat.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/SerializationDataFormat.java
Sat Aug 16 01:17:53 2008
@@ -28,6 +28,7 @@
  */
 @XmlRootElement(name = "serialization")
 public class SerializationDataFormat extends DataFormatType {
+
     @Override
     protected DataFormat createDataFormat(RouteContext routeContext) {
         return new org.apache.camel.impl.SerializationDataFormat();

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/ThreadErrorHandlerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/ThreadErrorHandlerTest.java?rev=686463&r1=686462&r2=686463&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/ThreadErrorHandlerTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/ThreadErrorHandlerTest.java
Sat Aug 16 01:17:53 2008
@@ -1,57 +1,57 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.issues;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test to verify that error handling using thread() pool also works as expected.
- */
-public class ThreadErrorHandlerTest extends ContextTestSupport {
-
-    public void testThreadErrorHandler() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(1);
-        mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.TRUE);
-        mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(2);
-
-        template.sendBody("direct:in", "Hello World");
-
-        assertMockEndpointsSatisifed();
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                errorHandler(deadLetterChannel("mock:result").maximumRedeliveries(2));
-                
-                from("direct:in")
-                    .thread(2)
-                    .process(new Processor() {
-                        public void process(Exchange exchange) throws Exception {
-                            throw new Exception("Forced exception by unit test");
-                        }
-                    });
-            }
-        };
-    }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.issues;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test to verify that error handling using thread() pool also works as expected.
+ */
+public class ThreadErrorHandlerTest extends ContextTestSupport {
+
+    public void testThreadErrorHandler() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+        mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.TRUE);
+        mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(2);
+
+        template.sendBody("direct:in", "Hello World");
+
+        assertMockEndpointsSatisifed();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                errorHandler(deadLetterChannel("mock:result").maximumRedeliveries(2));
+                
+                from("direct:in")
+                    .thread(2)
+                    .process(new Processor() {
+                        public void process(Exchange exchange) throws Exception {
+                            throw new Exception("Forced exception by unit test");
+                        }
+                    });
+            }
+        };
+    }
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/ThreadErrorHandlerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/ThreadErrorHandlerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/dataformat/hl7/HL7DataFormatTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/dataformat/hl7/HL7DataFormatTest.java?rev=686463&r1=686462&r2=686463&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/dataformat/hl7/HL7DataFormatTest.java
(original)
+++ activemq/camel/trunk/components/camel-hl7/src/test/java/org/apache/camel/dataformat/hl7/HL7DataFormatTest.java
Sat Aug 16 01:17:53 2008
@@ -33,8 +33,6 @@
  */
 public class HL7DataFormatTest extends ContextTestSupport {
 
-    private DataFormat hl7 = new HL7DataFormat();
-
     public void testMarshal() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:marshal");
         mock.expectedMessageCount(1);
@@ -81,9 +79,9 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("direct:marshal").marshal(hl7).to("mock:marshal");
+                from("direct:marshal").marshal().hl7().to("mock:marshal");
 
-                from("direct:unmarshal").unmarshal(hl7).to("mock:unmarshal");
+                from("direct:unmarshal").unmarshal().hl7().to("mock:unmarshal");
             }
         };
     }



Mime
View raw message