You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2013/03/27 17:00:09 UTC
svn commit: r1461676 - in
/camel/branches/camel-2.9.x/components/camel-flatpack/src:
main/java/org/apache/camel/component/flatpack/ test/data/delimLong/
test/data/delimMixed/ test/data/delimShort/
test/java/org/apache/camel/component/flatpack/ test/res...
Author: cmueller
Date: Wed Mar 27 16:00:08 2013
New Revision: 1461676
URL: http://svn.apache.org/r1461676
Log:
CAMEL-6178: Camel Flatpack should respect the ignoreExtraColumns and allowShortLines options for delimited files
Thanks to Chris Geer for the patch
Added:
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimLong/
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimLong/INVENTORY-CommaDelimitedWithQualifier.txt
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimMixed/
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimMixed/INVENTORY-CommaDelimitedWithQualifier.txt
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimShort/
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimShort/INVENTORY-CommaDelimitedWithQualifier.txt
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowLongTest-context.xml
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest-context.xml
camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortTest-context.xml
Modified:
camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/DelimitedEndpoint.java
camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java
Modified: camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/DelimitedEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/DelimitedEndpoint.java?rev=1461676&r1=1461675&r2=1461676&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/DelimitedEndpoint.java (original)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/DelimitedEndpoint.java Wed Mar 27 16:00:08 2013
@@ -52,7 +52,16 @@ public class DelimitedEndpoint extends F
} else {
InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), definition);
InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
- return getParserFactory().newDelimitedParser(reader, bodyReader, delimiter, textQualifier, ignoreFirstRecord);
+ Parser parser = getParserFactory().newDelimitedParser(reader, bodyReader, delimiter, textQualifier, ignoreFirstRecord);
+ if (isAllowShortLines()) {
+ parser.setHandlingShortLines(true);
+ parser.setIgnoreParseWarnings(true);
+ }
+ if (isIgnoreExtraColumns()) {
+ parser.setIgnoreExtraColumns(true);
+ parser.setIgnoreParseWarnings(true);
+ }
+ return parser;
}
}
Modified: camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java?rev=1461676&r1=1461675&r2=1461676&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java (original)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java Wed Mar 27 16:00:08 2013
@@ -205,7 +205,16 @@ public class FlatpackDataFormat implemen
} else {
InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
- return getParserFactory().newDelimitedParser(reader, bodyReader, delimiter, textQualifier, ignoreFirstRecord);
+ Parser parser = getParserFactory().newDelimitedParser(reader, bodyReader, delimiter, textQualifier, ignoreFirstRecord);
+ if (allowShortLines) {
+ parser.setHandlingShortLines(true);
+ parser.setIgnoreParseWarnings(true);
+ }
+ if (ignoreExtraColumns) {
+ parser.setIgnoreExtraColumns(true);
+ parser.setIgnoreParseWarnings(true);
+ }
+ return parser;
}
}
}
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimLong/INVENTORY-CommaDelimitedWithQualifier.txt
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimLong/INVENTORY-CommaDelimitedWithQualifier.txt?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimLong/INVENTORY-CommaDelimitedWithQualifier.txt (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimLong/INVENTORY-CommaDelimitedWithQualifier.txt Wed Mar 27 16:00:08 2013
@@ -0,0 +1,5 @@
+"ITEM_DESC","IN_STOCK","PRICE","LAST_RECV_DT","Long"
+"SOME VALVE","2","5.00","20050101","Long"
+"AN ENGINE","100","1000.00","20040601","Long"
+"A BELT","45",".50","20030101","Long"
+"A BOLT","1000","2.75","20050101","Long"
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimMixed/INVENTORY-CommaDelimitedWithQualifier.txt
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimMixed/INVENTORY-CommaDelimitedWithQualifier.txt?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimMixed/INVENTORY-CommaDelimitedWithQualifier.txt (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimMixed/INVENTORY-CommaDelimitedWithQualifier.txt Wed Mar 27 16:00:08 2013
@@ -0,0 +1,5 @@
+"ITEM_DESC","IN_STOCK","PRICE","LAST_RECV_DT","Long"
+"SOME VALVE","2","5.00"
+"AN ENGINE","100","1000.00","20040601","Long"
+"A BELT","45",".50","20030101"
+"A BOLT","1000","2.75"
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimShort/INVENTORY-CommaDelimitedWithQualifier.txt
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimShort/INVENTORY-CommaDelimitedWithQualifier.txt?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimShort/INVENTORY-CommaDelimitedWithQualifier.txt (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/data/delimShort/INVENTORY-CommaDelimitedWithQualifier.txt Wed Mar 27 16:00:08 2013
@@ -0,0 +1,5 @@
+"ITEM_DESC","IN_STOCK","PRICE"
+"SOME VALVE","2","5.00"
+"AN ENGINE","100","1000.00"
+"A BELT","45",".50"
+"A BOLT","1000","2.75"
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowLongTest.java Wed Mar 27 16:00:08 2013
@@ -0,0 +1,80 @@
+/**
+ * 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.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;
+
+@ContextConfiguration
+public class DelimitedAllowLongTest extends AbstractJUnit4SpringContextTests {
+ private static final transient Logger LOG = LoggerFactory.getLogger(DelimitedAllowLongTest.class);
+
+ @EndpointInject(uri = "mock:results")
+ protected MockEndpoint results;
+
+ @EndpointInject(uri = "mock:results-df")
+ protected MockEndpoint resultsdf;
+
+ protected String[] expectedItemDescriptions = {"SOME VALVE", "AN ENGINE", "A BELT", "A BOLT"};
+
+ @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<?, ?> body = in.getBody(Map.class);
+ assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
+ assertEquals("ITEM_DESC", expectedItemDescriptions[counter], body.get("ITEM_DESC"));
+ LOG.info("Result: " + counter + " = " + body);
+ counter++;
+ }
+ }
+
+ @Test
+ public void testFlatpackDataFormat() throws Exception {
+ resultsdf.expectedMessageCount(1);
+ resultsdf.assertIsSatisfied();
+
+ Exchange exchange = resultsdf.getReceivedExchanges().get(0);
+ DataSetList data = exchange.getIn().getBody(DataSetList.class);
+ int counter = 0;
+ for (Map<String, Object> map : data) {
+ assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC"));
+ counter++;
+ }
+ }
+}
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest.java Wed Mar 27 16:00:08 2013
@@ -0,0 +1,80 @@
+/**
+ * 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.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;
+
+@ContextConfiguration
+public class DelimitedAllowShortAndLongTest extends AbstractJUnit4SpringContextTests {
+ private static final transient Logger LOG = LoggerFactory.getLogger(DelimitedAllowShortAndLongTest.class);
+
+ @EndpointInject(uri = "mock:results")
+ protected MockEndpoint results;
+
+ @EndpointInject(uri = "mock:results-df")
+ protected MockEndpoint resultsdf;
+
+ protected String[] expectedItemDescriptions = {"SOME VALVE", "AN ENGINE", "A BELT", "A BOLT"};
+
+ @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<?, ?> body = in.getBody(Map.class);
+ assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
+ assertEquals("ITEM_DESC", expectedItemDescriptions[counter], body.get("ITEM_DESC"));
+ LOG.info("Result: " + counter + " = " + body);
+ counter++;
+ }
+ }
+
+ @Test
+ public void testFlatpackDataFormat() throws Exception {
+ resultsdf.expectedMessageCount(1);
+ resultsdf.assertIsSatisfied();
+
+ Exchange exchange = resultsdf.getReceivedExchanges().get(0);
+ DataSetList data = exchange.getIn().getBody(DataSetList.class);
+ int counter = 0;
+ for (Map<String, Object> map : data) {
+ assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC"));
+ counter++;
+ }
+ }
+}
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedAllowShortTest.java Wed Mar 27 16:00:08 2013
@@ -0,0 +1,80 @@
+/**
+ * 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.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;
+
+@ContextConfiguration
+public class DelimitedAllowShortTest extends AbstractJUnit4SpringContextTests {
+ private static final transient Logger LOG = LoggerFactory.getLogger(DelimitedAllowShortTest.class);
+
+ @EndpointInject(uri = "mock:results")
+ protected MockEndpoint results;
+
+ @EndpointInject(uri = "mock:results-df")
+ protected MockEndpoint resultsdf;
+
+ protected String[] expectedItemDescriptions = {"SOME VALVE", "AN ENGINE", "A BELT", "A BOLT"};
+
+ @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<?, ?> body = in.getBody(Map.class);
+ assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
+ assertEquals("ITEM_DESC", expectedItemDescriptions[counter], body.get("ITEM_DESC"));
+ LOG.info("Result: " + counter + " = " + body);
+ counter++;
+ }
+ }
+
+ @Test
+ public void testFlatpackDataFormat() throws Exception {
+ resultsdf.expectedMessageCount(1);
+ resultsdf.assertIsSatisfied();
+
+ Exchange exchange = resultsdf.getReceivedExchanges().get(0);
+ DataSetList data = exchange.getIn().getBody(DataSetList.class);
+ int counter = 0;
+ for (Map<String, Object> map : data) {
+ assertEquals("ITEM_DESC", expectedItemDescriptions[counter], map.get("ITEM_DESC"));
+ counter++;
+ }
+ }
+}
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowLongTest-context.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowLongTest-context.xml?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowLongTest-context.xml (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowLongTest-context.xml Wed Mar 27 16:00:08 2013
@@ -0,0 +1,53 @@
+<?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">
+
+ <bean id="df" class="org.apache.camel.component.flatpack.FlatpackDataFormat">
+ <property name="definition" value="INVENTORY-Delimited.pzmap.xml"/>
+ <property name="fixed" value="false"/>
+ <property name="ignoreExtraColumns" value="true"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="file://src/test/data/delimLong?noop=true"/>
+ <multicast>
+ <to uri="flatpack:delim:INVENTORY-Delimited.pzmap.xml?ignoreExtraColumns=true"/>
+ <to uri="direct:df"/>
+ </multicast>
+ </route>
+
+ <route>
+ <from uri="flatpack:delim:INVENTORY-Delimited.pzmap.xml?ignoreExtraColumns=true"/>
+ <convertBodyTo type="java.util.Map"/>
+ <to uri="mock:results"/>
+ </route>
+
+ <route>
+ <from uri="direct:df"/>
+ <unmarshal ref="df"/>
+ <to uri="mock:results-df"/>
+ </route>
+
+ </camelContext>
+
+</beans>
\ No newline at end of file
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest-context.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest-context.xml?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest-context.xml (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortAndLongTest-context.xml Wed Mar 27 16:00:08 2013
@@ -0,0 +1,54 @@
+<?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">
+
+ <bean id="df" class="org.apache.camel.component.flatpack.FlatpackDataFormat">
+ <property name="definition" value="INVENTORY-Delimited.pzmap.xml"/>
+ <property name="fixed" value="false"/>
+ <property name="ignoreExtraColumns" value="true"/>
+ <property name="allowShortLines" value="true"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="file://src/test/data/delimMixed?noop=true"/>
+ <multicast>
+ <to uri="flatpack:delim:INVENTORY-Delimited.pzmap.xml?ignoreExtraColumns=true&allowShortLines=true"/>
+ <to uri="direct:df"/>
+ </multicast>
+ </route>
+
+ <route>
+ <from uri="flatpack:delim:INVENTORY-Delimited.pzmap.xml?ignoreExtraColumns=true&allowShortLines=true"/>
+ <convertBodyTo type="java.util.Map"/>
+ <to uri="mock:results"/>
+ </route>
+
+ <route>
+ <from uri="direct:df"/>
+ <unmarshal ref="df"/>
+ <to uri="mock:results-df"/>
+ </route>
+
+ </camelContext>
+
+</beans>
\ No newline at end of file
Added: camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortTest-context.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortTest-context.xml?rev=1461676&view=auto
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortTest-context.xml (added)
+++ camel/branches/camel-2.9.x/components/camel-flatpack/src/test/resources/org/apache/camel/component/flatpack/DelimitedAllowShortTest-context.xml Wed Mar 27 16:00:08 2013
@@ -0,0 +1,53 @@
+<?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">
+
+ <bean id="df" class="org.apache.camel.component.flatpack.FlatpackDataFormat">
+ <property name="definition" value="INVENTORY-Delimited.pzmap.xml"/>
+ <property name="fixed" value="false"/>
+ <property name="allowShortLines" value="true"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="file://src/test/data/delimShort?noop=true"/>
+ <multicast>
+ <to uri="flatpack:delim:INVENTORY-Delimited.pzmap.xml?allowShortLines=true"/>
+ <to uri="direct:df"/>
+ </multicast>
+ </route>
+
+ <route>
+ <from uri="flatpack:delim:INVENTORY-Delimited.pzmap.xml?allowShortLines=true"/>
+ <convertBodyTo type="java.util.Map"/>
+ <to uri="mock:results"/>
+ </route>
+
+ <route>
+ <from uri="direct:df"/>
+ <unmarshal ref="df"/>
+ <to uri="mock:results-df"/>
+ </route>
+
+ </camelContext>
+
+</beans>
\ No newline at end of file