public OutputValidator runMethodPattern(String projectName, String... goals) { SurefireLauncher launcher = unpack(projectName); for (String goal : goals) { launcher.addGoal(goal); } return launcher.executeTest().assertTestSuiteResults(2, 0, 0, 0); }
@Test public void testReportWithoutAggregate() throws Exception { SurefireLauncher surefireLauncher = unpack().failNever(); surefireLauncher.executeTest(); surefireLauncher.reset(); surefireLauncher.executeSurefireReport(); OutputValidator module1 = surefireLauncher.getSubProjectValidator("module1"); TestFile siteFile = module1.getSiteFile("surefire-report.html"); siteFile.assertContainsText("MyModule1ClassTest"); siteFile.assertContainsText("MyDummyClassM1Test"); }
@Test public void testReportWithAggregate() throws Exception { SurefireLauncher surefireLauncher = unpack().failNever(); surefireLauncher.executeTest(); surefireLauncher.addGoal("-Daggregate=true"); OutputValidator validator = surefireLauncher.executeSurefireReport(); TestFile siteFile = validator.getSiteFile("surefire-report.html"); siteFile.assertContainsText("MyModule1ClassTest"); siteFile.assertContainsText("MyModule2ClassTest"); siteFile.assertContainsText("MyDummyClassM1Test"); }