@Test public void testNPERepair() throws IOException { long buildId = 252712792; Build build = this.checkBuildAndReturn(buildId, false); tmpDir = Files.createTempDirectory("test_nperepair").toFile(); BuildToBeInspected toBeInspected = new BuildToBeInspected(build, null, ScannedBuildStatus.ONLY_FAIL, ""); RepairnatorConfig.getInstance().setRepairTools(Collections.singleton(NPERepair.TOOL_NAME)); ProjectInspector inspector = new ProjectInspector(toBeInspected, tmpDir.getAbsolutePath(), null, null); CloneRepository cloneStep = new CloneRepository(inspector); NPERepair npeRepair = new NPERepair(); npeRepair.setProjectInspector(inspector); cloneStep.addNextStep(new CheckoutBuggyBuild(inspector, true)) .addNextStep(new TestProject(inspector)) .addNextStep(new GatherTestInformation(inspector, true, new BuildShouldFail(), false)) .addNextStep(npeRepair); cloneStep.execute(); assertThat(npeRepair.isShouldStop(), is(false)); List<StepStatus> stepStatusList = inspector.getJobStatus().getStepStatuses(); assertThat(stepStatusList.size(), is(5)); StepStatus npeStatus = stepStatusList.get(4); assertThat(npeStatus.getStep(), is(npeRepair)); for (StepStatus stepStatus : stepStatusList) { assertThat(stepStatus.isSuccess(), is(true)); } String finalStatus = AbstractDataSerializer.getPrettyPrintState(inspector); assertThat(finalStatus, is("PATCHED")); List<RepairPatch> allPatches = inspector.getJobStatus().getAllPatches(); assertThat(allPatches.size(), is(6)); assertThat(inspector.getJobStatus().getToolDiagnostic().get(npeRepair.getRepairToolName()), notNullValue()); }
public NPERepair() {}
NPERepair extends AbstractRepairStep { public NPERepair() {} }
NPERepair extends AbstractRepairStep { public NPERepair() {} NPERepair(); }
NPERepair extends AbstractRepairStep { public NPERepair() {} NPERepair(); @Override String getRepairToolName(); }
NPERepair extends AbstractRepairStep { public NPERepair() {} NPERepair(); @Override String getRepairToolName(); static final String TOOL_NAME; }