/** * Return if a mutation is valid or not. The classes to test as well as the test MUST be in the * loader in the current class loader. * * <p>/*supporter.getProperties().getTestSuiteClassName() * * @param supporter * @return * @throws FileNotFoundException * @throws ClassNotFoundException * @throws InitializationError */ public ProgramVariantValidationResult validateVariantFirstPhases(List<String> failingCases) throws FileNotFoundException, ClassNotFoundException, InitializationError { LogManager.getRootLogger().setLevel(Level.INFO); // OFF JUnitTestExecutor muTestEx = new JUnitTestExecutor(); ProgramVariantValidationResult validation = new ProgramVariantValidationResult(); boolean failing = false; long in1 = System.currentTimeMillis(); // First, failing test cases if (failingCases != null) { // Stats.getCurrentStats().numberOfFailingTestCaseExecution++; for (String failingcase : failingCases) { Result result = muTestEx.runTest(failingcase); if (!result.wasSuccessful()) { failing = true; } validation.addResultTest(result); } } // validation.setResultSuccess(!failing); LogManager.getRootLogger().setLevel(Level.INFO); return validation; }
/** * First execute the ``originals`` failing test case, then carries out a regression testing * * @param supporter * @return * @throws FileNotFoundException * @throws ClassNotFoundException * @throws InitializationError */ public ProgramVariantValidationResult validateVariantTwoPhases(List<String> TestCases) throws FileNotFoundException, ClassNotFoundException, InitializationError { LogManager.getRootLogger().setLevel(Level.INFO); // OFF JUnitTestExecutor muTestEx = new JUnitTestExecutor(); ProgramVariantValidationResult validation = validateVariantFirstPhases(TestCases); // Then, Regression test if (!validation.wasSuccessful()) { executeRegressionOneByOne(muTestEx, validation); } // validation.setResultSuccess(!validation.isResultSuccess()); LogManager.getRootLogger().setLevel(Level.INFO); return validation; }
public ProgramVariantValidationResult validateVariantSecondPhaseSingle( List<String> failingCases, String testSuiteClassName) throws FileNotFoundException, ClassNotFoundException, InitializationError { // LogManager.getRootLogger().setLevel(Level.INFO);// OFF JUnitTestExecutor muTestEx = new JUnitTestExecutor(); ProgramVariantValidationResult validation = new ProgramVariantValidationResult(); // long fin1 = System.currentTimeMillis(); // in1 = System.currentTimeMillis(); logger.info("Executing Regression"); Result result = muTestEx.runTest(testSuiteClassName); validation.addResultRegressionTest(result); validation.setRegressionExecuted(result.wasSuccessful()); // failing = result.wasSuccessful(); // Stats.getCurrentStats().numberOfRegressionTestExecution++; // LogManager.getRootLogger().setLevel(Level.INFO); return validation; }
protected boolean executeRegressionOneByOne( JUnitTestExecutor muTestEx, ProgramVariantValidationResult validation) throws FileNotFoundException, ClassNotFoundException, InitializationError { boolean failing = false; long in1; long fin1; List<String> regressionCases = retrieveRegressionTestCases(); in1 = System.currentTimeMillis(); logger.info("Starting Regression"); int sizeReg = 0; for (String failingcaseReg : regressionCases) { sizeReg++; Result result = muTestEx.runTest(failingcaseReg); if (!result.wasSuccessful()) { failing = true; } logger.info( "Executing Regression " + (sizeReg) + "/" + regressionCases.size() + " " + failingcaseReg + " r:" + result.wasSuccessful()); // validation.getTestResults().add(result); validation.addResultRegressionTest(result); } // Stats.getCurrentStats().numberOfRegressionTestExecution++; fin1 = System.currentTimeMillis(); // Stats.getCurrentStats().time2Validation.add(fin1 - in1); logger.info( "End Regression (t=" + (fin1 - in1) + ") " + (sizeReg) + "/" + regressionCases.size() + ", result " + (!failing)); return failing; }