Package org.switchyard.internal

Examples of org.switchyard.internal.DefaultMessage


                + "<nn:body>I love lasagna!</nn:body>"
                + "</nn:memo>";

        boolean flag = false;
        try {
            ValidationResult result = validator.validate(new DefaultMessage().setContent(source));
        } catch (Exception fnfe) {
            flag = true;
        }
        if (!flag) {
            Assert.fail("Somehow found DTD that we should not have.");
View Full Code Here


        final QName D = new QName("d");
       
        BaseTransformerRegistry xformReg = new BaseTransformerRegistry();
        TransformSequence transSequence = TransformSequence.from(A).to(B).to(C).to(D);

        DefaultMessage message = new DefaultMessage().setContent(A);

        // Apply transform sequence ... no relevant transformers in the reg... nothing should
        // happen i.e. content should still be "a"...
        transSequence.apply(message, xformReg);
        Assert.assertEquals(A, message.getContent());

        // Add just th "a" to "b" transformer... run again... should transform to "b", but no further...
        xformReg.addTransformer(new MockTransformer(A, B));
        transSequence.apply(message, xformReg);
        Assert.assertEquals(B, message.getContent());

        // Add the rest of the transforms now... should transform the last steps in one go...
        xformReg.addTransformer(new MockTransformer(B, C)).addTransformer(new MockTransformer(C, D));
        transSequence.apply(message, xformReg);
        Assert.assertEquals(D, message.getContent());
    }
View Full Code Here

        BaseTransformerRegistry _registry = new BaseTransformerRegistry();
        _registry.addTransformer(new TestTransformer2(A, B));
        _registry.addTransformer(new TestTransformer2(B, C));
       
        TransformSequence transformSequence = _registry.getTransformSequence(A, C);
        DefaultMessage message = new DefaultMessage().setContent(A);
        transformSequence.apply(message, _registry);
        Assert.assertEquals(C, message.getContent());     
    }
View Full Code Here

public class InvocationFaultExceptionTest {

    @Test
    public void testTypeMatchesException() {
        InvocationFaultException infEx = new InvocationFaultException(
                new DefaultMessage().setContent(new DummyException()));
        Assert.assertTrue(infEx.isType(DummyException.class));
    }
View Full Code Here

    }

    @Test
    public void testTypeMatchesObject() {
        InvocationFaultException infEx = new InvocationFaultException(
                new DefaultMessage().setContent(new DummyObject()));
        Assert.assertTrue(infEx.isType(DummyObject.class));
    }
View Full Code Here

    }
   
    @Test
    public void testGetCauseMatchesFault() {
        DummyException testEx = new DummyException();
        InvocationFaultException infEx = new InvocationFaultException(new DefaultMessage().setContent(testEx));
        Assert.assertEquals(testEx, infEx.getCause());
    }
View Full Code Here

TOP

Related Classes of org.switchyard.internal.DefaultMessage

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.