Package org.servicemix.jbi.container

Examples of org.servicemix.jbi.container.JBIContainer


*/
public class AdminServiceTest extends TestCase {
    JBIContainer container;

    protected void setUp() throws Exception {
      container = new JBIContainer();
      container.setCreateMBeanServer(true);
      container.init();
    }
View Full Code Here


*/
public class ManagementAttributesTest extends TestCase {
    JBIContainer container;

    protected void setUp() throws Exception {
        container = new JBIContainer();
        container.setCreateMBeanServer(true);
        container.init();
        container.start();
    }
View Full Code Here

import junit.framework.TestCase;

public class BrokerTest extends TestCase {
   
    public void testExternalRouting() throws Exception {
        JBIContainer container = new JBIContainer();
        container.init();
        container.start();
        ReceiverComponent receiver = new ReceiverComponent() {
            protected void init() throws JBIException {
                ServiceEndpoint ep = new ExternalEndpoint(getService(), getEndpoint());
                getContext().registerExternalEndpoint(ep);
                setService(null);
                setEndpoint(null);
            }

            public ServiceEndpoint resolveEndpointReference(DocumentFragment fragment) {
                try {
                    SourceTransformer st = new SourceTransformer();
                    String xml = st.toString(fragment);
                    return (ServiceEndpoint) new XStream(new DomDriver()).fromXML(xml);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        };
        container.activateComponent(new ActivationSpec("receiver", receiver));
        ServiceMixClient client = new DefaultServiceMixClient(container);
        ServiceEndpoint[] endpoints = client.getContext().getExternalEndpoints(null);
        assertNotNull(endpoints);
        assertEquals(1, endpoints.length);
        assertNull(client.getContext().getEndpointDescriptor(endpoints[0]));
View Full Code Here

    }
  }
 
  public void setUp() throws Exception {
    // Create jbi container
    container = new JBIContainer();
    container.setFlowName("st");
    container.init();
    container.start();
    // Create components
    provider = new TestComponent(new QName("provider"), "endpoint");
View Full Code Here

  public void testSedaSeda() throws Exception {
    runTest("seda", "seda");
  }
 
  private void runTest(String flowName, String subscriptionFlowName) throws Exception {
    JBIContainer container = new JBIContainer();
    try {
      container.getBroker().setFlow(FlowProvider.getFlow(flowName));
      if (subscriptionFlowName != null) {
        container.getBroker().getSubscriptionManager().setFlow(FlowProvider.getFlow(subscriptionFlowName));
      }
            // TODO: check why the following line is enabled, there is
            // a 5 seconds pause when Management stuff is initialized
      //container.setCreateMBeanServer(true);
      container.init();
      container.start();
     
      Sender sender = new SenderComponent();
            ActivationSpec senderActivationSpec = new ActivationSpec("sender", sender);
            senderActivationSpec.setFailIfNoDestinationEndpoint(false);
            container.activateComponent(senderActivationSpec);
     
      ReceiverListener receiver1 = new ReceiverListener();
      container.activateComponent(createReceiverAS("receiver1", receiver1));
 
      ReceiverListener receiver2 = new ReceiverListener();
      container.activateComponent(createReceiverAS("receiver2", receiver2));
     
      sender.sendMessages(1);
     
      Thread.sleep(100);
     
            assertFalse(receiver1.isPropertySetOnExchange());
            assertFalse(receiver2.isPropertySetOnExchange());
            assertFalse(receiver1.isPropertySetOnMessage());
            assertFalse(receiver2.isPropertySetOnMessage());
    } finally {
      container.shutDown();
    }
  }
View Full Code Here

        tm = (TransactionManager) gtmfb.getObject();
        tt = new TransactionTemplate(new JtaTransactionManager((UserTransaction) tm));
    }
   
    protected JBIContainer createJbiContainer(String name) throws Exception {
      JBIContainer container = new JBIContainer();
        container.setTransactionManager(tm);
        container.setName(name);
        container.setFlow(createFlow());
        container.setAutoEnlistInTransaction(true);
        container.setMonitorInstallationDirectory(false);
        container.init();
        container.start();
        return container;
    }
View Full Code Here

TOP

Related Classes of org.servicemix.jbi.container.JBIContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.