1 17 package org.apache.servicemix.components.script; 18 19 import java.util.List ; 20 21 import org.apache.servicemix.components.script.ScriptComponent; 22 import org.apache.servicemix.tck.Sender; 23 import org.springframework.context.support.AbstractXmlApplicationContext; 24 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; 25 26 29 public class ScriptTest extends org.apache.servicemix.tck.SpringTestSupport { 30 private static List result; 31 32 public static List getResult() { 33 return result; 34 } 35 36 public static void setResult(List result) { 37 ScriptTest.result = result; 38 } 39 40 public void testSendingAndReceivingMessagesUsingSpring() throws Exception { 41 Sender sender = (Sender) getBean("sender"); 42 assertNotNull(sender); 43 ScriptComponent component = (ScriptComponent) getBean("receiver"); 44 assertNotNull(component); 45 sender.sendMessages(1); 46 47 List result = getResult(); 48 assertNotNull("Have not received any results from groovy!", result); 49 System.out.println("Found results: " + result); 50 } 51 52 protected AbstractXmlApplicationContext createBeanFactory() { 53 return new ClassPathXmlApplicationContext("org/apache/servicemix/components/script/spring-groovy.xml"); 54 } 55 } 56 | Popular Tags |