protected void assertSenderConfig(String config) throws Exception {
  context=new ClassPathXmlApplicationContext(config);
  consumer=(SpringConsumer)context.getBean("consumer");
  assertTrue("Found a valid consumer",consumer != null);
  consumer.start();
  producer=(SpringProducer)context.getBean("producer");
  assertTrue("Found a valid producer",producer != null);
  consumer.flushMessages();
  producer.start();
  consumer.waitForMessagesToArrive(producer.getMessageCount());
  List<Message> messages=consumer.flushMessages();
  LOG.info("Consumer has received messages....");
  for (  Message message : messages) {
    LOG.info("Received: " + message);
  }
  assertEquals("Message count",producer.getMessageCount(),messages.size());
}

protected void assertSenderConfig ( String config ) throws Exception { context = new ClassPathXmlApplicationContext ( config ) ; consumer = ( SpringConsumer ) context . getBean ( "consumer" ) ; assertTrue ( "Found a valid consumer" , consumer != null ) ; consumer . start ( ) ; producer = ( SpringProducer ) context . getBean ( "producer" ) ; assertTrue ( "Found a valid producer" , producer != null ) ; consumer . flushMessages ( ) ; producer . start ( ) ; consumer . waitForMessagesToArrive ( producer . getMessageCount ( ) ) ; List < Message > messages = consumer . flushMessages ( ) ; LOG . info ( "Consumer has received messages...." ) ; for ( Message message : messages ) { LOG . info ( "Received: " + message ) ; } assertEquals ( "Message count" , producer . getMessageCount ( ) , messages . size ( ) ) ; }
assert method that is used by all the test method to send and receive messages based on each spring configuration .
