@Test
public void showMaxCore() throws Exception {
// Define a file to store tests run history
File maxCoreFile = new File("junit-maxcore-history.max");
// Load previous test runs informations
MaxCore maxCoreTestPrevisousRun = MaxCore.storedLocally(maxCoreFile);
// Display previous tests run informations
System.out.println("**** PREVIOUS RUN INFOS ****");
for (Map.Entry<String, Long> testData : maxCoreTestPrevisousRun.fHistory.fDurations.entrySet()) {
System.out.printf("=> Test '%s' - Duration '%s' ms\n", testData.getKey(), testData.getValue());
}
// Run tests using the MaxCore in order to obtains tests run history
// informations saved to the file
System.out.println("**** NEW RUN ****");
Result result = maxCoreTestPrevisousRun.run(TestProcessingBean.class);
System.out.println("**** NEW RUN INFOS ****");
System.out.printf("%s Test executed in %s ms\n", result.getRunCount(), result.getRunTime());
System.out.printf("%s Test ignored\n", result.getIgnoreCount());
System.out.printf("%s Test failed\n", result.getFailureCount());
maxCoreTestPrevisousRun.fHistory.save();