Package org.mule.el.mvel

Examples of org.mule.el.mvel.MVELExpressionLanguage


    }

    @Override
    public void initialise() throws InitialisationException
    {
        MVELExpressionLanguage mel = new MVELExpressionLanguage(muleContext);
        mel.initialise();
        expressionLanguage = mel;
    }
View Full Code Here


        });
    }

    protected ExpressionLanguage getExpressionLanguage() throws Exception
    {
        return new MVELExpressionLanguage(muleContext);
    }
View Full Code Here

    }

    @Override
    protected ExpressionLanguage getExpressionLanguage() throws RegistrationException
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        return mvel;
    }
View Full Code Here

    }

    @Test
    public void testShortcutVariable() throws RegistrationException, InitialisationException
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        mvel.initialise();

        Assert.assertEquals(muleContext.getConfiguration().getId(), mvel.evaluate("appShortcut.name"));
    }
View Full Code Here

    }

    @Test
    public void testVariableAlias() throws RegistrationException, InitialisationException
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        mvel.initialise();

        MuleMessage message = new DefaultMuleMessage("foo", muleContext);

        Assert.assertEquals("foo", mvel.evaluate("p", message));
    }
View Full Code Here

    }

    @Test
    public void testAssignValueToVariableAlias() throws RegistrationException, InitialisationException
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        mvel.initialise();

        MuleMessage message = new DefaultMuleMessage("foo", muleContext);

        mvel.evaluate("p='bar'", message);
        Assert.assertEquals("bar", message.getPayload());
    }
View Full Code Here

    }

    @Test
    public void testMuleMessageAvailableAsVariable() throws Exception
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        mvel.initialise();

        MuleMessage message = new DefaultMuleMessage("foo", muleContext);
        mvel.evaluate("p=m.uniqueId",message);
        Assert.assertEquals(message.getUniqueId(),message.getPayload());
    }
View Full Code Here

    }

    @Test
    public void testFunction() throws RegistrationException, InitialisationException
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        mvel.initialise();

        Assert.assertEquals("called param[0]=one,param[1]=two,app.name="
                            + muleContext.getConfiguration().getId(), mvel.evaluate("f('one','two')"));
    }
View Full Code Here

    }

    @Test
    public void testMuleContextAvailableInFunction() throws RegistrationException, InitialisationException
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        mvel.initialise();

        Assert.assertEquals(muleContext, mvel.evaluate("muleContext()"));
    }
View Full Code Here

    }

    @Test
    public void testMuleMessageAvailableInFunction() throws RegistrationException, InitialisationException
    {
        MVELExpressionLanguage mvel = new MVELExpressionLanguage(muleContext);
        mvel.initialise();
        MuleMessage message = Mockito.mock(MuleMessage.class);

        Assert.assertEquals(message, mvel.evaluate("muleMessage()", message));
    }
View Full Code Here

TOP

Related Classes of org.mule.el.mvel.MVELExpressionLanguage

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.