INT-1552 doc polishing, also updated Groovy-based Control Bus to be more consistent with the SpEL version

This commit is contained in:
Mark Fisher
2010-11-22 14:01:39 -05:00
parent 36e43a8ed1
commit 4e8076fd2b
8 changed files with 103 additions and 211 deletions

View File

@@ -36,7 +36,7 @@ public class GroovyScriptPayloadMessageProcessorTests {
private AtomicInteger countHolder = new AtomicInteger();
private GroovyScriptPayloadMessageProcessor processor = new GroovyScriptPayloadMessageProcessor();
private GroovyCommandMessageProcessor processor = new GroovyCommandMessageProcessor();
@Test
@Repeat(20)
@@ -61,7 +61,7 @@ public class GroovyScriptPayloadMessageProcessorTests {
public void testSimpleExecutionWithContext() throws Exception {
Message<?> message = MessageBuilder.withPayload("\"spam is $spam foo is $headers.foo\"")
.setHeader("foo", "bar").build();
MessageProcessor<Object> processor = new GroovyScriptPayloadMessageProcessor(Collections.singletonMap("spam",
MessageProcessor<Object> processor = new GroovyCommandMessageProcessor(Collections.singletonMap("spam",
"bucket"));
Object result = processor.processMessage(message);
assertEquals("spam is bucket foo is bar", result.toString());

View File

@@ -21,11 +21,14 @@ import static org.junit.Assert.assertNull;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -51,9 +54,13 @@ public class GroovyControlBusTests {
assertNull(output.receive(0));
}
@ManagedResource
public static class Service {
@ManagedOperation
public String convert(String input) {
return "cat";
}
}
}