[BS-48] Add autoconfigured JMS support
* Add ability to detect spring-jms on the path and create a JmsTemplate with ActiveMQConnectionFactory * Create tests showing autoconfigured JmsTemplate with ActiveMQ, but prove it backs off if a separate ConnectionFactory exists. * Add support to spring-boot-cli to that it detects JmsTemplate, DefaultMessageListenerContainer, or SimpleMessageListenerContainer, and turns on autoconfiguration as well as add proper @Grab's and import statements. * Write a jms.groovy test showing proper CLI support Simplify ActiveMQ configuration Update ActiveMQ to 5.7.0
This commit is contained in:
committed by
Dave Syer
parent
ecc4676fb3
commit
5801e422cf
@@ -16,6 +16,10 @@
|
||||
|
||||
package org.springframework.boot.cli;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Executors;
|
||||
@@ -32,13 +36,11 @@ import org.springframework.boot.OutputCapture;
|
||||
import org.springframework.boot.cli.command.CleanCommand;
|
||||
import org.springframework.boot.cli.command.RunCommand;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Integration tests to exercise the samples.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @author Greg Turnquist
|
||||
*/
|
||||
public class SampleIntegrationTests {
|
||||
|
||||
@@ -185,4 +187,13 @@ public class SampleIntegrationTests {
|
||||
assertTrue("Wrong output: " + output, output.contains("Foo count="));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jmsSample() throws Exception {
|
||||
start("samples/app.xml", "samples/jms.groovy");
|
||||
String output = this.outputCapture.getOutputAndRelease();
|
||||
assertTrue("Wrong output: " + output,
|
||||
output.contains("Received Greetings from Spring Boot via ActiveMQ"));
|
||||
FileUtil.forceDelete(new File("activemq-data")); // cleanup ActiveMQ cruft
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user