Package org.jboss.soa.esb.testutils

Examples of org.jboss.soa.esb.testutils.ESBConfigUtil


    public void test120() throws ConfigurationException, IOException, SAXException {
        executeTest("jboss-esb.120.xml");
    }

    private void executeTest(final String config) throws ConfigurationException, IOException, SAXException {
        ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream(config));

        assertTrue(configUtil.getListenerConfig("JMS-ESBListener").toString().startsWith("<listener busIdRef=\"OrderManagerService\" listenerClass=\"org.jboss.soa.esb.listeners.message.MessageAwareListener\" maxThreads=\"1\" name=\"JMS-ESBListener\" service-category=\"ABI_OrderManager\" service-description=\"ABI OrderManager Service\" service-name=\"ABI_OrderManager\">"));
        assertTrue(configUtil.getGatewayConfig("FileGateway").toString().startsWith("<listener"));
        assertTrue(configUtil.getActionConfig("OrderNotificationService", "print-after-transform").toString().startsWith("<action action=\"print-after-transform\""));
    }
View Full Code Here


* @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly@jboss.com</a>
*/
public class JBESB_539_UnitTest extends TestCase {

    public void test() throws IOException, SAXException, ConfigurationException {
        ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("config_01.xml"));
        ConfigTree myListenerConfig = configUtil.getGatewayConfig("My Listener");
        ConfigTree yourListenerConfig = configUtil.getGatewayConfig("Your Listener");

        assertNotNull(myListenerConfig);
        assertEquals("My Listener", myListenerConfig.getAttribute("name"));
        assertNotNull(yourListenerConfig);
        assertEquals("Your Listener", yourListenerConfig.getAttribute("name"));
View Full Code Here

        testRunner.run();
    }

    public void test_JBESB_1865() throws Exception {
        ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("in-listener-config-JBESB-1865.xml"));

        String maxThreads = configUtil.getListenerConfig("InVM-0").getAttribute(ListenerTagNames.MAX_THREADS_TAG);
        assertEquals("10", maxThreads);
    }
View Full Code Here

        testRunner.run();
    }

    public void test_none_scoped() throws ManagedLifecycleException, SAXException, ParamRepositoryException, MessageDeliverException, IOException {
        try {
            new ESBConfigUtil(getClass().getResourceAsStream("in-listener-config-02.xml"));
            fail("Expected ConfigurationException");
        } catch (ConfigurationException e) {
            assertEquals("Service 'ServiceCat:ServiceName' does not define a Message-Aware (is-gateway='false') nor InVm Listener.", e.getMessage());
        }
    }
View Full Code Here

*/
public class ScheduledListenerUnitTest {
 
  @Test
    public void test() throws IOException, SAXException, ConfigurationException, ParserConfigurationException {
      ESBConfigUtil configUtil = new ESBConfigUtil(ScheduledListenerUnitTest.class.getResourceAsStream("scheduled-listener-config.xml"));
        String actualListenerConfig = configUtil.getListenerConfig("simple-schedule-listener").toXml();
        String expectedListenerConfig = StreamUtils.readStreamString(getClass().getResourceAsStream("scheduled-listener-config-configtree.xml"), "UTF-8");

        assertTrue("Service configuration", XMLHelper.compareXMLContent(expectedListenerConfig, actualListenerConfig));
    }
View Full Code Here

        assertEquals("http://a", nsContext.getNamespaceURI("a"));
        assertEquals("http://b", nsContext.getNamespaceURI("b"));
    }

    private NamespaceContext test(String configName) throws MessageRouterException, IOException, SAXException, ConfigurationException {
        ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("config.xml"));
        ConfigTree configTree = esbConfig.getActionConfig("null-listener", configName);
        SxcXPathRouter router = new SxcXPathRouter();

        router.setConfigTree(configTree);
       
        Map<String, RoutingRule> map = router.getRoutingMap();
View Full Code Here

        message.getBody().add("y", GREEN_MESSAGE);       
        test_routing(message, Arrays.asList(GREEN_MESSAGE));
    }

    public void test_routing(Message message, List objectLists) throws IOException, SAXException, ConfigurationException, MessageRouterException {
        ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("config.xml"));
        ConfigTree configTree = esbConfig.getActionConfig("null-listener", "5");
        SxcXPathRouter router = new SxcXPathRouter();

        router.setConfigTree(configTree);

        List<String> destinations = router.route(null, false, message, objectLists);
View Full Code Here

    public void test_inlineRules() throws IOException, SAXException, ConfigurationException, MessageRouterException {
        test("3");
    }

    private void test(String configName) throws MessageRouterException, IOException, SAXException, ConfigurationException {
        ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("config.xml"));
        ConfigTree configTree = esbConfig.getActionConfig("null-listener", configName);
        RegexRouter router = new RegexRouter();

        router.setConfigTree(configTree);

        Map<String, RoutingRule> map = router.getRoutingMap();
View Full Code Here

        message.getBody().add("y", GREEN_MESSAGE);
        test_routing(message, Arrays.asList(GREEN_MESSAGE));
    }

    public void test_routing(Message message, List objectLists) throws IOException, SAXException, ConfigurationException, MessageRouterException {
        ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("config.xml"));
        ConfigTree configTree = esbConfig.getActionConfig("null-listener", "3");
        RegexRouter router = new RegexRouter();

        router.setConfigTree(configTree);

        List<String> destinations = router.route(null, false, message, objectLists);
View Full Code Here

        MockScheduledEventListener.reset();
        MockAction.message = null;
    }

    public void test_listener_config() throws IOException, SAXException, ConfigurationException, ParserConfigurationException {
        ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("config-01.xml"));
        String expected = StreamUtils.readStreamString(getClass().getResourceAsStream("expected-config-01-listener.xml"), "UTF-8");

        assertTrue("Service Config", XMLHelper.compareXMLContent(expected, configUtil.getListenerConfig("simple-schedule-listener").toString()));
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.testutils.ESBConfigUtil

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.