YOUR FEEDBACK
NJ Castro wrote: I would love to have a stay in that yacht. It looks quite expensive but its worth it with all the great designs and unique style. ...


ADS BY GOOGLE
YV&C CURRENT ISSUE


YV&C RECOMMENDED YACHT CHARTER LINKS



ESB Testing Strategies with Mule
Will it break anything?

To be able to do anything useful, an ESB must be configured with all sorts of parameters, from endpoint connection URIs to message transformation scripts to content-based routing definitions. Moreover, ESBs like Mule can host custom components, which will process messages and perform user-specific actions on them.

Deploying a new version of an ESB configuration raises the question of whether it will break anything. How can we build confidence that everything will be just fine? If unit testing did it for standard software development, what can it do in the realm of the ESB? Since ESBs are becoming increasingly familiar in corporate IT, getting concrete answers is of interest to more and more people.

This article details the testing strategies I employ for Mule ESB-driven projects, which I think contain elements that could be generalized to other platforms. I am certain that readers will have strategies of their own and I welcome their comments. I am also convinced that ESB vendors have their own approaches, sometimes generic, often proprietary, and that they are worth following if you use their tool. This article does not cover the subject of SOA testing strategies, which is already thoroughly discussed in the industry.

Level One: Unit Testing - Components and Transformers
Whether they are compiled or scripted, components can easily be unit tested. Provided they have been correctly initialized, unit testing them amounts to receiving an expected response for a known input. Correctly initializing a component consists of calling its lifecycle methods, if any, for compiled ones or establishing the correct environment context for scripted ones. Some components are more complex in the sense that they can be aware of the event context in which they process a message payload or need to connect to other end points. Mule's ESB functional test library (mule-tests-functional-xyz.jar) offers a variety of helpers, mostly in the form of subclasses of JUnit TestCase to establish test event context or temporary end points, which let us test this kind of component thoroughly. For example, here is an example for testing an event-aware component:

import org.mule.impl.RequestContext;
import org.mule.tck.AbstractMuleTestCase;
public class EventAwareComponentTestCase extends AbstractMuleTestCase {
protected static final String TEST_PAYLOAD = "test.foo.payload";
public EventAwareComponentTestCase() {
super();
}
@Override
protected void doSetUp() throws Exception {
RequestContext.setEvent(getTestEvent(TEST_PAYLOAD));
}
@Override
protected void doTearDown() throws Exception {
RequestContext.setEvent(null);
}
}

Transformers are very similar to components as far as testing is concerned. For the ones that are unaware of their ESB context, unit testing is straightforward; for others, Mule testing tools will come in handy. Note that at this level, it is the transformer that is tested and not how well its configuration makes the expected transformation on a particular message (this is discussed later).

About David Dossot
David Dossot is a software architect with Fiver Media, a company that provides services to a major international digital entertainment group. He is the project despot of the Mule JCR transport and project lead of NxBRE, a business rules engine for the .NET platform.

SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS !
Receive Breaking Yacht Charters News as it Happens...
Yacht Charter Newsletter
Jet Charter Newsletter
 
SuperYacht Newsletter
SuperYacht Conference
Your E-Mail: 
State: 
Zip Code: 




Type the characters you see in this picture (lower case):   


YV&C RECOMMENDED YACHT CHARTER LINKS

ADS BY GOOGLE
LATEST YV&C STORIES
This boat has a comprehensive Passport Premire Warranty good into 2012. This 58 Sedan only has 195 hours of use on her optional 900 MAN engines. The engines and generator were just dealer serviced! She is truly turn key. Ready to be enjoyed with options like the DSS Satellite TV system...
Bostik, currently moored at La Trinité-sur-Mer (Brittany - France) next to the IMOCA 60 Safran, is thus waiting for the gale force 7 to 8 (35 to 45 knots) which should sweep across Brittany at 0000 UTC on Friday 5 September i.e. mid-day this Friday.
The nineteenth edition of the Trophée Clairefontaine of Sailing Champions is being prepared at Valencia (Spain) in the Marina Real Juan Carlos 1st, i.e. inside the harbor which hosted the competitors of the 2007 America’s Cup and more recently the F1 European Grand Prix. The Trophé...
Sure you can reach Mystic, Connecticut, by taking Interstate 95 to Exit 90. But as long as you’re heading for one of the great maritime capitals of the Northeast, why not consider arriving by boat—via the Mystic River? Navigating the twists and turns as you make your way up the win...
M/Y ELIZA JEAN – 34.95m (114’08”) Benetti Built 2003. Selling Agent: Antoine Larricq of Fraser Yachts, Monaco and Neal Esterly of Fraser Yachts, San Diego .
The 2008 Marine Aftermarket Accessories Trade Show (MAATS), held July 16-18, wrapped up another productive event, attracting 1,833 attendees to the Las Vegas Hilton Hotel & Convention Center. This represents a slight decrease in attendance from the previous year. This year, 293 exhibit...

YV&C RECOMMENDED YACHT CHARTER LINKS

ADS BY GOOGLE