Package org.mule.expression.transformers

Examples of org.mule.expression.transformers.BeanBuilderTransformer


    }

    public void testBeanBuilderTransformerConfig() throws Exception
    {
        BeanBuilderTransformer transformer = (BeanBuilderTransformer) muleContext.getRegistry().lookupTransformer("testTransformer3");
        assertNotNull(transformer);
        assertNotNull(transformer.getArguments());
        assertEquals(3, transformer.getArguments().size());
        ExpressionArgument arg1 = transformer.getArguments().get(0);
        assertEquals("brand", arg1.getName());
        assertEquals("mule", arg1.getEvaluator());
        assertEquals("message.payload", arg1.getExpression());
        assertFalse(arg1.isOptional());

        ExpressionArgument arg2 = transformer.getArguments().get(1);
        assertEquals("segments", arg2.getName());
        assertEquals("mule", arg2.getEvaluator());
        assertEquals("message.header(SEGMENTS)", arg2.getExpression());
        assertTrue(arg2.isOptional());
View Full Code Here


public class XPathBeanBuilderTestCase extends AbstractTransformerTestCase
{
    public Transformer getTransformer() throws Exception
    {
        BeanBuilderTransformer trans = new BeanBuilderTransformer();
        trans.setMuleContext(muleContext);
        trans.setBeanFactory(new PrototypeObjectFactory(Orange.class));
        trans.addArgument(new ExpressionArgument("brand", new ExpressionConfig("/fruit/orange/@name", "xpath", null), false));
        trans.addArgument(new ExpressionArgument("segments", new ExpressionConfig("/fruit/orange/segments", "xpath", null), false));
        trans.addArgument(new ExpressionArgument("radius", new ExpressionConfig("/fruit/orange/radius", "xpath", null), false));
        trans.initialise();
        return trans;
    }
View Full Code Here

public class BeanBuilderTestCase extends AbstractTransformerTestCase
{
    public Transformer getTransformer() throws Exception
    {
        BeanBuilderTransformer trans = new BeanBuilderTransformer();
        trans.setMuleContext(muleContext);
        PrototypeObjectFactory factory = new PrototypeObjectFactory(Orange.class);
        muleContext.getRegistry().applyProcessorsAndLifecycle(factory);
        trans.setBeanFactory(factory);
        trans.addArgument(new ExpressionArgument("brand", new ExpressionConfig("", "payload", null), false));
        trans.addArgument(new ExpressionArgument("segments", new ExpressionConfig("segments", "header", null), false));
        trans.addArgument(new ExpressionArgument("radius", new ExpressionConfig("radius", "header", null), false));
        trans.initialise();
        return trans;
    }
View Full Code Here

public class XPathBeanBuilderTestCase extends AbstractTransformerTestCase
{
    public Transformer getTransformer() throws Exception
    {
        BeanBuilderTransformer trans = new BeanBuilderTransformer();
        trans.setMuleContext(muleContext);
        trans.setBeanFactory(new PrototypeObjectFactory(Orange.class));
        trans.addArgument(new ExpressionArgument("brand", new ExpressionConfig("/fruit/orange/@name", "xpath", null), false));
        trans.addArgument(new ExpressionArgument("segments", new ExpressionConfig("/fruit/orange/segments", "xpath", null), false));
        trans.addArgument(new ExpressionArgument("radius", new ExpressionConfig("/fruit/orange/radius", "xpath", null), false));
        trans.initialise();
        return trans;
    }
View Full Code Here

public class BeanBuilderTestCase extends AbstractTransformerTestCase
{
    public Transformer getTransformer() throws Exception
    {
        BeanBuilderTransformer trans = new BeanBuilderTransformer();
        trans.setMuleContext(muleContext);
        PrototypeObjectFactory factory = new PrototypeObjectFactory(Orange.class);
        muleContext.getRegistry().applyProcessorsAndLifecycle(factory);
        trans.setBeanFactory(factory);
        trans.addArgument(new ExpressionArgument("brand", new ExpressionConfig("", "payload", null), false));
        trans.addArgument(new ExpressionArgument("segments", new ExpressionConfig("segments", "header", null), false));
        trans.addArgument(new ExpressionArgument("radius", new ExpressionConfig("radius", "header", null), false));
        trans.initialise();
        return trans;
    }
View Full Code Here

        testBeanBuilderTransformerConfig("testTransformer3");
    }

    private void testBeanBuilderTransformerConfig(String name) throws Exception
    {
        BeanBuilderTransformer transformer = (BeanBuilderTransformer) muleContext.getRegistry()
            .lookupTransformer(name);
        assertNotNull(transformer);
        assertNotNull(transformer.getArguments());
        assertEquals(3, transformer.getArguments().size());
        ExpressionArgument arg1 = transformer.getArguments().get(0);
        assertEquals("brand", arg1.getName());
        assertNull(arg1.getEvaluator());
        assertEquals("payload", arg1.getExpression());
        assertFalse(arg1.isOptional());

        ExpressionArgument arg2 = transformer.getArguments().get(1);
        assertEquals("segments", arg2.getName());
        assertNull(arg2.getEvaluator());
        assertEquals("message.outboundProperties['SEGMENTS']", arg2.getExpression());
        assertTrue(arg2.isOptional());
    }
View Full Code Here

        testBeanBuilderTransformerConfig("testTransformer3Inline");
    }

    private void testBeanBuilderTransformerConfig(String transformerName) throws Exception
    {
        BeanBuilderTransformer transformer = (BeanBuilderTransformer) muleContext.getRegistry().lookupTransformer(transformerName);
        assertNotNull(transformer);
        assertNotNull(transformer.getArguments());
        assertEquals(3, transformer.getArguments().size());
        ExpressionArgument arg1 = transformer.getArguments().get(0);
        assertEquals("brand", arg1.getName());
        assertEquals("message", arg1.getEvaluator());
        assertEquals("payload", arg1.getExpression());
        assertFalse(arg1.isOptional());

        ExpressionArgument arg2 = transformer.getArguments().get(1);
        assertEquals("segments", arg2.getName());
        assertEquals("header", arg2.getEvaluator());
        assertEquals("SEGMENTS", arg2.getExpression());
        assertTrue(arg2.isOptional());
    }
View Full Code Here

TOP

Related Classes of org.mule.expression.transformers.BeanBuilderTransformer

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.