// - unpack the expected output archive
this.unpack(
expectedOutputArchive,
new File(this.expectedDirectory));
final CartridgeTest cartridgeTest = CartridgeTest.instance();
cartridgeTest.setActualOutputPath(this.actualDirectory);
cartridgeTest.setExpectedOutputPath(this.expectedDirectory);
cartridgeTest.setBinarySuffixes(this.binaryOutputSuffixes);
final CartridgeTestFormatter formatter = new CartridgeTestFormatter();
// - set the report location
final File report = new File(this.reportDirectory, this.project.getArtifactId() + ".txt");
formatter.setReportFile(report);
final TestResult result = new TestResult();
result.addListener(formatter);
final Test suite = CartridgeTest.suite();
formatter.startTestSuite(this.project.getName());
suite.run(result);
this.getLog().info("");
this.getLog().info("Results:");
this.getLog().info(formatter.endTestSuite(suite));
cartridgeTest.shutdown();
if (result.failureCount() > 0 || result.errorCount() > 0)
{
throw new MojoExecutionException("Test are some test failures");
}
}