From d8740280ab36d04db776396a4aeca6dd7ad7cbb1 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Thu, 16 Sep 2010 15:51:09 -0400 Subject: [PATCH] INT-1380 added helloworld example --- getting-started/helloworld/.classpath | 5 +- getting-started/helloworld/.gitignore | 1 + getting-started/helloworld/README.txt | 9 --- getting-started/helloworld/pom.xml | 76 +++++++++--------- getting-started/helloworld/readme.txt | 5 ++ .../spring/integration}/helloWorldDemo.xml | 0 .../helloworld/HelloWorldDemoTest.java} | 13 ++- .../{main/java => test/resources}/log4j.xml | 4 +- .../helloworld/target/classes/log4j.xml | 28 ------- .../samples/helloworld/HelloService.class | Bin 712 -> 0 bytes .../samples/helloworld/HelloWorldDemo.class | Bin 1881 -> 0 bytes .../samples/helloworld/helloWorldDemo.xml | 23 ------ .../helloworld-2.0.0.BUILD-SNAPSHOT.jar | Bin 5312 -> 0 bytes .../target/maven-archiver/pom.properties | 5 -- 14 files changed, 57 insertions(+), 112 deletions(-) create mode 100644 getting-started/helloworld/.gitignore delete mode 100644 getting-started/helloworld/README.txt create mode 100644 getting-started/helloworld/readme.txt rename getting-started/helloworld/src/main/{java/org/springframework/integration/samples/helloworld => resources/META-INF/spring/integration}/helloWorldDemo.xml (100%) rename getting-started/helloworld/src/{main/java/org/springframework/integration/samples/helloworld/HelloWorldDemo.java => test/java/org/springframework/integration/samples/helloworld/HelloWorldDemoTest.java} (83%) rename getting-started/helloworld/src/{main/java => test/resources}/log4j.xml (88%) delete mode 100644 getting-started/helloworld/target/classes/log4j.xml delete mode 100644 getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloService.class delete mode 100644 getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/HelloWorldDemo.class delete mode 100644 getting-started/helloworld/target/classes/org/springframework/integration/samples/helloworld/helloWorldDemo.xml delete mode 100644 getting-started/helloworld/target/helloworld-2.0.0.BUILD-SNAPSHOT.jar delete mode 100644 getting-started/helloworld/target/maven-archiver/pom.properties 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 ec1b46a30b8d507941332adf1b8edf869dbb3bc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 712 zcmbtSO-}+r41GluM3fH|Q2anm3}|!{uNaLQjR&F!42j19Mi^ao$?SshU+F~?P5c4= zC}RgmG{DVEJ8fUzzP9`I{r(By09zph2*<8&SYBHzr*Wr6OFp{#!BUPd8(R3vbu3S` z+P3tprnGIBt9ISGG|#fsT~(7I1PSqb(G`|0oQ8E>y_YqgFm@l!xsyqsSpx`^f2KA7(ES(vkYUz0Ts**1!WhO9b*h8uB^fuHMrm==pyP%Gjx_QJ(rs4HTtvS z0~DbumFN5@%ddB*aDl0Usys~JzwUF+cbWe_{{0Vtn|N)Yk6|&4TTT+iUeNkI=Dzqd zjQ?=FK#5k&l@|t1!u?2!#Mu^7hO{fUoX2{&u7?kV9~#Ip48P%Txg&Yda-MF!5w2o5 zbJq(zRb}We6q^jWTDT=l^kdM%0M0O+t9yZ1ZTp)de#SSYV6f|<%Vm?to}Q%Nlo+J&fwqN*i zF^Z(;cEqZ6kL58!WIBQ!s8oLEOB2JmpxIw!xL!Dppl7A?071%QjKT7PsI6+-JP3p| zaG9Z;1+v#`Db5zX@pYh5IKY=)mVQ?f=aC3R?768zc@!81 zI&Ly?4Kvz3vkVt{d8L?(%^{3q&O#Xug;FAdErwFz#K25nsuW)i;yZkA;O3!xS$m%- z;aj+cA1GHy5_-KWm=`(?3Qa`;D!5-UaGT-M(YRe|dvZ&}dHlpMy0B24IGmk#CQQtu zqG{bdLhB&zhcJn%g?qS9u8oB&ytkB%rNVOY)ZB)!ga-y{4AUq1A(g|z&v?jSQYba} zdl_;PbF@%A9x59DV++4vnQ97;qK@oyS^nv9Ra>IHJm07F+=ZEB!}+J{nO$r`DjELp`H@U}hKjzdG9{ zwR#(v#t^ku_W<>0X*P&2aE?~A@dvsnM}2c2!yC43vt5kVXYEV&_zu4O7vn3l_7!`w zGoD;6?c>^pJ-v(K9!h;!|9~6&nBTB}+{K-_!96VWV-JfAJ9xB%Cp&oh8O>$F1I!SD zS&X5CDa=v&mGPY5YlJgh6nI7}8t*ciSSO5QsM7a>C{NK3^eQ$;0*04#rVp<^0puVb A+5i9m 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 b956dfac2534f649211b5ccff207b56937ab9a90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5312 zcmb_f2{@E%8y;)cObj7H6pAq!yC`JBL}QJk$TFA=V;MWy$&yj_>}$!ABC>RxY*|8< zEHkncjxD0%pyi)QnojEc{r%^?u5Y=n?|Gj4dB5j2lp_; z#SeEq?k?AZ^h3v|T*S1xTE*bvs&u<1^Niv-j{G6yS)CT8#|GEa$EF`H0r4=h#zFPi zec3wnUK77)L0z@}c)o7Pm9HK#yq@1YoB&(~oxdHAjy-7OO}h*`k?L6u*v<~{DLZ09 zUj{Yt4dY__CI6ikr2I)1u1+o}M_U^g3kReJ#>M_0Jota$fpWwmZCxy|D2(Gjc#Hgm zx2uJN6B_CI4^g21LliqC8jT^&32pr);8qz^ulv@VqW}O#C;pIOkv%xKmvL=lng4a;1-Q`bb4|at)f!}9>{>w%cp1|bmxhpx%=E_9>%vsIbat0as2i(nth1%%_b=hZia8*G!EWBi2 zdhzNDP9eG4PpQmI78i=|$Ar#3zpzl5ZWQqVkv>C#Mre5v7Ki<>KG#zeAn1R{^mch? z6U|r|Y#)`f%2X*;iG7qA-;tieek5otNxw=mu=mV*LcPOZ^xJE7s|1N7#+h!!5|k24 zp#Ez$)gYBuAL-(bvOxD?Z4c6cKd&_kVfXW(5oT|87 z9fiup_JxaYZqKP_XYoD3MJ^VrS}0MAFDOC(%-ED);*-DtVi3`SVW&aEa+Ix2v3>VT zJ7J)85gD!nk9reF>D9^%93dg#w8{$_{dwZ0VebnNvUR9Eaku2f9i{JI+fWu%Gdo+u zWGj8j?X*W$-m_}`I*I)}ZWt{B8*j7H>`+0+CKdd?%~|6_HM1fIqqld!{Th`gLj|T+ zPGwpSi9hxBZPJb+@Rl#m7ALHniEJkrz^hiHB+NX*ZXE>YFGANJ3}qYbGd__fpvdQ? z9B*VQf{)_UgOr6jP$`N)(muFqg(ci}8SKok^D+o$p>1%4^1MUM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{r-}6AqZl>!+n)iEZc&HHLyc0*k&XodpV(pzgY5{wl zEsNwP|H`rp9$i{n{!r4GF5JfTS55MbFyrydF8N2hHRO0W8;q+L&RH8P8cMh`eh6`j zu=7}sJtnlQG9|#h`+|T=gR)OY>$1Si6jMRdH7AD;%;UdBI>>iiE!Hh3guD6`bAK$E*l-hlg71q$qQT&_HUp zmKQ2GfXbPMJ6Y_=>&8WPp(&Cv_$JZFeN{I)%zV$8sh6jUzAFFV!{U%P;yGU)E-y;o z-PxI!F?gu1K)1{^%i-h=U(=Rnd^xy0qo-VJmWe^|GW%t1aisV_8OA5pQgkRf9{uXdWKLPF#|`&vFd^t{eOu1w`RNz@O_cI4UrePNCfyInaQ*LzOW;^ITM-2fBSdav;8VBjU6)Y zTgY!U2N_b6=GP&~#O9N>{1)_E{zL{{q5CD!Pg5p?63;C%9pfD9|L``?%*36^{&AmB7aMnvjAKtL36LGzL5AK*X8Vasv= 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