checkstyle MutableException
checkstyle EmptyBlock checkstyle fixRightCurly Script checkstyle EmptyStatement checkstyle RightCurly checkstyle TailingWhite checkstyle NeedBraces Fix the line separator in the `fixRightCurly.gradle`
This commit is contained in:
committed by
Artem Bilan
parent
c0b19e61b5
commit
842aded9a4
@@ -25,12 +25,12 @@ import org.springframework.messaging.MessagingException;
|
||||
@SuppressWarnings("serial")
|
||||
|
||||
public class ScriptingException extends MessagingException {
|
||||
|
||||
|
||||
public ScriptingException(String description) {
|
||||
super(description);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ScriptingException(String description, Throwable cause) {
|
||||
super(description, cause);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.integration.config.xml.AbstractIntegrationNamespaceHa
|
||||
public class ScriptNamespaceHandler extends AbstractIntegrationNamespaceHandler {
|
||||
|
||||
public void init() {
|
||||
this.registerBeanDefinitionParser("script", new ScriptParser());
|
||||
this.registerBeanDefinitionParser("script", new ScriptParser());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Jsr223FilterTests {
|
||||
Message<?> message2 = MessageBuilder.withPayload("test-2")
|
||||
.setReplyChannel(replyChannel)
|
||||
.setHeader("type", "good")
|
||||
.build();
|
||||
.build();
|
||||
this.referencedScriptInput.send(message1);
|
||||
this.referencedScriptInput.send(message2);
|
||||
assertEquals("test-2", replyChannel.receive(0).getPayload());
|
||||
@@ -70,7 +70,7 @@ public class Jsr223FilterTests {
|
||||
QueueChannel replyChannel = new QueueChannel();
|
||||
replyChannel.setBeanName("returnAddress");
|
||||
Message<?> message1 = MessageBuilder.withPayload("bad").setReplyChannel(replyChannel).build();
|
||||
Message<?> message2 = MessageBuilder.withPayload("good").setReplyChannel(replyChannel).build();
|
||||
Message<?> message2 = MessageBuilder.withPayload("good").setReplyChannel(replyChannel).build();
|
||||
this.inlineScriptInput.send(message1);
|
||||
this.inlineScriptInput.send(message2);
|
||||
Message<?> received = replyChannel.receive(0);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Jsr223RefreshTests {
|
||||
super.setValue(new CycleResource());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class CycleResource extends AbstractResource {
|
||||
|
||||
private int count = -1;
|
||||
@@ -72,12 +72,12 @@ public class Jsr223RefreshTests {
|
||||
public String getDescription() {
|
||||
return "CycleResource";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getFilename() throws IllegalStateException {
|
||||
return "CycleResource";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long lastModified() throws IOException {
|
||||
return -1;
|
||||
@@ -89,6 +89,6 @@ public class Jsr223RefreshTests {
|
||||
}
|
||||
return new ByteArrayInputStream(scripts[count].getBytes());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,22 +30,22 @@ import org.springframework.scripting.support.ResourceScriptSource;
|
||||
*
|
||||
*/
|
||||
public class PythonVariableParserTests {
|
||||
|
||||
|
||||
@Test
|
||||
public void testBasic() throws IOException {
|
||||
String var = PythonScriptExecutor.PythonVariableParser.parseReturnVariable("x=2");
|
||||
assertEquals("x",var);
|
||||
|
||||
|
||||
var = PythonScriptExecutor.PythonVariableParser.parseReturnVariable("\n\n\nx = 2\n\n\n");
|
||||
assertEquals("x",var);
|
||||
|
||||
|
||||
var = PythonScriptExecutor.PythonVariableParser.parseReturnVariable("\n\n\nx\n\n\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void test2() throws IOException {
|
||||
ScriptSource source =
|
||||
ScriptSource source =
|
||||
new ResourceScriptSource(new ClassPathResource("/org/springframework/integration/scripting/jsr223/test2.py"));
|
||||
String var = PythonScriptExecutor.PythonVariableParser.parseReturnVariable(source.getScriptAsString());
|
||||
assertEquals("bar",var);
|
||||
|
||||
Reference in New Issue
Block a user