Package org.switchyard.standalone

Examples of org.switchyard.standalone.SwitchYard


public class SwitchYardTest {

    @Test
    public void getActivators() throws Exception {
        InputStream config = Classes.getResourceAsStream("/switchyard-config-mock-01.xml", getClass());
        SwitchYard sy = new SwitchYard(config);
        config.close();

        Assert.assertEquals(1, sy.getActivatorList().size());
    }
View Full Code Here


    }
   
    @Test
    public void replaceActivator() throws Exception {
        InputStream config = Classes.getResourceAsStream("/switchyard-config-mock-01.xml", getClass());
        SwitchYard sy = new SwitchYard(config);
       
        // Remove the old activator if it exists
        Iterator<Activator> activators = sy.getActivatorList().iterator();
        while (activators.hasNext()) {
            Activator activator = activators.next();
            if (activator.canActivate("mock")) {
                activators.remove();
            }
        }
       
        // Add new activator
        MockActivator mock = new MockActivator();
        sy.getActivatorList().add(mock);
       
        sy.start();
        Assert.assertTrue(mock.activationCalled);
       
        config.close();
    }
View Full Code Here

    }
   
    @Test
    public void customActivatorList() throws Exception {
        InputStream config = Classes.getResourceAsStream("/switchyard-config-mock-01.xml", getClass());
        SwitchYard sy = new SwitchYard(config);
       
        // Add new activator
        MockActivator mock = new MockActivator();
        List<Activator> activatorList = new LinkedList<Activator>();
        activatorList.add(mock);
        sy.setActivatorList(activatorList);
       
        sy.start();
        Assert.assertTrue(mock.activationCalled);
       
        config.close();
    }
View Full Code Here

        ServletContext servletContext = sce.getServletContext();
        InputStream switchYardConfig = servletContext.getResourceAsStream("WEB-INF/classes/" + AbstractDeployment.SWITCHYARD_XML);

        if (switchYardConfig != null) {
            try {
                _switchyard = new SwitchYard(switchYardConfig);
                _switchyard.start();
            } catch (IOException e) {
                _logger.debug("Error deploying SwitchYard within Web Application '" + servletContext.getServletContextName() + "'.  SwitchYard not deployed.", e);
            }
        } else {
View Full Code Here

TOP

Related Classes of org.switchyard.standalone.SwitchYard

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.