}
for (ModelTestSuite modelSuite: jsWrapper.getModelTestSuites()) {
GenericDelegator testDelegator = modelSuite.getDelegator();
TestSuite suite = modelSuite.makeTestSuite();
JUnitTest test = new JUnitTest();
test.setName(suite.getName());
// create the XML logger
JunitXmlListener xml;
try {
xml = new JunitXmlListener(new FileOutputStream(logDir + suite.getName() + ".xml"));
} catch (FileNotFoundException e) {
throw new ContainerException(e);
}
// per-suite results
TestResult results = new TestResult();
results.addListener(new JunitListener());
results.addListener(xml);
// add the suite to the xml listener
xml.startTestSuite(test);
// run the tests
suite.run(results);
test.setCounts(results.runCount(), results.failureCount(), results.errorCount());
// rollback all entity operations performed by the delegator
testDelegator.rollback();
xml.endTestSuite(test);
// display the results