1 17 package org.apache.servicemix.tck; 18 19 import org.apache.servicemix.jbi.container.ActivationSpec; 20 import org.apache.servicemix.jbi.container.JBIContainer; 21 import org.apache.servicemix.jbi.resolver.ServiceNameEndpointResolver; 22 import org.apache.servicemix.tck.ReceiverComponent; 23 import org.apache.servicemix.tck.SenderComponent; 24 25 import junit.framework.TestCase; 26 27 30 public class ExamplePojoTest extends TestCase { 31 protected JBIContainer container = new JBIContainer(); 32 private SenderComponent sender; 33 private ReceiverComponent receiver; 34 protected int NUM_MESSAGES = 10; 35 36 public void testInOnly() throws Exception { 37 sender.sendMessages(NUM_MESSAGES); 38 receiver.getMessageList().assertMessagesReceived(NUM_MESSAGES); 39 } 40 41 protected void setUp() throws Exception { 42 container.setEmbedded(true); 43 container.init(); 44 container.start(); 45 receiver = new ReceiverComponent(); 46 sender = new SenderComponent(); 47 sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE)); 48 49 container.activateComponent(new ActivationSpec("sender", sender)); 50 container.activateComponent(new ActivationSpec("receiver", receiver)); 51 } 52 53 protected void tearDown() throws Exception { 54 container.shutDown(); 55 } 56 } 57 | Popular Tags |