public IfMetric(NopolContext nopolContext) { this.nopolContext = nopolContext; this.sourceFolder = nopolContext.getProjectSources()[0]; this.classpath = nopolContext.getProjectClasspath(); output1 = new File(sourceFolder.getAbsolutePath() + File.separatorChar + ".." + File.separatorChar + "IfMetricPurAndImpur"); output2 = new File(sourceFolder.getAbsolutePath() + File.separatorChar + ".." + File.separatorChar + "IfMetricExecutionDuringTest"); FileWriter writer = null; modifyClass = new ArrayList<>(); try { writer = new FileWriter(output1); } catch (IOException e) { throw new RuntimeException(e); } IfMetric.writer = writer; }
public CocoSpoonBasedSpectrumBasedFaultLocalizer(NopolContext nopolContext, Metric metric) { runTests(nopolContext.getProjectTests(), nopolContext, new SpoonedProject(nopolContext.getProjectSources(), nopolContext), new WatcherProcessor()); this.metric = metric; this.statements = new ArrayList<>(); }
public NoPol(NopolContext nopolContext) { this.startTime = System.currentTimeMillis(); this.nopolContext = nopolContext; this.classpath = nopolContext.getProjectClasspath(); this.sourceFiles = nopolContext.getProjectSources(); this.nopolResult = new NopolResult(nopolContext, this.startTime); RepairType type = nopolContext.getType(); logger.info("Source files: " + Arrays.toString(sourceFiles)); logger.info("Classpath: " + Arrays.toString(classpath)); logger.info("Statement type: " + type); logger.info("Args: " + Arrays.toString(nopolContext.getProjectTests())); logger.info("Config: " + nopolContext); this.logSystemInformation(); this.spooner = new SpoonedProject(this.sourceFiles, nopolContext); this.testClasses = nopolContext.getProjectTests(); this.testPatch = new TestPatch(this.sourceFiles[0], this.spooner, nopolContext); }
File[] inputSources = nopolContext.getProjectSources(); for (File inputSource : inputSources) {
@Override public Map<SourceLocation, List<TestResult>> getTestListPerStatement() { SpoonedProject spooner = new SpoonedProject(nopolContext.getProjectSources(), nopolContext); final List<SourcePosition> l = new ArrayList<>(); spooner.process(new AbstractProcessor<CtIf>(){
public static MonitoringTestExecutor implanted(InfinitelConfiguration configuration, NopolContext nopolContext) { ProjectMonitorImplanter implanter = new ProjectMonitorImplanter(configuration.iterationsThreshold()); SpoonedProject spoonedProject = new SpoonedProject(nopolContext.getProjectSources(), nopolContext); spoonedProject.process(implanter); ClassLoader classLoader = spoonedProject.dumpedToClassLoader(); MonitoringTestExecutor testExecutor = new MonitoringTestExecutor(classLoader, implanter.implant(), nopolContext); return testExecutor; }