camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r771312 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/model/InterceptFromDefinition.java test/java/org/apache/camel/issues/TimerAndErrorHandlerIssueTest.java
Date Mon, 04 May 2009 14:14:30 GMT
Author: davsclaus
Date: Mon May  4 14:14:30 2009
New Revision: 771312

URL: http://svn.apache.org/viewvc?rev=771312&view=rev
Log:
Added unit test based on user forum problem.

Added:
    camel/trunk/camel-core/src/test/java/org/apache/camel/issues/TimerAndErrorHandlerIssueTest.java
  (with props)
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java?rev=771312&r1=771311&r2=771312&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
Mon May  4 14:14:30 2009
@@ -65,9 +65,8 @@
     @Override
     @SuppressWarnings("unchecked")
     public Processor createProcessor(RouteContext routeContext) throws Exception {
-        // insert a set property defintion so we can set the intercepted endpoint
+        // insert a set header defintion so we can set the intercepted endpoint uri as a
header
         // this allows us to use the same header for both the interceptFrom and interceptSendToEndpoint
-        // so end users is not confused if they should use another header for interceptFrom
than interceptSendToEndpoint
         SetHeaderDefinition headerDefinition = new SetHeaderDefinition(Exchange.INTERCEPTED_ENDPOINT,
new ExpressionAdapter() {
             public Object evaluate(Exchange exchange, Class type) {
                 return exchange.getFromEndpoint().getEndpointUri();

Added: camel/trunk/camel-core/src/test/java/org/apache/camel/issues/TimerAndErrorHandlerIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/TimerAndErrorHandlerIssueTest.java?rev=771312&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/issues/TimerAndErrorHandlerIssueTest.java
(added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/issues/TimerAndErrorHandlerIssueTest.java
Mon May  4 14:14:30 2009
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.issues;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version $Revision$
+ */
+public class TimerAndErrorHandlerIssueTest extends ContextTestSupport {
+
+    public void testTimerAndErrorHandler() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMinimumMessageCount(2);
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                onException(RuntimeCamelException.class).handled(true);
+
+                errorHandler(loggingErrorHandler(getClass().getName()));
+
+                String executionTriggerUri = "timer:executionTimer"
+                        + "?fixedRate=true"
+                        + "&daemon=true"
+                        + "&period=500";
+
+                from(executionTriggerUri).to("mock:result");
+            }
+        };
+    }
+}

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

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



Mime
View raw message