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 2012/06/04 19:57:39 UTC

svn commit: r1346059 - in /camel/trunk/components/camel-flatpack/src: main/java/org/apache/camel/component/flatpack/ test/data/fixedLong/ test/data/fixedMixed/ test/data/fixedShort/ test/java/org/apache/camel/component/flatpack/ test/resources/org/apac...

Author: davsclaus
Date: Mon Jun  4 17:57:38 2012
New Revision: 1346059

URL: http://svn.apache.org/viewvc?rev=1346059&view=rev
Log:
CAMEL-5035: Added support for handling long/short lines to flatpack component. Thanks to Chris Geer for the patch.

Added:
    camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/
    camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/PEOPLE-FixedLength.txt   (with props)
    camel/trunk/components/camel-flatpack/src/test/data/fixedShort/
    camel/trunk/components/camel-flatpack/src/test/data/fixedShort/PEOPLE-FixedLength.txt   (with props)
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java   (with props)
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java   (with props)
    camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java   (with props)
    camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml   (with props)
    camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml   (with props)
    camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml   (with props)
Modified:
    camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FixedLengthEndpoint.java
    camel/trunk/components/camel-flatpack/src/test/data/fixedLong/PEOPLE-FixedLength.txt

Modified: camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FixedLengthEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FixedLengthEndpoint.java?rev=1346059&r1=1346058&r2=1346059&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FixedLengthEndpoint.java (original)
+++ camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FixedLengthEndpoint.java Mon Jun  4 17:57:38 2012
@@ -50,6 +50,8 @@ public class FixedLengthEndpoint extends
     private LoadBalancer loadBalancer = new RoundRobinLoadBalancer();
     private ParserFactory parserFactory = DefaultParserFactory.getInstance();
     private boolean splitRows = true;
+    private boolean allowShortLines;
+    private boolean ignoreExtraColumns;
 
     public FixedLengthEndpoint() {
     }
@@ -87,7 +89,16 @@ public class FixedLengthEndpoint extends
     protected Parser createParser(String resourceUri, Reader bodyReader) throws IOException {
         InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), resourceUri);
         InputStreamReader reader = new InputStreamReader(is);
-        return getParserFactory().newFixedLengthParser(reader, bodyReader);
+        Parser parser = getParserFactory().newFixedLengthParser(reader, bodyReader);
+        if (allowShortLines) {
+            parser.setHandlingShortLines(true);
+            parser.setIgnoreParseWarnings(true);
+        }
+        if (ignoreExtraColumns) {
+            parser.setIgnoreExtraColumns(true);
+            parser.setIgnoreParseWarnings(true);
+        }
+        return parser;
     }
 
     // Properties
@@ -117,7 +128,32 @@ public class FixedLengthEndpoint extends
         return splitRows;
     }
 
+    /**
+     * Sets the Component to send each row as a separate exchange once parsed
+     */
     public void setSplitRows(boolean splitRows) {
         this.splitRows = splitRows;
     }
+
+    public boolean isAllowShortLines() {
+        return this.allowShortLines;
+    }
+
+    /**
+     * Allows for lines to be shorter than expected and ignores the extra characters
+     */
+    public void setAllowShortLines(boolean allowShortLines) {
+        this.allowShortLines = allowShortLines;
+    }
+
+    /**
+     * Allows for lines to be longer than expected and ignores the extra characters
+     */
+    public void setIgnoreExtraColumns(boolean ignoreExtraColumns) {
+        this.ignoreExtraColumns = ignoreExtraColumns;
+    }
+
+    public boolean isIgnoreExtraColumns() {
+        return ignoreExtraColumns;
+    }
 }

Modified: camel/trunk/components/camel-flatpack/src/test/data/fixedLong/PEOPLE-FixedLength.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/data/fixedLong/PEOPLE-FixedLength.txt?rev=1346059&r1=1346058&r2=1346059&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/data/fixedLong/PEOPLE-FixedLength.txt (original)
+++ camel/trunk/components/camel-flatpack/src/test/data/fixedLong/PEOPLE-FixedLength.txt Mon Jun  4 17:57:38 2012
@@ -1,4 +1,4 @@
-JOHN                               DOE                                1234 CIRCLE CT                                                                                      ELYRIA                                                                                              OH44035*
-JIMMY                              SMITH                              180 SOME ST                                                                                         AVON                                                                                                OH44011*
-JANE                               DOE                                111 MILKY WY                                                                                        AMHERST                                                                                             OH44001*
-FRED                               FLINTSTONE                         123 ROCKY WY                                                                                        BEDROCK                                                                                             AZ12345*
+JOHN-LONG                          DOE                                1234 CIRCLE CT                                                                                      ELYRIA                                                                                              OH44035*
+JIMMY-LONG                         SMITH                              180 SOME ST                                                                                         AVON                                                                                                OH44011*
+JANE-LONG                          DOE                                111 MILKY WY                                                                                        AMHERST                                                                                             OH44001*
+FRED-LONG                          FLINTSTONE                         123 ROCKY WY                                                                                        BEDROCK                                                                                             AZ12345*

Added: camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/PEOPLE-FixedLength.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/PEOPLE-FixedLength.txt?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/PEOPLE-FixedLength.txt (added)
+++ camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/PEOPLE-FixedLength.txt Mon Jun  4 17:57:38 2012
@@ -0,0 +1,4 @@
+JOHN-LONG                          DOE                                1234 CIRCLE CT                                                                                      ELYRIA                                                                                              OH44035*
+JIMMY-SHORT                        SMITH                              180 SOME ST                                                                                         AVON                                                                                                OH4401
+JANE-LONG                          DOE                                111 MILKY WY                                                                                        AMHERST                                                                                             OH44001*
+FRED-NORMAL                        FLINTSTONE                         123 ROCKY WY                                                                                        BEDROCK                                                                                             AZ12342

Propchange: camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/PEOPLE-FixedLength.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/data/fixedMixed/PEOPLE-FixedLength.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: camel/trunk/components/camel-flatpack/src/test/data/fixedShort/PEOPLE-FixedLength.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/data/fixedShort/PEOPLE-FixedLength.txt?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/data/fixedShort/PEOPLE-FixedLength.txt (added)
+++ camel/trunk/components/camel-flatpack/src/test/data/fixedShort/PEOPLE-FixedLength.txt Mon Jun  4 17:57:38 2012
@@ -0,0 +1,4 @@
+JOHN-SHORT                               DOE                          1234 CIRCLE CT                                                                                      ELYRIA                                                                                              OH4403
+JIMMY-SHORT                              SMITH                        180 SOME ST                                                                                         AVON                                                                                                OH4401
+JANE-SHORT                               DOE                          111 MILKY WY                                                                                        AMHERST                                                                                             OH4400
+FRED-SHORT                               FLINTSTONE                   123 ROCKY WY                                                                                        BEDROCK                                                                                             AZ1234

Propchange: camel/trunk/components/camel-flatpack/src/test/data/fixedShort/PEOPLE-FixedLength.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/data/fixedShort/PEOPLE-FixedLength.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java (added)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java Mon Jun  4 17:57:38 2012
@@ -0,0 +1,66 @@
+/**
+ * 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.component.flatpack;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.util.CastUtils;
+import org.apache.camel.util.ObjectHelper;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @version 
+ */
+@ContextConfiguration
+public class FixedLengthAllowLongTest extends AbstractJUnit4SpringContextTests {
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthAllowLongTest.class);
+
+    @EndpointInject(uri = "mock:results")
+    protected MockEndpoint results;
+
+    protected String[] expectedFirstName = {"JOHN-LONG", "JIMMY-LONG", "JANE-LONG", "FRED-LONG"};
+
+    @Test
+    public void testCamel() throws Exception {
+        results.expectedMessageCount(4);
+        results.assertIsSatisfied();
+
+        int counter = 0;
+        List<Exchange> list = results.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
+            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
+            assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
+            LOG.info("Result: " + counter + " = " + body);
+            counter++;
+        }
+    }
+}

Propchange: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowLongTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java (added)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java Mon Jun  4 17:57:38 2012
@@ -0,0 +1,66 @@
+/**
+ * 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.component.flatpack;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.util.CastUtils;
+import org.apache.camel.util.ObjectHelper;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @version 
+ */
+@ContextConfiguration
+public class FixedLengthAllowShortAndLongTest extends AbstractJUnit4SpringContextTests {
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthAllowShortAndLongTest.class);
+
+    @EndpointInject(uri = "mock:results")
+    protected MockEndpoint results;
+
+    protected String[] expectedFirstName = {"JOHN-LONG", "JIMMY-SHORT", "JANE-LONG", "FRED-NORMAL"};
+
+    @Test
+    public void testCamel() throws Exception {
+        results.expectedMessageCount(4);
+        results.assertIsSatisfied();
+
+        int counter = 0;
+        List<Exchange> list = results.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
+            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
+            assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
+            LOG.info("Result: " + counter + " = " + body);
+            counter++;
+        }
+    }
+}

Propchange: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java (added)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java Mon Jun  4 17:57:38 2012
@@ -0,0 +1,66 @@
+/**
+ * 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.component.flatpack;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.util.CastUtils;
+import org.apache.camel.util.ObjectHelper;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @version 
+ */
+@ContextConfiguration
+public class FixedLengthAllowShortTest extends AbstractJUnit4SpringContextTests {
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthAllowShortTest.class);
+
+    @EndpointInject(uri = "mock:results")
+    protected MockEndpoint results;
+
+    protected String[] expectedFirstName = {"JOHN-SHORT", "JIMMY-SHORT", "JANE-SHORT", "FRED-SHORT"};
+
+    @Test
+    public void testCamel() throws Exception {
+        results.expectedMessageCount(4);
+        results.assertIsSatisfied();
+
+        int counter = 0;
+        List<Exchange> list = results.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
+            Map<String, String> body = CastUtils.cast(in.getBody(Map.class));
+            assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
+            assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
+            LOG.info("Result: " + counter + " = " + body);
+            counter++;
+        }
+    }
+}

Propchange: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthAllowShortTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml (added)
+++ camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml Mon Jun  4 17:57:38 2012
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: example -->
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="file://src/test/data/fixedLong?noop=true"/>
+      <to uri="flatpack:fixed:PEOPLE-FixedLength.pzmap.xml?ignoreExtraColumns=true"/>
+    </route>
+
+    <route>
+      <from uri="flatpack:fixed:PEOPLE-FixedLength.pzmap.xml?ignoreExtraColumns=true"/>
+      <convertBodyTo type="java.util.Map"/>
+      <to uri="mock:results"/>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: example -->
+
+</beans>
\ No newline at end of file

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowLongTest-context.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml (added)
+++ camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml Mon Jun  4 17:57:38 2012
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: example -->
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="file://src/test/data/fixedMixed?noop=true"/>
+      <to uri="flatpack:fixed:PEOPLE-FixedLength.pzmap.xml?ignoreExtraColumns=true&amp;allowShortLines=true"/>
+    </route>
+
+    <route>
+      <from uri="flatpack:fixed:PEOPLE-FixedLength.pzmap.xml?ignoreExtraColumns=true&amp;allowShortLines=true"/>
+      <convertBodyTo type="java.util.Map"/>
+      <to uri="mock:results"/>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: example -->
+
+</beans>
\ No newline at end of file

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortAndLongTest-context.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml?rev=1346059&view=auto
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml (added)
+++ camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml Mon Jun  4 17:57:38 2012
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: example -->
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="file://src/test/data/fixedShort?noop=true"/>
+      <to uri="flatpack:fixed:PEOPLE-FixedLength.pzmap.xml?allowShortLines=true"/>
+    </route>
+
+    <route>
+      <from uri="flatpack:fixed:PEOPLE-FixedLength.pzmap.xml?allowShortLines=true"/>
+      <convertBodyTo type="java.util.Map"/>
+      <to uri="mock:results"/>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: example -->
+
+</beans>
\ No newline at end of file

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/FixedLengthAllowShortTest-context.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml