You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/12/08 09:47:52 UTC
svn commit: r724289 - in /activemq/camel/trunk/camel-core/src:
main/java/org/apache/camel/ main/java/org/apache/camel/component/file/
main/java/org/apache/camel/impl/ main/java/org/apache/camel/model/
main/java/org/apache/camel/model/dataformat/ test/j...
Author: ningjiang
Date: Mon Dec 8 00:47:51 2008
New Revision: 724289
URL: http://svn.apache.org/viewvc?rev=724289&view=rev
Log:
Applied svn properties to camel-core module
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeException.java (props changed)
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/DefaultFileSorter.java (contents, props changed)
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java (contents, props changed)
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerTemplateProcessor.java (contents, props changed)
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProxyInstantiationException.java (contents, props changed)
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExpressionSubElementType.java (props changed)
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoggingLevel.java (contents, props changed)
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/RssDataFormat.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/CustomLog.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderWithRetryLoggingLevelSetTest.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/MyExceptionThrowingProcessor.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithExchangeExceptionAnnotationTest.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/MyCustomException.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBatchTest.java (contents, props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java (contents, props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileSortByNestedExpressionTest.java (contents, props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ObjectHelperTest.java (contents, props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelExceptionCausePropagatedTest.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelHandledExampleTest.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MyNormalizer.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/NormalizerTest.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterWithCustomThreadPoolExecutorTest.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorWithOutBodyTraceTest.java (props changed)
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/MyReverseAggregationCollection.java (props changed)
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/ExchangeException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/DefaultFileSorter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/DefaultFileSorter.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/DefaultFileSorter.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/DefaultFileSorter.java Mon Dec 8 00:47:51 2008
@@ -1,146 +1,146 @@
-/**
- * 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.file;
-
-import java.io.File;
-import java.util.Comparator;
-
-import org.apache.camel.Expression;
-import org.apache.camel.language.simple.FileLanguage;
-import org.apache.camel.util.ObjectHelper;
-
-/**
- * Default file sorter.
- *
- * @version $Revision$
- */
-public final class DefaultFileSorter {
-
- private DefaultFileSorter() {
- }
-
- /**
- * Returns a new sort by name
- */
- public static Comparator<File> sortByName(final boolean reverse) {
- return new Comparator<File>() {
- public int compare(File o1, File o2) {
- int answer = o1.getName().compareTo(o2.getName());
- return reverse ? -1 * answer : answer;
- }
- };
- }
-
- /**
- * Returns a new sort by path name
- */
- public static Comparator<File> sortByPathName(final boolean reverse) {
- return new Comparator<File>() {
- public int compare(File o1, File o2) {
- int answer = o1.getPath().compareTo(o2.getPath());
- return reverse ? -1 * answer : answer;
- }
- };
- }
-
- /**
- * Returns a new sort by last modified (newest first)
- */
- public static Comparator<File> sortByLastModified(final boolean reverse) {
- return new Comparator<File>() {
- public int compare(File o1, File o2) {
- long delta = o1.lastModified() - o2.lastModified();
- if (delta == 0) {
- return 0;
- }
- int answer = delta > 0 ? 1 : -1;
- return reverse ? -1 * answer : answer;
- }
- };
- }
-
- /**
- * Returns a new sort by file size (smallest first)
- */
- public static Comparator<File> sortBySize(final boolean reverse) {
- return new Comparator<File>() {
- public int compare(File o1, File o2) {
- long delta = o1.length() - o2.length();
- if (delta == 0) {
- return 0;
- }
- int answer = delta > 0 ? 1 : -1;
- return reverse ? -1 * answer : answer;
- }
- };
- }
-
- /**
- * Returns a new sory by file language expression
- *
- * @param expression the file language expression
- * @param reverse true to reverse order
- * @return the comparator
- */
- public static Comparator<FileExchange> sortByFileLanguage(final String expression, final boolean reverse) {
- return sortByFileLanguage(expression, reverse, false, null);
- }
-
- /**
- * Returns a new sory by file language expression
- *
- * @param expression the file language expression
- * @param reverse true to reverse order
- * @param ignoreCase ignore case if comparing strings
- * @return the comparator
- */
- public static Comparator<FileExchange> sortByFileLanguage(final String expression, final boolean reverse,
- final boolean ignoreCase) {
- return sortByFileLanguage(expression, reverse, ignoreCase, null);
- }
-
- /**
- * Returns a new sory by file language expression
- *
- * @param expression the file language expression
- * @param reverse true to reverse order
- * @param ignoreCase ignore case if comparing strings
- * @param nested nested comparator for sub group sorting, can be null
- * @return the comparator
- */
- public static Comparator<FileExchange> sortByFileLanguage(final String expression, final boolean reverse,
- final boolean ignoreCase, final Comparator<FileExchange> nested) {
- return new Comparator<FileExchange>() {
- public int compare(FileExchange o1, FileExchange o2) {
- final Expression exp = FileLanguage.file(expression);
- Object result1 = exp.evaluate(o1);
- Object result2 = exp.evaluate(o2);
- int answer = ObjectHelper.compare(result1, result2, ignoreCase);
- // if equal then sub sort by nested comparator
- if (answer == 0 && nested != null) {
- answer = nested.compare(o1, o2);
- }
- return reverse ? -1 * answer : answer;
- }
-
- public String toString() {
- return expression + (nested != null ? ";" + nested.toString() : "");
- }
- };
- }
-
-}
+/**
+ * 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.file;
+
+import java.io.File;
+import java.util.Comparator;
+
+import org.apache.camel.Expression;
+import org.apache.camel.language.simple.FileLanguage;
+import org.apache.camel.util.ObjectHelper;
+
+/**
+ * Default file sorter.
+ *
+ * @version $Revision$
+ */
+public final class DefaultFileSorter {
+
+ private DefaultFileSorter() {
+ }
+
+ /**
+ * Returns a new sort by name
+ */
+ public static Comparator<File> sortByName(final boolean reverse) {
+ return new Comparator<File>() {
+ public int compare(File o1, File o2) {
+ int answer = o1.getName().compareTo(o2.getName());
+ return reverse ? -1 * answer : answer;
+ }
+ };
+ }
+
+ /**
+ * Returns a new sort by path name
+ */
+ public static Comparator<File> sortByPathName(final boolean reverse) {
+ return new Comparator<File>() {
+ public int compare(File o1, File o2) {
+ int answer = o1.getPath().compareTo(o2.getPath());
+ return reverse ? -1 * answer : answer;
+ }
+ };
+ }
+
+ /**
+ * Returns a new sort by last modified (newest first)
+ */
+ public static Comparator<File> sortByLastModified(final boolean reverse) {
+ return new Comparator<File>() {
+ public int compare(File o1, File o2) {
+ long delta = o1.lastModified() - o2.lastModified();
+ if (delta == 0) {
+ return 0;
+ }
+ int answer = delta > 0 ? 1 : -1;
+ return reverse ? -1 * answer : answer;
+ }
+ };
+ }
+
+ /**
+ * Returns a new sort by file size (smallest first)
+ */
+ public static Comparator<File> sortBySize(final boolean reverse) {
+ return new Comparator<File>() {
+ public int compare(File o1, File o2) {
+ long delta = o1.length() - o2.length();
+ if (delta == 0) {
+ return 0;
+ }
+ int answer = delta > 0 ? 1 : -1;
+ return reverse ? -1 * answer : answer;
+ }
+ };
+ }
+
+ /**
+ * Returns a new sory by file language expression
+ *
+ * @param expression the file language expression
+ * @param reverse true to reverse order
+ * @return the comparator
+ */
+ public static Comparator<FileExchange> sortByFileLanguage(final String expression, final boolean reverse) {
+ return sortByFileLanguage(expression, reverse, false, null);
+ }
+
+ /**
+ * Returns a new sory by file language expression
+ *
+ * @param expression the file language expression
+ * @param reverse true to reverse order
+ * @param ignoreCase ignore case if comparing strings
+ * @return the comparator
+ */
+ public static Comparator<FileExchange> sortByFileLanguage(final String expression, final boolean reverse,
+ final boolean ignoreCase) {
+ return sortByFileLanguage(expression, reverse, ignoreCase, null);
+ }
+
+ /**
+ * Returns a new sory by file language expression
+ *
+ * @param expression the file language expression
+ * @param reverse true to reverse order
+ * @param ignoreCase ignore case if comparing strings
+ * @param nested nested comparator for sub group sorting, can be null
+ * @return the comparator
+ */
+ public static Comparator<FileExchange> sortByFileLanguage(final String expression, final boolean reverse,
+ final boolean ignoreCase, final Comparator<FileExchange> nested) {
+ return new Comparator<FileExchange>() {
+ public int compare(FileExchange o1, FileExchange o2) {
+ final Expression exp = FileLanguage.file(expression);
+ Object result1 = exp.evaluate(o1);
+ Object result2 = exp.evaluate(o2);
+ int answer = ObjectHelper.compare(result1, result2, ignoreCase);
+ // if equal then sub sort by nested comparator
+ if (answer == 0 && nested != null) {
+ answer = nested.compare(o1, o2);
+ }
+ return reverse ? -1 * answer : answer;
+ }
+
+ public String toString() {
+ return expression + (nested != null ? ";" + nested.toString() : "");
+ }
+ };
+ }
+
+}
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/DefaultFileSorter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/DefaultFileSorter.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java Mon Dec 8 00:47:51 2008
@@ -42,7 +42,7 @@
* both the <a href="http://activemq.apache.org/camel/spring.html">Spring</a>
* and <a href="http://activemq.apache.org/camel/guice.html">Guice</a> support.
*
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class CamelPostProcessorHelper implements CamelContextAware {
private static final transient Log LOG = LogFactory.getLog(CamelPostProcessorHelper.class);
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/CamelPostProcessorHelper.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerTemplateProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerTemplateProcessor.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerTemplateProcessor.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerTemplateProcessor.java Mon Dec 8 00:47:51 2008
@@ -24,7 +24,7 @@
/**
* A simple processor which just sends the message exchange to the default endpoint of the {@link ProducerTemplate}
*
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ProducerTemplateProcessor implements Processor {
private final ProducerTemplate producerTemplate;
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerTemplateProcessor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProxyInstantiationException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProxyInstantiationException.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProxyInstantiationException.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProxyInstantiationException.java Mon Dec 8 00:47:51 2008
@@ -21,7 +21,7 @@
/**
* A proxy creation failed trying to create a proxy of a given type and on an given endpoint
*
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ProxyInstantiationException extends RuntimeException {
private final Class<?> type;
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProxyInstantiationException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ExpressionSubElementType.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoggingLevel.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoggingLevel.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoggingLevel.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoggingLevel.java Mon Dec 8 00:47:51 2008
@@ -21,7 +21,7 @@
/**
* Used to configure the logging levels
*
- * @version $Revision: 703680 $
+ * @version $Revision$
*/
@XmlEnum
public enum LoggingLevel {
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/LoggingLevel.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/RssDataFormat.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/CustomLog.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderWithRetryLoggingLevelSetTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/MyExceptionThrowingProcessor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithExchangeExceptionAnnotationTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/MyCustomException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBatchTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBatchTest.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBatchTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBatchTest.java Mon Dec 8 00:47:51 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.component.file;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test for consuming a batch of files (multiple files in one consume)
- */
-public class FileConsumerBatchTest extends ContextTestSupport {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- deleteDirectory("target/idempotent");
- template.sendBodyAndHeader("file://target/file-batch/", "Hello World", FileComponent.HEADER_FILE_NAME, "hello.txt");
- template.sendBodyAndHeader("file://target/file-batch/", "Bye World", FileComponent.HEADER_FILE_NAME, "bye.txt");
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() throws Exception {
- from("file://target/file-batch?consumer.delay=1000").to("mock:result");
- }
- };
- }
-
- public void testConsumeBatch() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World");
-
- // test header keys
- mock.message(0).header(FileComponent.HEADER_FILE_BATCH_TOTAL).isEqualTo(2);
- mock.message(0).header(FileComponent.HEADER_FILE_BATCH_INDEX).isEqualTo(0);
- mock.message(1).header(FileComponent.HEADER_FILE_BATCH_INDEX).isEqualTo(1);
-
- assertMockEndpointsSatisfied();
- }
-
+/**
+ * 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.file;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test for consuming a batch of files (multiple files in one consume)
+ */
+public class FileConsumerBatchTest extends ContextTestSupport {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ deleteDirectory("target/idempotent");
+ template.sendBodyAndHeader("file://target/file-batch/", "Hello World", FileComponent.HEADER_FILE_NAME, "hello.txt");
+ template.sendBodyAndHeader("file://target/file-batch/", "Bye World", FileComponent.HEADER_FILE_NAME, "bye.txt");
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from("file://target/file-batch?consumer.delay=1000").to("mock:result");
+ }
+ };
+ }
+
+ public void testConsumeBatch() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World");
+
+ // test header keys
+ mock.message(0).header(FileComponent.HEADER_FILE_BATCH_TOTAL).isEqualTo(2);
+ mock.message(0).header(FileComponent.HEADER_FILE_BATCH_INDEX).isEqualTo(0);
+ mock.message(1).header(FileComponent.HEADER_FILE_BATCH_INDEX).isEqualTo(1);
+
+ assertMockEndpointsSatisfied();
+ }
+
}
\ No newline at end of file
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBatchTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBatchTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java Mon Dec 8 00:47:51 2008
@@ -1,99 +1,99 @@
-/**
- * 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.file;
-
-import java.io.File;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
-import org.apache.camel.spi.IdempotentRepository;
-
-/**
- * Unit test for the idempotentRepositoryRef option.
- */
-public class FileConsumerIdempotentRefTest extends ContextTestSupport {
-
- private static boolean invoked;
-
- @Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry jndi = super.createRegistry();
- jndi.bind("myRepo", new MyIdempotentRepository());
- return jndi;
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- deleteDirectory("target/idempotent");
- template.sendBodyAndHeader("file://target/idempotent/", "Hello World", FileComponent.HEADER_FILE_NAME, "report.txt");
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() throws Exception {
- from("file://target/idempotent/?idempotent=true&idempotentRepositoryRef=myRepo&moveNamePrefix=done/").to("mock:result");
- }
- };
- }
-
- public void testIdempotentRef() throws Exception {
- // consume the file the first time
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedBodiesReceived("Hello World");
- mock.expectedMessageCount(1);
-
- assertMockEndpointsSatisfied();
-
- Thread.sleep(100);
-
- // reset mock and set new expectations
- mock.reset();
- mock.expectedMessageCount(0);
-
- // move file back
- File file = new File("target/idempotent/done/report.txt");
- File renamed = new File("target/idempotent/report.txt");
- file = file.getAbsoluteFile();
- file.renameTo(renamed.getAbsoluteFile());
-
- // should NOT consume the file again, let 2 secs pass to let the consumer try to consume it but it should not
- Thread.sleep(2000);
- assertMockEndpointsSatisfied();
-
- assertTrue("MyIdempotentRepository should have been invoked", invoked);
- }
-
- public class MyIdempotentRepository implements IdempotentRepository<String> {
-
- public boolean add(String messageId) {
- // will return true 1st time, and false 2nd time
- boolean result = invoked;
- invoked = true;
- assertEquals("report.txt", messageId);
- return !result;
- }
-
- public boolean contains(String key) {
- return false;
- }
- }
-
+/**
+ * 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.file;
+
+import java.io.File;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.IdempotentRepository;
+
+/**
+ * Unit test for the idempotentRepositoryRef option.
+ */
+public class FileConsumerIdempotentRefTest extends ContextTestSupport {
+
+ private static boolean invoked;
+
+ @Override
+ protected JndiRegistry createRegistry() throws Exception {
+ JndiRegistry jndi = super.createRegistry();
+ jndi.bind("myRepo", new MyIdempotentRepository());
+ return jndi;
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ deleteDirectory("target/idempotent");
+ template.sendBodyAndHeader("file://target/idempotent/", "Hello World", FileComponent.HEADER_FILE_NAME, "report.txt");
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from("file://target/idempotent/?idempotent=true&idempotentRepositoryRef=myRepo&moveNamePrefix=done/").to("mock:result");
+ }
+ };
+ }
+
+ public void testIdempotentRef() throws Exception {
+ // consume the file the first time
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedBodiesReceived("Hello World");
+ mock.expectedMessageCount(1);
+
+ assertMockEndpointsSatisfied();
+
+ Thread.sleep(100);
+
+ // reset mock and set new expectations
+ mock.reset();
+ mock.expectedMessageCount(0);
+
+ // move file back
+ File file = new File("target/idempotent/done/report.txt");
+ File renamed = new File("target/idempotent/report.txt");
+ file = file.getAbsoluteFile();
+ file.renameTo(renamed.getAbsoluteFile());
+
+ // should NOT consume the file again, let 2 secs pass to let the consumer try to consume it but it should not
+ Thread.sleep(2000);
+ assertMockEndpointsSatisfied();
+
+ assertTrue("MyIdempotentRepository should have been invoked", invoked);
+ }
+
+ public class MyIdempotentRepository implements IdempotentRepository<String> {
+
+ public boolean add(String messageId) {
+ // will return true 1st time, and false 2nd time
+ boolean result = invoked;
+ invoked = true;
+ assertEquals("report.txt", messageId);
+ return !result;
+ }
+
+ public boolean contains(String key) {
+ return false;
+ }
+ }
+
}
\ No newline at end of file
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerIdempotentRefTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileSortByNestedExpressionTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileSortByNestedExpressionTest.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileSortByNestedExpressionTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileSortByNestedExpressionTest.java Mon Dec 8 00:47:51 2008
@@ -1,76 +1,76 @@
-/**
- * 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.file;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test for the file sort by expression with nested groups
- */
-public class FileSortByNestedExpressionTest extends ContextTestSupport {
-
- private String fileUrl = "file://target/filesorter/";
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- deleteDirectory("target/filesorter");
- }
-
- private void prepareFolder(String folder) {
- template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello Paris",
- FileComponent.HEADER_FILE_NAME, "paris.txt");
-
- template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello London",
- FileComponent.HEADER_FILE_NAME, "london.txt");
-
- template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello Copenhagen",
- FileComponent.HEADER_FILE_NAME, "copenhagen.xml");
-
- template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello Dublin",
- FileComponent.HEADER_FILE_NAME, "dublin.txt");
- }
-
- public void testSortNestedFiles() throws Exception {
- prepareFolder("a");
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedBodiesReceived("Hello Dublin", "Hello London", "Hello Paris", "Hello Copenhagen");
-
- assertMockEndpointsSatisfied();
- }
-
- public void testSortNestedFilesReverse() throws Exception {
- prepareFolder("b");
- MockEndpoint reverse = getMockEndpoint("mock:reverse");
- reverse.expectedBodiesReceived("Hello Paris", "Hello London", "Hello Dublin", "Hello Copenhagen");
-
- assertMockEndpointsSatisfied();
- }
-
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- public void configure() throws Exception {
- from(fileUrl + "a/?sortBy=file:name.ext;file:name").to("mock:result");
-
- from(fileUrl + "b/?sortBy=file:name.ext;reverse:file:name").to("mock:reverse");
- }
- };
- }
-
+/**
+ * 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.file;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test for the file sort by expression with nested groups
+ */
+public class FileSortByNestedExpressionTest extends ContextTestSupport {
+
+ private String fileUrl = "file://target/filesorter/";
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ deleteDirectory("target/filesorter");
+ }
+
+ private void prepareFolder(String folder) {
+ template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello Paris",
+ FileComponent.HEADER_FILE_NAME, "paris.txt");
+
+ template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello London",
+ FileComponent.HEADER_FILE_NAME, "london.txt");
+
+ template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello Copenhagen",
+ FileComponent.HEADER_FILE_NAME, "copenhagen.xml");
+
+ template.sendBodyAndHeader("file:target/filesorter/" + folder, "Hello Dublin",
+ FileComponent.HEADER_FILE_NAME, "dublin.txt");
+ }
+
+ public void testSortNestedFiles() throws Exception {
+ prepareFolder("a");
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedBodiesReceived("Hello Dublin", "Hello London", "Hello Paris", "Hello Copenhagen");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ public void testSortNestedFilesReverse() throws Exception {
+ prepareFolder("b");
+ MockEndpoint reverse = getMockEndpoint("mock:reverse");
+ reverse.expectedBodiesReceived("Hello Paris", "Hello London", "Hello Dublin", "Hello Copenhagen");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from(fileUrl + "a/?sortBy=file:name.ext;file:name").to("mock:result");
+
+ from(fileUrl + "b/?sortBy=file:name.ext;reverse:file:name").to("mock:reverse");
+ }
+ };
+ }
+
}
\ No newline at end of file
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileSortByNestedExpressionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileSortByNestedExpressionTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ObjectHelperTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ObjectHelperTest.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ObjectHelperTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ObjectHelperTest.java Mon Dec 8 00:47:51 2008
@@ -22,7 +22,7 @@
import org.apache.camel.util.ObjectHelper;
/**
- * @version $Revision: 640438 $
+ * @version $Revision$
*/
public class ObjectHelperTest extends TestCase {
public void testArrayAsIterator() throws Exception {
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/ObjectHelperTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelExceptionCausePropagatedTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelHandledExampleTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelHandledExampleTest.java?rev=724289&r1=724288&r2=724289&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelHandledExampleTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelHandledExampleTest.java Mon Dec 8 00:47:51 2008
@@ -62,6 +62,7 @@
return new RouteBuilder() {
public void configure() throws Exception {
// START SNIPPET: e1
+ /*
// we do special error handling for when OrderFailedException is thrown
onException(OrderFailedException.class)
// we mark the exchange as handled so the caller doesn't receive the
@@ -71,7 +72,7 @@
// response using java code
.bean(OrderService.class, "orderFailed")
// and since this is an unit test we use mocks for testing
- .to("mock:error");
+ .to("mock:error");*/
// this is just the generic error handler where we set the destination
// and the number of redeliveries we want to try
@@ -79,6 +80,8 @@
// this is our route where we handle orders
from("direct:start")
+ .onException(OrderFailedException.class).handled(true)
+ .bean(OrderService.class, "orderFailed").to("mock:error").end()
// this bean is our order service
.bean(OrderService.class, "handleOrder")
// this is the destination if the order is OK
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MyNormalizer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/NormalizerTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterWithCustomThreadPoolExecutorTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorWithOutBodyTraceTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/MyReverseAggregationCollection.java
------------------------------------------------------------------------------
svn:keywords = Rev Date