@Test public void testAssertFixerFixes() throws IOException { long buildId = 365127838; Build build = this.checkBuildAndReturn(buildId, false); RepairnatorConfig.getInstance().setRepairTools(Collections.singleton(AssertFixerRepair.TOOL_NAME)); tmpDir = Files.createTempDirectory("test_assertfixer").toFile(); BuildToBeInspected toBeInspected = new BuildToBeInspected(build, null, ScannedBuildStatus.ONLY_FAIL, ""); ProjectInspector inspector = new ProjectInspector(toBeInspected, tmpDir.getAbsolutePath(), null, null); CloneRepository cloneStep = new CloneRepository(inspector); AssertFixerRepair assertFixerRepair = new AssertFixerRepair(); assertFixerRepair.setProjectInspector(inspector); cloneStep.addNextStep(new CheckoutBuggyBuild(inspector, true)) .addNextStep(new TestProject(inspector)) .addNextStep(new GatherTestInformation(inspector, true, new BuildShouldFail(), false)) .addNextStep(new ComputeClasspath(inspector, true)) .addNextStep(new ComputeSourceDir(inspector, true, false)) .addNextStep(new ComputeTestDir(inspector, true)) .addNextStep(assertFixerRepair); cloneStep.execute(); assertThat(assertFixerRepair.isShouldStop(), is(false)); List<StepStatus> stepStatusList = inspector.getJobStatus().getStepStatuses(); assertThat(stepStatusList.size(), is(8)); StepStatus assertFixerStatus = stepStatusList.get(7); assertThat(assertFixerStatus.getStep(), is(assertFixerRepair)); for (StepStatus stepStatus : stepStatusList) { assertThat("Failing step :" + stepStatus, stepStatus.isSuccess(), is(true)); } String finalStatus = AbstractDataSerializer.getPrettyPrintState(inspector); assertThat(finalStatus, is("PATCHED")); List<RepairPatch> allPatches = inspector.getJobStatus().getAllPatches(); for (RepairPatch p :inspector.getJobStatus().getAllPatches()) { } assertThat(allPatches.size(), is(8)); assertThat(inspector.getJobStatus().getToolDiagnostic().get(assertFixerRepair.getRepairToolName()), notNullValue()); }
@Override public String getRepairToolName() { return TOOL_NAME; }
AssertFixerRepair extends AbstractRepairStep { @Override public String getRepairToolName() { return TOOL_NAME; } }
AssertFixerRepair extends AbstractRepairStep { @Override public String getRepairToolName() { return TOOL_NAME; } AssertFixerRepair(); }
AssertFixerRepair extends AbstractRepairStep { @Override public String getRepairToolName() { return TOOL_NAME; } AssertFixerRepair(); @Override String getRepairToolName(); }
AssertFixerRepair extends AbstractRepairStep { @Override public String getRepairToolName() { return TOOL_NAME; } AssertFixerRepair(); @Override String getRepairToolName();  }