Author: jstrachan
Date: Thu Jun 26 08:55:03 2008
New Revision: 671929

URL: http://svn.apache.org/viewvc?rev=671929&view=rev
Log:
final fix for CAMEL-619 - refactored from 'tracing' property to 'trace' and 
added a spring XML test case

Added:
    
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceTest.java
   (with props)
    
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceTest-context.xml
   (with props)
Modified:
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=671929&r1=671928&r2=671929&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
 Thu Jun 26 08:55:03 2008
@@ -88,7 +88,7 @@
     private LifecycleStrategy lifecycleStrategy;
     private List<RouteType> routeDefinitions = new ArrayList<RouteType>();
     private List<InterceptStrategy> interceptStrategies = new 
ArrayList<InterceptStrategy>();
-    private Boolean tracing;
+    private Boolean trace;
 
     public DefaultCamelContext() {
         name = NAME_PREFIX + ++nameSuffix;
@@ -444,10 +444,10 @@
     }
 
     /**
-     * Returns true if tracing has been enabled or disabled via the [EMAIL 
PROTECTED] #setTracing(Boolean)} method
+     * Returns true if tracing has been enabled or disabled via the [EMAIL 
PROTECTED] #setTrace(Boolean)} method
      * or it has not been specified then default to the <b>camel.trace</b> 
system property
      */
-    public boolean isTracing() {
+    public boolean getTrace() {
         final Boolean value = getTracing();
         if (value != null) {
             return value;
@@ -457,18 +457,18 @@
     }
 
     public Boolean getTracing() {
-        return tracing;
+        return trace;
     }
 
-    public void setTracing(Boolean tracing) {
-        this.tracing = tracing;
+    public void setTrace(Boolean trace) {
+        this.trace = trace;
     }
 
     // Implementation methods
     // -----------------------------------------------------------------------
 
     protected void doStart() throws Exception {
-        if (isTracing()) {
+        if (getTrace()) {
             // lets check if we already have already been configured and if 
not add the default
             boolean found = false;
             final List<InterceptStrategy> list = getInterceptStrategies();

Modified: 
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=671929&r1=671928&r2=671929&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
 (original)
+++ 
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
 Thu Jun 26 08:55:03 2008
@@ -73,7 +73,7 @@
     @XmlAttribute(required = false)
     private Boolean autowireRouteBuilders = Boolean.TRUE;
     @XmlAttribute(required = false)
-    private Boolean tracing;
+    private Boolean trace;
     @XmlElement(name = "package", required = false)
     private String[] packages = {};
     @XmlElement(name = "jmxAgent", type = CamelJMXAgentType.class, required = 
false)
@@ -326,6 +326,14 @@
         camelJMXAgent = agent;
     }
 
+    public Boolean getTrace() {
+        return trace;
+    }
+
+    public void setTrace(Boolean trace) {
+        this.trace = trace;
+    }
+
     public CamelJMXAgentType getCamelJMXAgent() {
         return camelJMXAgent;
     }
@@ -355,8 +363,8 @@
     protected SpringCamelContext createContext() {
         SpringCamelContext ctx = new 
SpringCamelContext(getApplicationContext());
         ctx.setName(getId());
-        if (tracing != null) {
-            ctx.setTracing(tracing);
+        if (trace != null) {
+            ctx.setTrace(trace);
         }
         return ctx;
     }

Added: 
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceTest.java?rev=671929&view=auto
==============================================================================
--- 
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceTest.java
 (added)
+++ 
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceTest.java
 Thu Jun 26 08:55:03 2008
@@ -0,0 +1,38 @@
+/**
+ *
+ * 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.spring.processor;
+
+import org.apache.camel.ProducerTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import 
org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
+
+/**
+ * @version $Revision: 1.1 $
+ */
[EMAIL PROTECTED]
+public class SpringTraceTest extends AbstractJUnit38SpringContextTests {
+
+    @Autowired
+    protected ProducerTemplate camelTemplate;
+
+    public void testTracing() throws Exception {
+        camelTemplate.sendBody("Hello");
+        camelTemplate.sendBody(1234);
+    }
+}
\ No newline at end of file

Propchange: 
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTraceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceTest-context.xml
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceTest-context.xml?rev=671929&view=auto
==============================================================================
--- 
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceTest-context.xml
 (added)
+++ 
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceTest-context.xml
 Thu Jun 26 08:55:03 2008
@@ -0,0 +1,38 @@
+<?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-2.5.xsd
+       http://activemq.apache.org/camel/schema/spring 
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: example -->
+  <camelContext trace="true" 
xmlns="http://activemq.apache.org/camel/schema/spring";>
+    <template id="camelTemplate" defaultEndpoint="direct:start"/>
+
+    <route>
+      <from uri="direct:start"/>
+      <setHeader headerName="someHeader">
+        <simple>${in.body} World!</simple>
+      </setHeader>
+      <to uri="mock:result"/>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: example -->
+</beans>

Propchange: 
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceTest-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to