diff --git a/getting-started/helloworld/.classpath b/getting-started/helloworld/.classpath index 16f01e2e..dde3100b 100644 --- a/getting-started/helloworld/.classpath +++ b/getting-started/helloworld/.classpath @@ -1,7 +1,10 @@ - + + + + diff --git a/getting-started/helloworld/.gitignore b/getting-started/helloworld/.gitignore new file mode 100644 index 00000000..ea8c4bf7 --- /dev/null +++ b/getting-started/helloworld/.gitignore @@ -0,0 +1 @@ +/target diff --git a/getting-started/helloworld/README.txt b/getting-started/helloworld/README.txt deleted file mode 100644 index f46df4fa..00000000 --- a/getting-started/helloworld/README.txt +++ /dev/null @@ -1,9 +0,0 @@ -Instructions for running the HelloWorldDemo sample -------------------------------------------------------------------------------- -1. See README.txt in the parent directory. - -2. To run this sample as a standalone application simply execute the - HelloWorldDemo class that is located within the - org.springframework.integration.samples.helloworld package. - -Happy integration :-) diff --git a/getting-started/helloworld/pom.xml b/getting-started/helloworld/pom.xml index 8ee01e01..7506815a 100644 --- a/getting-started/helloworld/pom.xml +++ b/getting-started/helloworld/pom.xml @@ -2,51 +2,47 @@ 4.0.0 - - org.springframework.integration.samples - spring-integration-samples - 2.0.0.BUILD-SNAPSHOT - + org.springframework.integration.samples helloworld + 2.0.0 Spring Integration Hello World Sample - - - - ${basedir}/src/main/java - - **/*.xml - - - - false - ${basedir}/src/main/resources - - META-INF/spring/*.xml - - - - + jar + + 2.0.0.M7 + 1.2.15 + 4.7 + org.springframework.integration spring-integration-core + ${spring.integration.version} + + + log4j + log4j + ${log4j.version} + + + + junit + junit + ${junit.version} - - - repository.springframework.maven.release - Spring Framework Maven Release Repository - http://maven.springframework.org/release - - - repository.springframework.maven.milestone - Spring Framework Maven Milestone Repository - http://maven.springframework.org/milestone - - - repository.springframework.maven.snapshot - Spring Framework Maven Snapshot Repository - http://maven.springframework.org/snapshot - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + -Xlint:all + true + false + + + + + \ No newline at end of file diff --git a/getting-started/helloworld/readme.txt b/getting-started/helloworld/readme.txt new file mode 100644 index 00000000..13f8fd6a --- /dev/null +++ b/getting-started/helloworld/readme.txt @@ -0,0 +1,5 @@ +This is an obvious place to get started. It demonstrates a simple message flow represented by the diagram below: + +Message -> Channel -> ServiceActivator -> QueueChannel + +To run sample simply execute a test case in org.springframework.integration.samples.helloworld package \ No newline at end of file diff --git a/getting-started/helloworld/src/main/java/org/springframework/integration/samples/helloworld/helloWorldDemo.xml b/getting-started/helloworld/src/main/resources/META-INF/spring/integration/helloWorldDemo.xml similarity index 100% rename from getting-started/helloworld/src/main/java/org/springframework/integration/samples/helloworld/helloWorldDemo.xml rename to getting-started/helloworld/src/main/resources/META-INF/spring/integration/helloWorldDemo.xml diff --git a/getting-started/helloworld/src/main/java/org/springframework/integration/samples/helloworld/HelloWorldDemo.java b/getting-started/helloworld/src/test/java/org/springframework/integration/samples/helloworld/HelloWorldDemoTest.java similarity index 83% rename from getting-started/helloworld/src/main/java/org/springframework/integration/samples/helloworld/HelloWorldDemo.java rename to getting-started/helloworld/src/test/java/org/springframework/integration/samples/helloworld/HelloWorldDemoTest.java index f234da47..a5266a6e 100644 --- a/getting-started/helloworld/src/main/java/org/springframework/integration/samples/helloworld/HelloWorldDemo.java +++ b/getting-started/helloworld/src/test/java/org/springframework/integration/samples/helloworld/HelloWorldDemoTest.java @@ -16,6 +16,8 @@ package org.springframework.integration.samples.helloworld; +import org.apache.log4j.Logger; +import org.junit.Test; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.MessageChannel; @@ -36,14 +38,17 @@ import org.springframework.integration.message.GenericMessage; * @author Mark Fisher * @author Oleg Zhurakousky */ -public class HelloWorldDemo { +public class HelloWorldDemoTest { - public static void main(String[] args) { - AbstractApplicationContext context = new ClassPathXmlApplicationContext("helloWorldDemo.xml", HelloWorldDemo.class); + private static Logger logger = Logger.getLogger(HelloWorldDemoTest.class); + + @Test + public void testHelloWorld(){ + AbstractApplicationContext context = new ClassPathXmlApplicationContext("/META-INF/spring/integration/helloWorldDemo.xml", HelloWorldDemoTest.class); MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class); PollableChannel outputChannel = context.getBean("outputChannel", PollableChannel.class); inputChannel.send(new GenericMessage("World")); - System.out.println("==> HelloWorldDemo: " + outputChannel.receive(0).getPayload()); + logger.info("==> HelloWorldDemo: " + outputChannel.receive(0).getPayload()); } } diff --git a/getting-started/helloworld/src/main/java/log4j.xml b/getting-started/helloworld/src/test/resources/log4j.xml similarity index 88% rename from getting-started/helloworld/src/main/java/log4j.xml rename to getting-started/helloworld/src/test/resources/log4j.xml index 3865c97d..f391e2ed 100644 --- a/getting-started/helloworld/src/main/java/log4j.xml +++ b/getting-started/helloworld/src/test/resources/log4j.xml @@ -15,8 +15,8 @@ - - + + diff --git a/getting-started/helloworld/target/classes/log4j.xml b/getting-started/helloworld/target/classes/log4j.xml deleted file mode 100644 index 3865c97d..00000000 --- a/getting-started/helloworld/target/classes/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloService.class b/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloService.class deleted file mode 100644 index ec1b46a3..00000000 Binary files a/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloService.class and /dev/null differ diff --git a/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloWorldDemo.class b/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloWorldDemo.class deleted file mode 100644 index b2e229dc..00000000 Binary files a/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloWorldDemo.class and /dev/null differ diff --git a/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/helloWorldDemo.xml b/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/helloWorldDemo.xml deleted file mode 100644 index 0c355f26..00000000 --- a/getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/helloWorldDemo.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - diff --git a/getting-started/helloworld/target/helloworld-2.0.0.BUILD-SNAPSHOT.jar b/getting-started/helloworld/target/helloworld-2.0.0.BUILD-SNAPSHOT.jar deleted file mode 100644 index b956dfac..00000000 Binary files a/getting-started/helloworld/target/helloworld-2.0.0.BUILD-SNAPSHOT.jar and /dev/null differ diff --git a/getting-started/helloworld/target/maven-archiver/pom.properties b/getting-started/helloworld/target/maven-archiver/pom.properties deleted file mode 100644 index 4d6ef09c..00000000 --- a/getting-started/helloworld/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Sat Sep 04 08:22:06 EDT 2010 -version=2.0.0.BUILD-SNAPSHOT -groupId=org.springframework.integration.samples -artifactId=helloworld