final QName B = new QName("b");
final QName C = new QName("c");
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());
}