camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1065931 [2/6] - in /camel/trunk/components: camel-amqp/ camel-atom/ camel-atom/src/main/java/org/apache/camel/component/atom/ camel-atom/src/test/java/org/apache/camel/component/atom/ camel-aws/src/main/java/org/apache/camel/component/aws/...
Date Tue, 01 Feb 2011 07:41:10 GMT
Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/PersonProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/PersonProcessor.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/PersonProcessor.java (original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/wsdl_first/PersonProcessor.java Tue Feb  1 07:41:02 2011
@@ -20,15 +20,15 @@ import javax.xml.ws.Holder;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.service.model.BindingOperationInfo;
 
 // START SNIPPET: personProcessor
 public class PersonProcessor implements Processor {
 
-    private static final transient Log LOG = LogFactory.getLog(PersonProcessor.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(PersonProcessor.class);
 
     @SuppressWarnings("unchecked")
     public void process(Exchange exchange) throws Exception {

Modified: camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java (original)
+++ camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java Tue Feb  1 07:41:02 2011
@@ -28,8 +28,8 @@ import org.apache.camel.CamelContextAwar
 import org.apache.camel.TypeConverter;
 import org.apache.camel.spi.ClassResolver;
 import org.apache.camel.spi.TypeConverterRegistry;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.dozer.DozerBeanMapper;
 import org.dozer.Mapper;
 import org.dozer.classmap.ClassMap;
@@ -53,7 +53,7 @@ import org.dozer.util.DozerClassLoader;
  */
 public class DozerTypeConverterLoader implements CamelContextAware {
 
-    private final Log log = LogFactory.getLog(getClass());
+    private final Logger log = LoggerFactory.getLogger(getClass());
     private CamelContext camelContext;
     private DozerBeanMapper mapper;
 

Modified: camel/trunk/components/camel-eclipse/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-eclipse/pom.xml?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-eclipse/pom.xml (original)
+++ camel/trunk/components/camel-eclipse/pom.xml Tue Feb  1 07:41:02 2011
@@ -59,8 +59,8 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -75,17 +75,4 @@
     </dependency>
   </dependencies>
 
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <excludes>
-            <exclude>**/XXXTest.*</exclude>
-          </excludes>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
 </project>

Modified: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java (original)
+++ camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java Tue Feb  1 07:41:02 2011
@@ -22,8 +22,8 @@ import java.util.concurrent.Executor;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventConstants;
@@ -31,7 +31,7 @@ import org.osgi.service.event.EventHandl
 
 public class EventAdminConsumer extends DefaultConsumer implements EventHandler {
 
-    private static final transient Log LOG = LogFactory.getLog(EventAdminConsumer.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(EventAdminConsumer.class);
     private final EventAdminEndpoint endpoint;
     private ServiceRegistration registration;
     private Executor executor;

Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecProducer.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecProducer.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecProducer.java Tue Feb  1 07:41:02 2011
@@ -1,61 +1,61 @@
-/**
- * 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.exec;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.impl.DefaultProducer;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Exec producer.
- * 
- * @see {link Producer}
- */
-public class ExecProducer extends DefaultProducer {
-
-    private final Log log;
-
-    private final ExecEndpoint endpoint;
-
-    public ExecProducer(ExecEndpoint endpoint) {
-        super(endpoint);
-        this.endpoint = endpoint;
-        this.log = LogFactory.getLog(ExecProducer.class);
-    }
-
-    public void process(Exchange exchange) throws Exception {
-        ExecCommand execCommand = getBinding().readInput(exchange, endpoint);
-
-        if (log.isInfoEnabled()) {
-            log.info("Executing " + execCommand);
-        }
-        ExecResult result = endpoint.getCommandExecutor().execute(execCommand);
-        ObjectHelper.notNull(result, "The command executor must return a not-null result");
-        if (log.isInfoEnabled()) {
-            log.info("The command " + execCommand + " had exit value " + result.getExitValue());
-        } else if (log.isErrorEnabled() && result.getExitValue() != 0) {
-            log.error("The command " + execCommand + " returned exit value " + result.getExitValue());
-        }
-        getBinding().writeOutput(exchange, result);
-    }
-
-    private ExecBinding getBinding() {
-        return endpoint.getBinding();
-    }
-}
+/**
+ * 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.exec;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Exec producer.
+ * 
+ * @see {link Producer}
+ */
+public class ExecProducer extends DefaultProducer {
+
+    private final Logger log;
+
+    private final ExecEndpoint endpoint;
+
+    public ExecProducer(ExecEndpoint endpoint) {
+        super(endpoint);
+        this.endpoint = endpoint;
+        this.log = LoggerFactory.getLogger(ExecProducer.class);
+    }
+
+    public void process(Exchange exchange) throws Exception {
+        ExecCommand execCommand = getBinding().readInput(exchange, endpoint);
+
+        if (log.isInfoEnabled()) {
+            log.info("Executing " + execCommand);
+        }
+        ExecResult result = endpoint.getCommandExecutor().execute(execCommand);
+        ObjectHelper.notNull(result, "The command executor must return a not-null result");
+        if (log.isInfoEnabled()) {
+            log.info("The command " + execCommand + " had exit value " + result.getExitValue());
+        } else if (log.isErrorEnabled() && result.getExitValue() != 0) {
+            log.error("The command " + execCommand + " returned exit value " + result.getExitValue());
+        }
+        getBinding().writeOutput(exchange, result);
+    }
+
+    private ExecBinding getBinding() {
+        return endpoint.getBinding();
+    }
+}

Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java Tue Feb  1 07:41:02 2011
@@ -1,149 +1,149 @@
-/**
- * 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.exec;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.w3c.dom.Document;
-
-import org.apache.camel.Converter;
-import org.apache.camel.Exchange;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Default converters for {@link ExecResult}. For details how to extend the
- * converters check out <a
- * href="http://camel.apache.org/type-converter.html">the Camel docs for type
- * converters.</a>
- */
-@Converter
-public final class ExecResultConverter {
-
-    private static final Log LOG = LogFactory.getLog(ExecResultConverter.class);
-
-    private ExecResultConverter() {
-    }
-
-    @Converter
-    public static InputStream convertToInputStream(ExecResult result) throws FileNotFoundException {
-        return toInputStream(result);
-    }
-
-    @Converter
-    public static byte[] convertToByteArray(ExecResult result, Exchange exchange) throws FileNotFoundException, IOException {
-        InputStream stream = toInputStream(result);
-        try {
-            return IOUtils.toByteArray(stream);
-        } finally {
-            IOUtils.closeQuietly(stream);
-        }
-    }
-
-    @Converter
-    public static String convertToString(ExecResult result, Exchange exchange) throws FileNotFoundException {
-        return convertTo(String.class, exchange, result);
-    }
-
-    @Converter
-    public static Document convertToDocument(ExecResult result, Exchange exchange) throws FileNotFoundException {
-        return convertTo(Document.class, exchange, result);
-    }
-
-    /**
-     * Converts <code>ExecResult</code> to the type <code>T</code>.
-     * 
-     * @param <T> The type to convert to
-     * @param type Class instance of the type to which to convert
-     * @param exchange a Camel exchange. If exchange is <code>null</code>, no
-     *            conversion will be made
-     * @param result the exec result
-     * @return the converted {@link ExecResult}
-     * @throws FileNotFoundException if there is a file in the execResult, and
-     *             the file can not be found
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T convertTo(Class<T> type, Exchange exchange, ExecResult result) throws FileNotFoundException {
-        InputStream is = toInputStream(result);
-        if (is != null) {
-            return exchange.getContext().getTypeConverter().convertTo(type, exchange, is);
-        } else {
-            // use Void to indicate we cannot convert it
-            // (prevents Camel from using a fallback converter which may convert a String from the instance name)  
-            return (T) Void.TYPE;
-        }
-    }
-
-    /**
-     * Returns <code>InputStream</code> object with the <i>output</i> of the
-     * executable. If there is {@link ExecCommand#getOutFile()}, its content is
-     * preferred to {@link ExecResult#getStdout()}. If no out file is set, and
-     * the stdout of the exec result is <code>null</code> returns the stderr of
-     * the exec result. <br>
-     * If the output stream is of type <code>ByteArrayInputStream</code>, its
-     * <code>reset()</code> method is called.
-     * 
-     * @param execResult ExecResult object to convert to InputStream.
-     * @return InputStream object with the <i>output</i> of the executable.
-     *         Returns <code>null</code> if both {@link ExecResult#getStdout()}
-     *         and {@link ExecResult#getStderr()} are <code>null</code> , or if
-     *         the <code>execResult</code> is <code>null</code>.
-     * @throws FileNotFoundException if the {@link ExecCommand#getOutFile()} can
-     *             not be opened. In this case the out file must have had a not
-     *             <code>null</code> value
-     */
-    public static InputStream toInputStream(ExecResult execResult) throws FileNotFoundException {
-        if (execResult == null) {
-            LOG.warn("Received a null ExecResult instance to convert!");
-            return null;
-        }
-        // prefer the out file for output
-        InputStream result;
-        if (execResult.getCommand().getOutFile() != null) {
-            result = new FileInputStream(execResult.getCommand().getOutFile());
-        } else {
-            // if the stdout is null, return the stderr.
-            if (execResult.getStdout() == null && execResult.getCommand().isUseStderrOnEmptyStdout()) {
-                LOG.warn("ExecResult has no stdout, will fallback to use stderr.");
-                result = execResult.getStderr();
-            } else {
-                result = execResult.getStdout() != null ? execResult.getStdout() : null;
-            }
-        }
-        // reset the stream if it was already read.
-        resetIfByteArrayInputStream(result);
-        return result;
-    }
-
-    /**
-     * Resets the stream, only if it's a ByteArrayInputStream.
-     */
-    private static void resetIfByteArrayInputStream(InputStream stream) {
-        if (stream != null && stream instanceof ByteArrayInputStream) {
-            try {
-                stream.reset();
-            } catch (IOException ioe) {
-                LOG.error("Unable to reset the stream ", ioe);
-            }
-        }
-    }
-}
+/**
+ * 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.exec;
+
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.w3c.dom.Document;
+
+import org.apache.camel.Converter;
+import org.apache.camel.Exchange;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Default converters for {@link ExecResult}. For details how to extend the
+ * converters check out <a
+ * href="http://camel.apache.org/type-converter.html">the Camel docs for type
+ * converters.</a>
+ */
+@Converter
+public final class ExecResultConverter {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ExecResultConverter.class);
+
+    private ExecResultConverter() {
+    }
+
+    @Converter
+    public static InputStream convertToInputStream(ExecResult result) throws FileNotFoundException {
+        return toInputStream(result);
+    }
+
+    @Converter
+    public static byte[] convertToByteArray(ExecResult result, Exchange exchange) throws FileNotFoundException, IOException {
+        InputStream stream = toInputStream(result);
+        try {
+            return IOUtils.toByteArray(stream);
+        } finally {
+            IOUtils.closeQuietly(stream);
+        }
+    }
+
+    @Converter
+    public static String convertToString(ExecResult result, Exchange exchange) throws FileNotFoundException {
+        return convertTo(String.class, exchange, result);
+    }
+
+    @Converter
+    public static Document convertToDocument(ExecResult result, Exchange exchange) throws FileNotFoundException {
+        return convertTo(Document.class, exchange, result);
+    }
+
+    /**
+     * Converts <code>ExecResult</code> to the type <code>T</code>.
+     * 
+     * @param <T> The type to convert to
+     * @param type Class instance of the type to which to convert
+     * @param exchange a Camel exchange. If exchange is <code>null</code>, no
+     *            conversion will be made
+     * @param result the exec result
+     * @return the converted {@link ExecResult}
+     * @throws FileNotFoundException if there is a file in the execResult, and
+     *             the file can not be found
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T convertTo(Class<T> type, Exchange exchange, ExecResult result) throws FileNotFoundException {
+        InputStream is = toInputStream(result);
+        if (is != null) {
+            return exchange.getContext().getTypeConverter().convertTo(type, exchange, is);
+        } else {
+            // use Void to indicate we cannot convert it
+            // (prevents Camel from using a fallback converter which may convert a String from the instance name)  
+            return (T) Void.TYPE;
+        }
+    }
+
+    /**
+     * Returns <code>InputStream</code> object with the <i>output</i> of the
+     * executable. If there is {@link ExecCommand#getOutFile()}, its content is
+     * preferred to {@link ExecResult#getStdout()}. If no out file is set, and
+     * the stdout of the exec result is <code>null</code> returns the stderr of
+     * the exec result. <br>
+     * If the output stream is of type <code>ByteArrayInputStream</code>, its
+     * <code>reset()</code> method is called.
+     * 
+     * @param execResult ExecResult object to convert to InputStream.
+     * @return InputStream object with the <i>output</i> of the executable.
+     *         Returns <code>null</code> if both {@link ExecResult#getStdout()}
+     *         and {@link ExecResult#getStderr()} are <code>null</code> , or if
+     *         the <code>execResult</code> is <code>null</code>.
+     * @throws FileNotFoundException if the {@link ExecCommand#getOutFile()} can
+     *             not be opened. In this case the out file must have had a not
+     *             <code>null</code> value
+     */
+    public static InputStream toInputStream(ExecResult execResult) throws FileNotFoundException {
+        if (execResult == null) {
+            LOG.warn("Received a null ExecResult instance to convert!");
+            return null;
+        }
+        // prefer the out file for output
+        InputStream result;
+        if (execResult.getCommand().getOutFile() != null) {
+            result = new FileInputStream(execResult.getCommand().getOutFile());
+        } else {
+            // if the stdout is null, return the stderr.
+            if (execResult.getStdout() == null && execResult.getCommand().isUseStderrOnEmptyStdout()) {
+                LOG.warn("ExecResult has no stdout, will fallback to use stderr.");
+                result = execResult.getStderr();
+            } else {
+                result = execResult.getStdout() != null ? execResult.getStdout() : null;
+            }
+        }
+        // reset the stream if it was already read.
+        resetIfByteArrayInputStream(result);
+        return result;
+    }
+
+    /**
+     * Resets the stream, only if it's a ByteArrayInputStream.
+     */
+    private static void resetIfByteArrayInputStream(InputStream stream) {
+        if (stream != null && stream instanceof ByteArrayInputStream) {
+            try {
+                stream.reset();
+            } catch (IOException ioe) {
+                LOG.error("Unable to reset the stream ", ioe);
+            }
+        }
+    }
+}

Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecBinding.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecBinding.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecBinding.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecBinding.java Tue Feb  1 07:41:02 2011
@@ -1,113 +1,113 @@
-/**
- * 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.exec.impl;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.List;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.component.exec.ExecBinding;
-import org.apache.camel.component.exec.ExecCommand;
-import org.apache.camel.component.exec.ExecEndpoint;
-import org.apache.camel.component.exec.ExecResult;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import static org.apache.camel.component.exec.impl.ExecParseUtils.splitToWhiteSpaceSeparatedTokens;
-
-/**
- * Default implementation of {@link ExecBinding}.
- * 
- * @see DefaultExecBinding#writeOutputInMessage(Message, ExecResult)
- */
-public class DefaultExecBinding implements ExecBinding {
-
-    private static final Log LOG = LogFactory.getLog(DefaultExecBinding.class);
-
-    @SuppressWarnings("unchecked")
-    public ExecCommand readInput(Exchange exchange, ExecEndpoint endpoint) {
-        ObjectHelper.notNull(exchange, "exchange");
-        ObjectHelper.notNull(endpoint, "endpoint");
-
-        // do not convert args as we do that manually later
-        Object args = exchange.getIn().removeHeader(EXEC_COMMAND_ARGS);
-        String cmd = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_EXECUTABLE, endpoint.getExecutable(), String.class);
-        String dir = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_WORKING_DIR, endpoint.getWorkingDir(), String.class);
-        long timeout = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_TIMEOUT, endpoint.getTimeout(), Long.class);
-        String outFilePath = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_OUT_FILE, endpoint.getOutFile(), String.class);
-        boolean useStderrOnEmptyStdout = getAndRemoveHeader(exchange.getIn(), EXEC_USE_STDERR_ON_EMPTY_STDOUT, endpoint.isUseStderrOnEmptyStdout(), Boolean.class);
-        InputStream input = exchange.getIn().getBody(InputStream.class);
-
-        // try to convert args to list at fist
-        List<String> argsList = exchange.getContext().getTypeConverter().convertTo(List.class, exchange, args);
-        if (argsList == null) {
-            // no we could not do that, then parse it as a string to a list
-            String s = endpoint.getArgs();
-            if (args != null) {
-                // use args from header instead from endpoint
-                s = exchange.getContext().getTypeConverter().convertTo(String.class, exchange, args);
-            }
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Parsing argument String to a List: " + s);
-            }
-            argsList = splitToWhiteSpaceSeparatedTokens(s);
-        }
-
-        File outFile = outFilePath == null ? null : new File(outFilePath);
-        return new ExecCommand(cmd, argsList, dir, timeout, input, outFile, useStderrOnEmptyStdout);
-    }
-
-    public void writeOutput(Exchange exchange, ExecResult result) {
-        ObjectHelper.notNull(exchange, "exchange");
-        ObjectHelper.notNull(result, "result");
-
-        if (exchange.getPattern().isOutCapable()) {
-            writeOutputInMessage(exchange.getOut(), result);
-            exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
-        } else {
-            writeOutputInMessage(exchange.getIn(), result);
-        }
-    }
-
-    /**
-     * Write the {@link ExecResult} in the message body. Write the stderr and
-     * the exit value for convenience in the message headers. <br>
-     * The stdout and/or resultFile should be accessible using a converter or
-     * using the result object directly.
-     * 
-     * @param message a Camel message
-     * @param result an {@link ExecResult} instance
-     */
-    protected void writeOutputInMessage(Message message, ExecResult result) {
-        message.setHeader(EXEC_STDERR, result.getStderr());
-        message.setHeader(EXEC_EXIT_VALUE, result.getExitValue());
-        message.setBody(result);
-    }
-
-    /**
-     * Gets and removes the <code> <code>headerName</code> header form the input
-     * <code>message</code> (the header will not be propagated)
-     */
-    protected <T> T getAndRemoveHeader(Message message, String headerName, T defaultValue, Class<T> headerType) {
-        T h = message.getHeader(headerName, defaultValue, headerType);
-        message.removeHeader(headerName);
-        return h;
-    }
-}
+/**
+ * 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.exec.impl;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.component.exec.ExecBinding;
+import org.apache.camel.component.exec.ExecCommand;
+import org.apache.camel.component.exec.ExecEndpoint;
+import org.apache.camel.component.exec.ExecResult;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.camel.component.exec.impl.ExecParseUtils.splitToWhiteSpaceSeparatedTokens;
+
+/**
+ * Default implementation of {@link ExecBinding}.
+ * 
+ * @see DefaultExecBinding#writeOutputInMessage(Message, ExecResult)
+ */
+public class DefaultExecBinding implements ExecBinding {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultExecBinding.class);
+
+    @SuppressWarnings("unchecked")
+    public ExecCommand readInput(Exchange exchange, ExecEndpoint endpoint) {
+        ObjectHelper.notNull(exchange, "exchange");
+        ObjectHelper.notNull(endpoint, "endpoint");
+
+        // do not convert args as we do that manually later
+        Object args = exchange.getIn().removeHeader(EXEC_COMMAND_ARGS);
+        String cmd = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_EXECUTABLE, endpoint.getExecutable(), String.class);
+        String dir = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_WORKING_DIR, endpoint.getWorkingDir(), String.class);
+        long timeout = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_TIMEOUT, endpoint.getTimeout(), Long.class);
+        String outFilePath = getAndRemoveHeader(exchange.getIn(), EXEC_COMMAND_OUT_FILE, endpoint.getOutFile(), String.class);
+        boolean useStderrOnEmptyStdout = getAndRemoveHeader(exchange.getIn(), EXEC_USE_STDERR_ON_EMPTY_STDOUT, endpoint.isUseStderrOnEmptyStdout(), Boolean.class);
+        InputStream input = exchange.getIn().getBody(InputStream.class);
+
+        // try to convert args to list at fist
+        List<String> argsList = exchange.getContext().getTypeConverter().convertTo(List.class, exchange, args);
+        if (argsList == null) {
+            // no we could not do that, then parse it as a string to a list
+            String s = endpoint.getArgs();
+            if (args != null) {
+                // use args from header instead from endpoint
+                s = exchange.getContext().getTypeConverter().convertTo(String.class, exchange, args);
+            }
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Parsing argument String to a List: " + s);
+            }
+            argsList = splitToWhiteSpaceSeparatedTokens(s);
+        }
+
+        File outFile = outFilePath == null ? null : new File(outFilePath);
+        return new ExecCommand(cmd, argsList, dir, timeout, input, outFile, useStderrOnEmptyStdout);
+    }
+
+    public void writeOutput(Exchange exchange, ExecResult result) {
+        ObjectHelper.notNull(exchange, "exchange");
+        ObjectHelper.notNull(result, "result");
+
+        if (exchange.getPattern().isOutCapable()) {
+            writeOutputInMessage(exchange.getOut(), result);
+            exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
+        } else {
+            writeOutputInMessage(exchange.getIn(), result);
+        }
+    }
+
+    /**
+     * Write the {@link ExecResult} in the message body. Write the stderr and
+     * the exit value for convenience in the message headers. <br>
+     * The stdout and/or resultFile should be accessible using a converter or
+     * using the result object directly.
+     * 
+     * @param message a Camel message
+     * @param result an {@link ExecResult} instance
+     */
+    protected void writeOutputInMessage(Message message, ExecResult result) {
+        message.setHeader(EXEC_STDERR, result.getStderr());
+        message.setHeader(EXEC_EXIT_VALUE, result.getExitValue());
+        message.setBody(result);
+    }
+
+    /**
+     * Gets and removes the <code> <code>headerName</code> header form the input
+     * <code>message</code> (the header will not be propagated)
+     */
+    protected <T> T getAndRemoveHeader(Message message, String headerName, T defaultValue, Class<T> headerType) {
+        T h = message.getHeader(headerName, defaultValue, headerType);
+        message.removeHeader(headerName);
+        return h;
+    }
+}

Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/impl/DefaultExecCommandExecutor.java Tue Feb  1 07:41:02 2011
@@ -1,119 +1,119 @@
-/**
- * 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.exec.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
-import org.apache.camel.component.exec.ExecCommand;
-import org.apache.camel.component.exec.ExecCommandExecutor;
-import org.apache.camel.component.exec.ExecEndpoint;
-import org.apache.camel.component.exec.ExecException;
-import org.apache.camel.component.exec.ExecResult;
-import org.apache.commons.exec.CommandLine;
-import org.apache.commons.exec.DefaultExecutor;
-import org.apache.commons.exec.ExecuteException;
-import org.apache.commons.exec.ExecuteWatchdog;
-import org.apache.commons.exec.PumpStreamHandler;
-import org.apache.commons.exec.ShutdownHookProcessDestroyer;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import static org.apache.camel.util.ObjectHelper.notNull;
-
-/**
- * Executes the command utilizing the <a
- * href="http://commons.apache.org/exec/">Apache Commons exec library</a>. Adds
- * a shutdown hook for every executed process.
- */
-public class DefaultExecCommandExecutor implements ExecCommandExecutor {
-
-    private static final Log LOG = LogFactory.getLog(DefaultExecCommandExecutor.class);
-
-    public ExecResult execute(ExecCommand command) {
-        notNull(command, "command");
-
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        ByteArrayOutputStream err = new ByteArrayOutputStream();
-
-        DefaultExecutor executor = prepareDefaultExecutor(command);
-        // handle error and output of the process and write them to the given
-        // out stream
-        PumpStreamHandler handler = new PumpStreamHandler(out, err, command.getInput());
-        executor.setStreamHandler(handler);
-
-        CommandLine cl = toCommandLine(command);
-
-        try {
-            int exitValue = executor.execute(cl);
-            // if the size is zero, we have no output, so construct the result
-            // with null (required by ExecResult)
-            InputStream stdout = out.size() == 0 ? null : new ByteArrayInputStream(out.toByteArray());
-            InputStream stderr = err.size() == 0 ? null : new ByteArrayInputStream(err.toByteArray());
-            ExecResult result = new ExecResult(command, stdout, stderr, exitValue);
-            return result;
-
-        } catch (ExecuteException ee) {
-            LOG.error("ExecException while executing command: " + command.toString() + " - " + ee.getMessage());
-            throw new ExecException("Failed to execute command " + command, ee);
-        } catch (IOException ioe) {
-            // invalid working dir
-            LOG.error("IOException while executing command: " + command.toString() + " - " + ioe.getMessage());
-            throw new ExecException("Unable to execute command " + command, ioe);
-        } finally {
-            // the inputStream must be closed after the execution
-            IOUtils.closeQuietly(command.getInput());
-        }
-    }
-
-    protected DefaultExecutor prepareDefaultExecutor(ExecCommand execCommand) {
-        DefaultExecutor executor = new DefaultExecutor();
-        executor.setExitValues(null);
-
-        if (execCommand.getWorkingDir() != null) {
-            executor.setWorkingDirectory(new File(execCommand.getWorkingDir()).getAbsoluteFile());
-        }
-        if (execCommand.getTimeout() != ExecEndpoint.NO_TIMEOUT) {
-            executor.setWatchdog(new ExecuteWatchdog(execCommand.getTimeout()));
-        }
-        executor.setProcessDestroyer(new ShutdownHookProcessDestroyer());
-        return executor;
-    }
-
-    /**
-     * Transforms an {@link ExecCommand} to a {@link CommandLine}. No quoting fo
-     * the arguments is used.
-     * 
-     * @param execCommand a not-null <code>ExecCommand</code> instance.
-     * @return a {@link CommandLine} object.
-     */
-    protected CommandLine toCommandLine(ExecCommand execCommand) {
-        notNull(execCommand, "execCommand");
-        CommandLine cl = new CommandLine(execCommand.getExecutable());
-        List<String> args = execCommand.getArgs();
-        for (String arg : args) {
-            // do not handle quoting here, it is already quoted
-            cl.addArgument(arg, false);
-        }
-        return cl;
-    }
-}
+/**
+ * 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.exec.impl;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.camel.component.exec.ExecCommand;
+import org.apache.camel.component.exec.ExecCommandExecutor;
+import org.apache.camel.component.exec.ExecEndpoint;
+import org.apache.camel.component.exec.ExecException;
+import org.apache.camel.component.exec.ExecResult;
+import org.apache.commons.exec.CommandLine;
+import org.apache.commons.exec.DefaultExecutor;
+import org.apache.commons.exec.ExecuteException;
+import org.apache.commons.exec.ExecuteWatchdog;
+import org.apache.commons.exec.PumpStreamHandler;
+import org.apache.commons.exec.ShutdownHookProcessDestroyer;
+import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.camel.util.ObjectHelper.notNull;
+
+/**
+ * Executes the command utilizing the <a
+ * href="http://commons.apache.org/exec/">Apache Commons exec library</a>. Adds
+ * a shutdown hook for every executed process.
+ */
+public class DefaultExecCommandExecutor implements ExecCommandExecutor {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultExecCommandExecutor.class);
+
+    public ExecResult execute(ExecCommand command) {
+        notNull(command, "command");
+
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        ByteArrayOutputStream err = new ByteArrayOutputStream();
+
+        DefaultExecutor executor = prepareDefaultExecutor(command);
+        // handle error and output of the process and write them to the given
+        // out stream
+        PumpStreamHandler handler = new PumpStreamHandler(out, err, command.getInput());
+        executor.setStreamHandler(handler);
+
+        CommandLine cl = toCommandLine(command);
+
+        try {
+            int exitValue = executor.execute(cl);
+            // if the size is zero, we have no output, so construct the result
+            // with null (required by ExecResult)
+            InputStream stdout = out.size() == 0 ? null : new ByteArrayInputStream(out.toByteArray());
+            InputStream stderr = err.size() == 0 ? null : new ByteArrayInputStream(err.toByteArray());
+            ExecResult result = new ExecResult(command, stdout, stderr, exitValue);
+            return result;
+
+        } catch (ExecuteException ee) {
+            LOG.error("ExecException while executing command: " + command.toString() + " - " + ee.getMessage());
+            throw new ExecException("Failed to execute command " + command, ee);
+        } catch (IOException ioe) {
+            // invalid working dir
+            LOG.error("IOException while executing command: " + command.toString() + " - " + ioe.getMessage());
+            throw new ExecException("Unable to execute command " + command, ioe);
+        } finally {
+            // the inputStream must be closed after the execution
+            IOUtils.closeQuietly(command.getInput());
+        }
+    }
+
+    protected DefaultExecutor prepareDefaultExecutor(ExecCommand execCommand) {
+        DefaultExecutor executor = new DefaultExecutor();
+        executor.setExitValues(null);
+
+        if (execCommand.getWorkingDir() != null) {
+            executor.setWorkingDirectory(new File(execCommand.getWorkingDir()).getAbsoluteFile());
+        }
+        if (execCommand.getTimeout() != ExecEndpoint.NO_TIMEOUT) {
+            executor.setWatchdog(new ExecuteWatchdog(execCommand.getTimeout()));
+        }
+        executor.setProcessDestroyer(new ShutdownHookProcessDestroyer());
+        return executor;
+    }
+
+    /**
+     * Transforms an {@link ExecCommand} to a {@link CommandLine}. No quoting fo
+     * the arguments is used.
+     * 
+     * @param execCommand a not-null <code>ExecCommand</code> instance.
+     * @return a {@link CommandLine} object.
+     */
+    protected CommandLine toCommandLine(ExecCommand execCommand) {
+        notNull(execCommand, "execCommand");
+        CommandLine cl = new CommandLine(execCommand.getExecutable());
+        List<String> args = execCommand.getArgs();
+        for (String arg : args) {
+            // do not handle quoting here, it is already quoted
+            cl.addArgument(arg, false);
+        }
+        return cl;
+    }
+}

Modified: camel/trunk/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecTestUtils.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecTestUtils.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecTestUtils.java (original)
+++ camel/trunk/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecTestUtils.java Tue Feb  1 07:41:02 2011
@@ -1,69 +1,69 @@
-/**
- * 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.exec;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-public final class ExecTestUtils {
-
-    private static final Log LOG = LogFactory.getLog(ExecTestUtils.class);
-
-    private ExecTestUtils() {
-    }
-
-    /**
-     * Where on the file system is located the <code>classpathResource</code>?
-     * 
-     * @param classpathResource a resource in the classpath
-     * @return null if the resource does not exist in the classpath. If the file
-     *         is not null the resource is guaranteed to exist on the file
-     *         system
-     */
-    public static File getClasspathResourceFileOrNull(String classpathResource) {
-        if (classpathResource == null) {
-            return null;
-        }
-        try {
-            Resource resource = new ClassPathResource(classpathResource);
-            File resourceFile = resource.getFile();
-            return resourceFile;
-        } catch (IOException ioe) {
-            LOG.warn("The resource  " + classpathResource + " does not exist!", ioe);
-            return null;
-        }
-    }
-
-    /**
-     * @return the java executable in a system independent way.
-     */
-    public static String buildJavaExecutablePath() {
-        String javaHome = System.getenv("JAVA_HOME");
-        if (javaHome == null) {
-            System.out.println("The Exec component tests will fail, because the environment variable JAVA_HOME is not set!");
-            throw new IllegalStateException("The Exec component tests will fail, because the environment variable JAVA_HOME is not set!");
-        }
-        File java = new File(javaHome + File.separator + "bin" + File.separator + "java");
-        return java.getAbsolutePath();
-    }
-
-}
+/**
+ * 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.exec;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+public final class ExecTestUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ExecTestUtils.class);
+
+    private ExecTestUtils() {
+    }
+
+    /**
+     * Where on the file system is located the <code>classpathResource</code>?
+     * 
+     * @param classpathResource a resource in the classpath
+     * @return null if the resource does not exist in the classpath. If the file
+     *         is not null the resource is guaranteed to exist on the file
+     *         system
+     */
+    public static File getClasspathResourceFileOrNull(String classpathResource) {
+        if (classpathResource == null) {
+            return null;
+        }
+        try {
+            Resource resource = new ClassPathResource(classpathResource);
+            File resourceFile = resource.getFile();
+            return resourceFile;
+        } catch (IOException ioe) {
+            LOG.warn("The resource  " + classpathResource + " does not exist!", ioe);
+            return null;
+        }
+    }
+
+    /**
+     * @return the java executable in a system independent way.
+     */
+    public static String buildJavaExecutablePath() {
+        String javaHome = System.getenv("JAVA_HOME");
+        if (javaHome == null) {
+            System.out.println("The Exec component tests will fail, because the environment variable JAVA_HOME is not set!");
+            throw new IllegalStateException("The Exec component tests will fail, because the environment variable JAVA_HOME is not set!");
+        }
+        File java = new File(javaHome + File.separator + "bin" + File.separator + "java");
+        return java.getAbsolutePath();
+    }
+
+}

Modified: camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java (original)
+++ camel/trunk/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackDataFormat.java Tue Feb  1 07:41:02 2011
@@ -36,8 +36,8 @@ import org.apache.camel.Exchange;
 import org.apache.camel.converter.IOConverter;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.util.ObjectHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.jdom.JDOMException;
 import org.springframework.core.io.Resource;
 
@@ -54,7 +54,7 @@ import org.springframework.core.io.Resou
  * @version $Revision$
  */
 public class FlatpackDataFormat implements DataFormat {
-    private static final transient Log LOG = LogFactory.getLog(FlatpackDataFormat.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(FlatpackDataFormat.class);
     private ParserFactory parserFactory = DefaultParserFactory.getInstance();
     private char delimiter = ',';
     private char textQualifier = '"';
@@ -197,4 +197,4 @@ public class FlatpackDataFormat implemen
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/CharsetTest.java Tue Feb  1 07:41:02 2011
@@ -25,8 +25,8 @@ 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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -39,7 +39,7 @@ import static org.junit.Assert.assertNot
  */
 @ContextConfiguration
 public class CharsetTest extends AbstractJUnit4SpringContextTests {
-    private static final transient Log LOG = LogFactory.getLog(FixedLengthTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;
@@ -62,4 +62,4 @@ public class CharsetTest extends Abstrac
             counter++;
         }
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedTest.java Tue Feb  1 07:41:02 2011
@@ -25,8 +25,8 @@ 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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -39,7 +39,7 @@ import static org.junit.Assert.assertNot
  */
 @ContextConfiguration
 public class DelimitedTest extends AbstractJUnit4SpringContextTests {
-    private static final transient Log LOG = LogFactory.getLog(FixedLengthTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;
@@ -62,4 +62,4 @@ public class DelimitedTest extends Abstr
             counter++;
         }
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithNoDescriptorTest.java Tue Feb  1 07:41:02 2011
@@ -25,8 +25,8 @@ 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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -39,7 +39,7 @@ import static org.junit.Assert.assertNot
  */
 @ContextConfiguration
 public class DelimitedWithNoDescriptorTest extends AbstractJUnit4SpringContextTests {
-    private static final transient Log LOG = LogFactory.getLog(FixedLengthTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;
@@ -64,4 +64,4 @@ public class DelimitedWithNoDescriptorTe
 
     }
 
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/DelimitedWithUnmarshalTest.java Tue Feb  1 07:41:02 2011
@@ -25,8 +25,8 @@ 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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -39,7 +39,7 @@ import static org.junit.Assert.assertNot
  */
 @ContextConfiguration
 public class DelimitedWithUnmarshalTest extends AbstractJUnit4SpringContextTests {
-    private static final transient Log LOG = LogFactory.getLog(FixedLengthTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;
@@ -62,4 +62,4 @@ public class DelimitedWithUnmarshalTest 
             counter++;
         }
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java Tue Feb  1 07:41:02 2011
@@ -25,8 +25,8 @@ 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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertNot
  */
 @ContextConfiguration
 public class FixedLengthTest extends AbstractJUnit4SpringContextTests {
-    private static final transient Log LOG = LogFactory.getLog(FixedLengthTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthWithUnmarshalTest.java Tue Feb  1 07:41:02 2011
@@ -25,8 +25,8 @@ 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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertNot
  */
 @ContextConfiguration
 public class FixedLengthWithUnmarshalTest extends AbstractJUnit4SpringContextTests {
-    private static final transient Log LOG = LogFactory.getLog(FixedLengthTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(FixedLengthTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;
@@ -61,4 +61,4 @@ public class FixedLengthWithUnmarshalTes
             counter++;
         }
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java Tue Feb  1 07:41:02 2011
@@ -25,8 +25,8 @@ 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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -39,7 +39,7 @@ import static org.junit.Assert.assertNot
  */
 @ContextConfiguration
 public class HeaderAndTrailerTest extends AbstractJUnit4SpringContextTests {
-    private static final transient Log LOG = LogFactory.getLog(HeaderAndTrailerTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(HeaderAndTrailerTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;
@@ -75,4 +75,4 @@ public class HeaderAndTrailerTest extend
         assertEquals("SUCCESS", trailer.get("STATUS"));
     }
 
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java (original)
+++ camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/NoSplitRowsTest.java Tue Feb  1 07:41:02 2011
@@ -22,8 +22,8 @@ import java.util.Map;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.util.CastUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertEqu
 @ContextConfiguration
 public class NoSplitRowsTest extends AbstractJUnit4SpringContextTests {
     
-    private static final transient Log LOG = LogFactory.getLog(NoSplitRowsTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(NoSplitRowsTest.class);
 
     @EndpointInject(uri = "mock:results")
     protected MockEndpoint results;
@@ -74,4 +74,4 @@ public class NoSplitRowsTest extends Abs
         assertEquals("SUCCESS", trailer.get("STATUS"));
     }
 
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-groovy/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-groovy/pom.xml?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-groovy/pom.xml (original)
+++ camel/trunk/components/camel-groovy/pom.xml Tue Feb  1 07:41:02 2011
@@ -63,8 +63,8 @@
 	  <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>

Modified: camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyExpressionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyExpressionTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyExpressionTest.java (original)
+++ camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyExpressionTest.java Tue Feb  1 07:41:02 2011
@@ -20,8 +20,8 @@ import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.DefaultExchange;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -29,7 +29,7 @@ import org.junit.Test;
  * @version $Revision$
  */
 public class GroovyExpressionTest extends CamelTestSupport {
-    private static final transient Log LOG = LogFactory.getLog(GroovyTest.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(GroovyTest.class);
 
     protected Exchange exchange;
 
@@ -74,4 +74,4 @@ public class GroovyExpressionTest extend
         exchange.getIn().setHeader("foo.bar", "cheese");
         exchange.getIn().setHeader("name", "James");
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-guice/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-guice/pom.xml?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-guice/pom.xml (original)
+++ camel/trunk/components/camel-guice/pom.xml Tue Feb  1 07:41:02 2011
@@ -58,8 +58,8 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -68,13 +68,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <!-- requires a newer version than the parent using 4.4 -->
-      <version>4.6</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.hamcrest</groupId>
       <artifactId>hamcrest-all</artifactId>
       <scope>test</scope>

Modified: camel/trunk/components/camel-guice/src/test/java/org/apache/camel/guice/produce/MyListenerService.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-guice/src/test/java/org/apache/camel/guice/produce/MyListenerService.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-guice/src/test/java/org/apache/camel/guice/produce/MyListenerService.java (original)
+++ camel/trunk/components/camel-guice/src/test/java/org/apache/camel/guice/produce/MyListenerService.java Tue Feb  1 07:41:02 2011
@@ -17,15 +17,15 @@
 package org.apache.camel.guice.produce;
 
 import org.apache.camel.Consume;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Revision$
  */
 public class MyListenerService implements MyListener {
 
-    private static final Log LOG = LogFactory.getLog(MyListenerService.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MyListenerService.class);
 
     public MyListenerService() {
     }
@@ -35,4 +35,4 @@ public class MyListenerService implement
         LOG.debug("Invoked sayHello with: " + name);
         return "Hello " + name;
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBAggregationRepository.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBAggregationRepository.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBAggregationRepository.java (original)
+++ camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBAggregationRepository.java Tue Feb  1 07:41:02 2011
@@ -31,8 +31,8 @@ import org.apache.camel.impl.ServiceSupp
 import org.apache.camel.spi.RecoverableAggregationRepository;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.fusesource.hawtbuf.Buffer;
 import org.fusesource.hawtdb.api.SortedIndex;
 import org.fusesource.hawtdb.api.Transaction;
@@ -42,7 +42,7 @@ import org.fusesource.hawtdb.api.Transac
  */
 public class HawtDBAggregationRepository extends ServiceSupport implements RecoverableAggregationRepository {
 
-    private static final transient Log LOG = LogFactory.getLog(HawtDBAggregationRepository.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(HawtDBAggregationRepository.class);
     private HawtDBFile hawtDBFile;
     private String persistentFileName;
     private String repositoryName;

Modified: camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java (original)
+++ camel/trunk/components/camel-hawtdb/src/main/java/org/apache/camel/component/hawtdb/HawtDBFile.java Tue Feb  1 07:41:02 2011
@@ -17,8 +17,8 @@
 package org.apache.camel.component.hawtdb;
 
 import org.apache.camel.Service;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.fusesource.hawtbuf.Buffer;
 import org.fusesource.hawtbuf.codec.BufferCodec;
 import org.fusesource.hawtbuf.codec.IntegerCodec;
@@ -38,7 +38,7 @@ import org.fusesource.hawtdb.api.TxPageF
  */
 public class HawtDBFile extends TxPageFileFactory implements Service {
 
-    private static final transient Log LOG = LogFactory.getLog(HawtDBFile.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(HawtDBFile.class);
 
     // the root which contains an index with name -> page for the real indexes
     private static final BTreeIndexFactory<String, Integer> ROOT_INDEXES_FACTORY = new BTreeIndexFactory<String, Integer>();

Modified: camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadAndRecoverTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadAndRecoverTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadAndRecoverTest.java (original)
+++ camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadAndRecoverTest.java Tue Feb  1 07:41:02 2011
@@ -26,14 +26,14 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.processor.aggregate.AggregationStrategy;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Before;
 import org.junit.Test;
 
 public class HawtDBAggregateLoadAndRecoverTest extends CamelTestSupport {
 
-    private static final Log LOG = LogFactory.getLog(HawtDBAggregateLoadAndRecoverTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(HawtDBAggregateLoadAndRecoverTest.class);
     private static final int SIZE = 200;
     private static AtomicInteger counter = new AtomicInteger();
 
@@ -127,4 +127,4 @@ public class HawtDBAggregateLoadAndRecov
         }
     }
 
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java (original)
+++ camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadConcurrentTest.java Tue Feb  1 07:41:02 2011
@@ -25,15 +25,15 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.processor.aggregate.AggregationStrategy;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
 public class HawtDBAggregateLoadConcurrentTest extends CamelTestSupport {
 
-    private static final Log LOG = LogFactory.getLog(HawtDBAggregateLoadConcurrentTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(HawtDBAggregateLoadConcurrentTest.class);
     private static final char[] KEYS = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
     private static final int SIZE = 500;
 
@@ -110,4 +110,4 @@ public class HawtDBAggregateLoadConcurre
             return oldExchange;
         }
     }
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java (original)
+++ camel/trunk/components/camel-hawtdb/src/test/java/org/apache/camel/component/hawtdb/HawtDBAggregateLoadTest.java Tue Feb  1 07:41:02 2011
@@ -21,14 +21,14 @@ import org.apache.camel.builder.RouteBui
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.processor.aggregate.AggregationStrategy;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.junit.Before;
 import org.junit.Test;
 
 public class HawtDBAggregateLoadTest extends CamelTestSupport {
 
-    private static final Log LOG = LogFactory.getLog(HawtDBAggregateLoadTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(HawtDBAggregateLoadTest.class);
     private static final int SIZE = 500;
     private HawtDBAggregationRepository repo;
 
@@ -95,4 +95,4 @@ public class HawtDBAggregateLoadTest ext
         }
     }
 
-}
\ No newline at end of file
+}

Modified: camel/trunk/components/camel-hl7/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/pom.xml?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/pom.xml (original)
+++ camel/trunk/components/camel-hl7/pom.xml Tue Feb  1 07:41:02 2011
@@ -104,11 +104,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
             <scope>test</scope>

Modified: camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPDecoder.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPDecoder.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPDecoder.java (original)
+++ camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPDecoder.java Tue Feb  1 07:41:02 2011
@@ -19,8 +19,8 @@ package org.apache.camel.component.hl7;
 import java.nio.charset.CharacterCodingException;
 import java.nio.charset.CharsetDecoder;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
@@ -32,7 +32,7 @@ import org.apache.mina.filter.codec.Prot
  */
 class HL7MLLPDecoder extends CumulativeProtocolDecoder {
 
-    private static final transient Log LOG = LogFactory.getLog(HL7MLLPDecoder.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(HL7MLLPDecoder.class);
 
     private static final String CHARSET_DECODER = HL7MLLPDecoder.class.getName() + ".charsetdecoder";
     private static final String DECODER_STATE = HL7MLLPDecoder.class.getName() + ".STATE";

Modified: camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPEncoder.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPEncoder.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPEncoder.java (original)
+++ camel/trunk/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7MLLPEncoder.java Tue Feb  1 07:41:02 2011
@@ -20,8 +20,8 @@ import java.nio.charset.CharsetEncoder;
 
 import ca.uhn.hl7v2.model.Message;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -32,7 +32,7 @@ import org.apache.mina.filter.codec.Prot
  */
 class HL7MLLPEncoder implements ProtocolEncoder {
 
-    private static final transient Log LOG = LogFactory.getLog(HL7MLLPEncoder.class);
+    private static final transient Logger LOG = LoggerFactory.getLogger(HL7MLLPEncoder.class);
 
     private static final String CHARSET_ENCODER = HL7MLLPCodec.class.getName() + ".charsetencoder";
 

Modified: camel/trunk/components/camel-ibatis/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ibatis/pom.xml?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-ibatis/pom.xml (original)
+++ camel/trunk/components/camel-ibatis/pom.xml Tue Feb  1 07:41:02 2011
@@ -68,8 +68,8 @@
     </dependency>
 
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>

Modified: camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java (original)
+++ camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java Tue Feb  1 07:41:02 2011
@@ -24,8 +24,8 @@ import java.util.Map;
 import com.ibatis.sqlmap.client.SqlMapClient;
 import com.ibatis.sqlmap.client.SqlMapClientBuilder;
 import org.apache.camel.component.ResourceBasedComponent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.core.io.Resource;
 
 /**

Modified: camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java (original)
+++ camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisPollingConsumer.java Tue Feb  1 07:41:02 2011
@@ -30,8 +30,8 @@ import org.apache.camel.impl.ScheduledPo
 import org.apache.camel.spi.ShutdownAware;
 import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <pre>
@@ -100,7 +100,7 @@ import org.apache.commons.logging.LogFac
  */
 public class IBatisPollingConsumer extends ScheduledPollConsumer implements BatchConsumer, ShutdownAware {
 
-    private static final Log LOG = LogFactory.getLog(IBatisPollingConsumer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(IBatisPollingConsumer.class);
 
     private final class DataHolder {
         private Exchange exchange;

Modified: camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java?rev=1065931&r1=1065930&r2=1065931&view=diff
==============================================================================
--- camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java (original)
+++ camel/trunk/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisProducer.java Tue Feb  1 07:41:02 2011
@@ -24,14 +24,14 @@ import org.apache.camel.Message;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.camel.util.ExchangeHelper;
 import org.apache.camel.util.ObjectHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Revision$
  */
 public class IBatisProducer extends DefaultProducer {
-    private static final Log LOG = LogFactory.getLog(IBatisProducer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(IBatisProducer.class);
     private String statement;
     private IBatisEndpoint endpoint;
 



Mime
View raw message