Author: ningjiang
Date: Wed Jul 2 20:49:51 2008
New Revision: 673572
URL: http://svn.apache.org/viewvc?rev=673572&view=rev
Log:
Fixed the cs errors
Modified:
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsBeanMethodHeaderTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsFilenameHeaderTest.java
activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/JavaScriptExpressionTest.java
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyExpressionTest.java
Modified:
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsBeanMethodHeaderTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsBeanMethodHeaderTest.java?rev=673572&r1=673571&r2=673572&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsBeanMethodHeaderTest.java
(original)
+++
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsBeanMethodHeaderTest.java
Wed Jul 2 20:49:51 2008
@@ -16,6 +16,7 @@
*/
package org.apache.camel.component.jms.issues;
+
import javax.jms.ConnectionFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
@@ -24,10 +25,11 @@
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.bean.BeanProcessor;
-import static
org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
+import static
org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
+
/**
* Unit test for sending the bean method name as a key over the JMS wire, that
we now support this.
*/
Modified:
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsFilenameHeaderTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsFilenameHeaderTest.java?rev=673572&r1=673571&r2=673572&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsFilenameHeaderTest.java
(original)
+++
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsFilenameHeaderTest.java
Wed Jul 2 20:49:51 2008
@@ -17,6 +17,7 @@
package org.apache.camel.component.jms.issues;
import java.io.File;
+
import javax.jms.ConnectionFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
@@ -24,9 +25,10 @@
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.file.FileComponent;
-import static
org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
import org.apache.camel.component.mock.MockEndpoint;
+import static
org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
+
/**
* Unit test for sending the filename for file producer over the JMS wire.
*/
Modified:
activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java?rev=673572&r1=673571&r2=673572&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
(original)
+++
activemq/camel/trunk/components/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
Wed Jul 2 20:49:51 2008
@@ -20,7 +20,6 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
-import java.lang.reflect.InvocationTargetException;
import javax.script.Compilable;
import javax.script.CompiledScript;
@@ -36,7 +35,6 @@
import org.apache.camel.converter.ObjectConverter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
@@ -44,7 +42,7 @@
/**
* A builder class for creating [EMAIL PROTECTED] Processor}, [EMAIL
PROTECTED] Expression} and
* [EMAIL PROTECTED] Predicate} objects using the JSR 223 scripting engine.
- *
+ *
* @version $Revision$
*/
public class ScriptBuilder<E extends Exchange> implements Expression<E>,
Predicate<E>, Processor {
@@ -101,7 +99,7 @@
/**
* Sets the attribute on the context so that it is available to the script
* as a variable in the [EMAIL PROTECTED] ScriptContext#ENGINE_SCOPE}
- *
+ *
* @param name the name of the attribute
* @param value the attribute value
* @return this builder
@@ -116,7 +114,7 @@
/**
* Creates a script builder for the named language and script contents
- *
+ *
* @param language the language to use for the script
* @param scriptText the script text to be evaluted
* @return the builder
@@ -127,7 +125,7 @@
/**
* Creates a script builder for the named language and script [EMAIL
PROTECTED] Resource}
- *
+ *
* @param language the language to use for the script
* @param scriptResource the resource used to load the script
* @return the builder
@@ -149,7 +147,7 @@
/**
* Creates a script builder for the named language and script [EMAIL
PROTECTED] URL}
- *
+ *
* @param language the language to use for the script
* @param scriptURL the URL used to load the script
* @return the builder
@@ -163,7 +161,7 @@
/**
* Creates a script builder for the groovy script contents
- *
+ *
* @param scriptText the script text to be evaluted
* @return the builder
*/
@@ -183,7 +181,7 @@
/**
* Creates a script builder for the groovy script [EMAIL PROTECTED] File}
- *
+ *
* @param scriptFile the file used to load the script
* @return the builder
*/
@@ -193,7 +191,7 @@
/**
* Creates a script builder for the groovy script [EMAIL PROTECTED] URL}
- *
+ *
* @param scriptURL the URL used to load the script
* @return the builder
*/
@@ -206,7 +204,7 @@
/**
* Creates a script builder for the JavaScript/ECMAScript script contents
- *
+ *
* @param scriptText the script text to be evaluted
* @return the builder
*/
@@ -216,7 +214,7 @@
/**
* Creates a script builder for the JavaScript/ECMAScript script
- *
+ *
* @{link Resource}
* @param scriptResource the resource used to load the script
* @return the builder
@@ -250,7 +248,7 @@
/**
* Creates a script builder for the PHP script contents
- *
+ *
* @param scriptText the script text to be evaluted
* @return the builder
*/
@@ -293,7 +291,7 @@
/**
* Creates a script builder for the Python script contents
- *
+ *
* @param scriptText the script text to be evaluted
* @return the builder
*/
@@ -336,7 +334,7 @@
/**
* Creates a script builder for the Ruby/JRuby script contents
- *
+ *
* @param scriptText the script text to be evaluted
* @return the builder
*/
@@ -366,7 +364,7 @@
/**
* Creates a script builder for the Ruby/JRuby script [EMAIL PROTECTED]
URL}
- *
+ *
* @param scriptURL the URL used to load the script
* @return the builder
*/
@@ -402,7 +400,7 @@
/**
* Returns a description of the script
- *
+ *
* @return the script description
*/
public String getScriptDescription() {
@@ -527,11 +525,14 @@
}
protected ScriptEvaluationException
createScriptEvaluationException(Throwable e) {
-
if(e.getClass().getName().equals("org.jruby.exceptions.RaiseException")) { //
Only the nested exception has the specific problem
+ if
(e.getClass().getName().equals("org.jruby.exceptions.RaiseException")) {
+ // Only the nested exception has the specific problem
try {
Object ex = e.getClass().getMethod("getException").invoke(e);
- return new ScriptEvaluationException("Failed to evaluate: " +
getScriptDescription() + ". Error: "+ex+". Cause: "+e, e);
- } catch (Exception e1) {}
+ return new ScriptEvaluationException("Failed to evaluate: " +
getScriptDescription() + ". Error: " + ex + ". Cause: " + e, e);
+ } catch (Exception e1) {
+ // do nothing here
+ }
}
return new ScriptEvaluationException("Failed to evaluate: " +
getScriptDescription() + ". Cause: " + e, e);
}
Modified:
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/JavaScriptExpressionTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/JavaScriptExpressionTest.java?rev=673572&r1=673571&r2=673572&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/JavaScriptExpressionTest.java
(original)
+++
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/JavaScriptExpressionTest.java
Wed Jul 2 20:49:51 2008
@@ -16,8 +16,9 @@
*/
package org.apache.camel.builder.script;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
+
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
@@ -54,7 +55,7 @@
return new RouteBuilder() {
public void configure() throws Exception {
from("direct:start").choice().
- // The following python expression should return a
boolean
+ // The following java script expression should return
a boolean
// but it seems to always return false -- what's up
with that?
when().javaScript("request.headers['foo'] ==
'bar'").to("mock:result")
.otherwise().to("mock:unmatched");
Modified:
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyExpressionTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyExpressionTest.java?rev=673572&r1=673571&r2=673572&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyExpressionTest.java
(original)
+++
activemq/camel/trunk/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyExpressionTest.java
Wed Jul 2 20:49:51 2008
@@ -16,8 +16,9 @@
*/
package org.apache.camel.builder.script;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
+
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;