INT-1380 added helloworld example

This commit is contained in:
Oleg Zhurakousky
2010-09-16 15:51:09 -04:00
parent 1318801abc
commit d8740280ab
14 changed files with 57 additions and 112 deletions

View File

@@ -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<String>("World"));
System.out.println("==> HelloWorldDemo: " + outputChannel.receive(0).getPayload());
logger.info("==> HelloWorldDemo: " + outputChannel.receive(0).getPayload());
}
}

View File

@@ -15,8 +15,8 @@
<level value="warn" />
</logger>
<logger name="org.springframework.integration">
<level value="warn" />
<logger name="org.springframework.integration.samples">
<level value="debug" />
</logger>
<!-- Root Logger -->