Package org.mule.client

Examples of org.mule.client.DefaultLocalMuleClient$MuleClientFlowConstruct


        muleContext.setLifecycleManager(injectMuleContextIfRequired(getLifecycleManager(), muleContext));
        muleContext.setExpressionManager(injectMuleContextIfRequired(new DefaultExpressionManager(),muleContext));
        DefaultRegistryBroker registryBroker = new DefaultRegistryBroker(muleContext);
        muleContext.setRegistryBroker(registryBroker);
        muleContext.setMuleRegistry(new MuleRegistryHelper(registryBroker, muleContext));
        muleContext.setLocalMuleClient(new DefaultLocalMuleClient(muleContext));
        muleContext.setExceptionListener(new DefaultSystemExceptionStrategy(muleContext));
        muleContext.setExecutionClassLoader(Thread.currentThread().getContextClassLoader());
        return muleContext;
    }
View Full Code Here


        testVM("vm://default-attributes");
    }

    protected void testVM(String endpoint) throws Exception
    {
        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);

        HashMap<String, Object> props = new HashMap<String,Object>();
        props.put("username", "ross");
        props.put("password", "ross");
        MuleMessage result = client.send(endpoint, "hi", props);
        assertNull(result.getExceptionPayload());

        props.put("password", "badpass");
        MuleMessage result2 = client.send(endpoint, "hi", props);
        assertNotNull(result2);
        assertNotNull(result2.getExceptionPayload());
        assertEquals(UnauthorisedException.class, result2.getExceptionPayload().getException().getClass());

    }
View Full Code Here

        DefaultMuleMessage message = new DefaultMuleMessage("hello", muleContext);
        message.setOutboundProperty("host", "localhost");
        message.setOutboundProperty("port", port1.getNumber());
        message.setOutboundProperty("path", "/TEST");

        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);
        MuleMessage response = client.send("vm://vmProxy", message);
        assertEquals("hello Received", response.getPayloadAsString());

        response = client.request("vm://vmOut", 5000);
        assertNotNull(response);
    }
View Full Code Here

    }

    @Test
    public void testOutboundAutenticationSend() throws Exception
    {
        DefaultLocalMuleClient client = new DefaultLocalMuleClient(muleContext);

        HashMap<String, Object> props = new HashMap<String, Object>();
        props.put("username", "ross");
        props.put("pass", "ross");
        MuleMessage result = client.send("vm://test", "hi", props);
        assertNull(result.getExceptionPayload());

        props.put("pass", "badpass");

        MuleMessage resultMessage = client.send("vm://test", "hi", props);
        assertNotNull(resultMessage);
        assertNotNull(resultMessage.getExceptionPayload());
        assertEquals(BadCredentialsException.class, resultMessage.getExceptionPayload()
            .getRootException()
            .getClass());
View Full Code Here

        //there is no point having this object configurable
        this.expressionManager = new DefaultExpressionManager();
        ((MuleContextAware) this.expressionManager).setMuleContext(this);
        registryBroker = createRegistryBroker();
        muleRegistryHelper = createRegistryHelper(registryBroker);
        localMuleClient = new DefaultLocalMuleClient(this);
        exceptionListener = new DefaultSystemExceptionStrategy(this);
    }
View Full Code Here

    }

    @Test
    public void testOutboundResponseTimeoutSet() throws Exception
    {
        final MuleClient client = new DefaultLocalMuleClient(muleContext);

        final MuleMessage result = client.send("vm://testIn", TEST_MESSAGE, null);

        assertEquals(NullPayload.getInstance(), result.getPayload());
    }
View Full Code Here

TOP

Related Classes of org.mule.client.DefaultLocalMuleClient$MuleClientFlowConstruct

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.