Hi, good evening.
As everyone may have seen, when you open the helloworld proyect from the spring-integration-by-example;
in the example they donīt use annotations so when the call the spring context they put:
But, what if Iīm using annotations to load the context, like this:Code:AbstractApplicationContext context = new ClassPathXmlApplicationContext( "/META-INF/spring/integration/helloWorldDemo.xml", HelloWorldApp.class); MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class); PollableChannel outputChannel = context.getBean("outputChannel", PollableChannel.class); inputChannel.send(new GenericMessage<String>("World")); logger.info("==> HelloWorldDemo: " + outputChannel.receive(0).getPayload());
and in "myMethod" I want to do something like:Code:@ContextConfiguration(locations = { "classpath:envio-test-config.xml" }) public class EnvioTests extends AbstractTestNGSpringContextTests { @Test public void myMethod() { } }
what would be itīs equivalent when using annotations??Code:PollableChannel outputChannel = context.getBean("outputChannel", PollableChannel.class); inputChannel.send(new GenericMessage<String>("World")); logger.info("==> HelloWorldDemo: " + outputChannel.receive(0).getPayload());
Thanks in advance.


Reply With Quote
