You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/08/23 07:37:15 UTC

svn commit: r1160552 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/dataformat/ components/camel-bindy/src/main/resources/META-INF/services/org/apache/camel/dataformat/ components/camel-bindy/src/test/java/org/apache/camel/dataforma...

Author: davsclaus
Date: Tue Aug 23 05:37:15 2011
New Revision: 1160552

URL: http://svn.apache.org/viewvc?rev=1160552&view=rev
Log:
CAMEL-4369: Added missing BindyType.Fixed so using fixed length bindy in java dsl is easier.

Added:
    camel/trunk/components/camel-bindy/src/main/resources/META-INF/services/org/apache/camel/dataformat/bindy-fixed
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyType.java
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java?rev=1160552&r1=1160551&r2=1160552&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyDataFormat.java Tue Aug 23 05:37:15 2011
@@ -70,6 +70,8 @@ public class BindyDataFormat extends Dat
     protected DataFormat createDataFormat(RouteContext routeContext) {
         if (type == BindyType.Csv) {
             setDataFormatName("bindy-csv");
+        } else if (type == BindyType.Fixed) {
+            setDataFormatName("bindy-fixed");
         } else {
             setDataFormatName("bindy-kvp");
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyType.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyType.java?rev=1160552&r1=1160551&r2=1160552&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyType.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/BindyType.java Tue Aug 23 05:37:15 2011
@@ -28,5 +28,5 @@ import javax.xml.bind.annotation.XmlType
 @XmlEnum(String.class)
 public enum BindyType {
 
-    Csv, KeyValue
+    Csv, Fixed, KeyValue
 }

Added: camel/trunk/components/camel-bindy/src/main/resources/META-INF/services/org/apache/camel/dataformat/bindy-fixed
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/resources/META-INF/services/org/apache/camel/dataformat/bindy-fixed?rev=1160552&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/resources/META-INF/services/org/apache/camel/dataformat/bindy-fixed (added)
+++ camel/trunk/components/camel-bindy/src/main/resources/META-INF/services/org/apache/camel/dataformat/bindy-fixed Tue Aug 23 05:37:15 2011
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+class=org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat

Modified: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java?rev=1160552&r1=1160551&r2=1160552&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java (original)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/marshall/simple/BindySimpleFixedLengthMarshallTest.java Tue Aug 23 05:37:15 2011
@@ -35,6 +35,7 @@ import org.apache.camel.dataformat.bindy
 import org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord;
 import org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat;
 import org.apache.camel.dataformat.bindy.model.simple.oneclass.Order;
+import org.apache.camel.model.dataformat.BindyType;
 import org.apache.camel.processor.interceptor.Tracer;
 import org.junit.Test;
 import org.springframework.test.annotation.DirtiesContext;
@@ -95,8 +96,6 @@ public class BindySimpleFixedLengthMarsh
     }
 
     public static class ContextConfig extends RouteBuilder {
-        BindyFixedLengthDataFormat camelDataFormat = new BindyFixedLengthDataFormat("org.apache.camel.dataformat.bindy.fixed.marshall.simple");
-
         public void configure() {
 
             Tracer tracer = new Tracer();
@@ -110,7 +109,9 @@ public class BindySimpleFixedLengthMarsh
 
             onException(Exception.class).maximumRedeliveries(0).handled(true);
 
-            from(URI_DIRECT_START).marshal(camelDataFormat).to(URI_MOCK_RESULT);
+            from(URI_DIRECT_START)
+                    .marshal().bindy(BindyType.Fixed, "org.apache.camel.dataformat.bindy.fixed.marshall.simple")
+                    .to(URI_MOCK_RESULT);
         }
 
     }