INT-1380 added cafe sample
This commit is contained in:
@@ -24,37 +24,34 @@ Delivery object.
|
||||
|
||||
Instructions for running the CafeDemo sample
|
||||
-------------------------------------------------------------------------------
|
||||
1. See README.txt in the parent directory.
|
||||
1. The example comes with two identical configurations. One is ANNOTATION-based anther is XML-based
|
||||
|
||||
2. To run this sample as a standalone application simply execute the CafeDemo
|
||||
class in the org.springframework.integration.samples.cafe.xml package.
|
||||
2. To run this sample simply execute the CafeDemo* test classes
|
||||
in the org.springframework.integration.samples.cafe.xml or
|
||||
org.springframework.integration.samples.cafe.annotation package.
|
||||
|
||||
You shoudl see the output similar to this:
|
||||
|
||||
3. This sample is also configured to be a valid OSGi bundle. This means you can
|
||||
deploy the generated JAR into an OSGi environment providing that the Spring
|
||||
Integration bundles as well as other prerequisites (e.g., Spring Framework)
|
||||
were installed. For example: To deploy it on SpringSource dm Server simply
|
||||
drop the cafe-[version].jar file, located in the 'target' directory, to the
|
||||
'pickup' directory of the dm Server instance. You should see output similar
|
||||
to the following in the trace file:
|
||||
|
||||
. . . . . . . . . . . . .
|
||||
System.out I -----------------------
|
||||
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I Order #1
|
||||
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I Iced MOCHA, 3 shots.
|
||||
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I Hot LATTE, 2 shots.
|
||||
[2010-07-11 01:43:04.614] task-scheduler-3 System.out I -----------------------
|
||||
[2010-07-11 01:43:04.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #5 for order #5: iced 3 shot MOCHA
|
||||
[2010-07-11 01:43:05.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #6 for order #6: iced 3 shot MOCHA
|
||||
[2010-07-11 01:43:06.618] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #7 for order #7: iced 3 shot MOCHA
|
||||
[2010-07-11 01:43:07.619] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #8 for order #8: iced 3 shot MOCHA
|
||||
[2010-07-11 01:43:08.619] task-scheduler-2 System.out I task-scheduler-2 prepared cold drink #9 for order #9: iced 3 shot MOCHA
|
||||
[2010-07-11 01:43:09.614] task-scheduler-3 System.out I task-scheduler-3 prepared hot drink #2 for order #2: hot 2 shot LATTE
|
||||
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I -----------------------
|
||||
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I Order #2
|
||||
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I Iced MOCHA, 3 shots.
|
||||
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I Hot LATTE, 2 shots.
|
||||
[2010-07-11 01:43:09.615] task-scheduler-3 System.out I -----------------------
|
||||
[2010-07-11 01:43:09.620] task-scheduler-2 System.out I task-scheduler-2 prepared cold
|
||||
. . . . . . . . . . . . .
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #1 for order #1: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #2 for order #2: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #3 for order #3: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #4 for order #4: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-2 prepared hot drink #1 for order #1: hot 2 shot LATTE
|
||||
-----------------------
|
||||
Order #1
|
||||
Iced MOCHA, 3 shots.
|
||||
Hot LATTE, 2 shots.
|
||||
-----------------------
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #5 for order #5: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #6 for order #6: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #7 for order #7: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #8 for order #8: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-1 prepared cold drink #9 for order #9: iced 3 shot MOCHA
|
||||
INFO : org.springframework.integration.samples.cafe.annotation.Barista - task-scheduler-2 prepared hot drink #2 for order #2: hot 2 shot LATTE
|
||||
-----------------------
|
||||
Order #2
|
||||
Iced MOCHA, 3 shots.
|
||||
Hot LATTE, 2 shots.
|
||||
-----------------------
|
||||
|
||||
Happy integration :-)
|
||||
@@ -34,12 +34,12 @@ import org.springframework.integration.samples.cafe.Order;
|
||||
* @author Mark Fisher
|
||||
* @author Marius Bogoevici
|
||||
*/
|
||||
public class CafeDemoTestAnnotation {
|
||||
public class CafeDemoAnnotationConfiguredTest {
|
||||
|
||||
@Test
|
||||
public void testCafeDemoWithAnnotationSupport() {
|
||||
AbstractApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("/META-INF/spring/integration/cafeDemo-annotation.xml", CafeDemoTestAnnotation.class);
|
||||
new ClassPathXmlApplicationContext("/META-INF/spring/integration/cafeDemo-annotation.xml", CafeDemoAnnotationConfiguredTest.class);
|
||||
|
||||
Cafe cafe = (Cafe) context.getBean("cafe");
|
||||
for (int i = 1; i <= 100; i++) {
|
||||
@@ -36,12 +36,12 @@ import org.springframework.integration.samples.cafe.Order;
|
||||
* @author Marius Bogoevici
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
public class CafeDemoTestXml {
|
||||
public class CafeDemoXmlConfiguredTest {
|
||||
|
||||
@Test
|
||||
public void testCafeDemoWithXmlSupport() {
|
||||
AbstractApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("/META-INF/spring/integration/cafeDemo-xml.xml", CafeDemoTestXml.class);
|
||||
new ClassPathXmlApplicationContext("/META-INF/spring/integration/cafeDemo-xml.xml", CafeDemoXmlConfiguredTest.class);
|
||||
|
||||
Cafe cafe = (Cafe) context.getBean("cafe");
|
||||
for (int i = 1; i <= 100; i++) {
|
||||
Reference in New Issue
Block a user