@Test public void testGetPomOnProjectWithSubModule() throws IOException, InterruptedException { String projectUrl = "https: File tmpDir = Files.createTempDirectory("test_get_pom_project_with_submodule").toFile(); tmpDir.deleteOnExit(); String[] gitClone = new String[]{"git", "clone", "--recurse-submodules", projectUrl}; ProcessBuilder processBuilder = new ProcessBuilder().command(gitClone).directory(tmpDir); Process process = processBuilder.start(); process.waitFor(); ProjectInspector mockInspector = mock(ProjectInspector.class); String localRepoPath = tmpDir.getAbsolutePath() + "/repairnator/repairnator"; JobStatus jobStatus = new JobStatus(localRepoPath); when(mockInspector.getRepoLocalPath()).thenReturn(localRepoPath); when(mockInspector.getJobStatus()).thenReturn(jobStatus); AbstractStep step = new AbstractStepNop(mockInspector); String expectedPomPath = localRepoPath+"/pom.xml"; String actualPomPath = step.getPom(); assertThat(actualPomPath, is(expectedPomPath)); }
protected String getPom() { if (!pomLocationTested) { testPomLocation(); this.inspector.getJobStatus().getProperties().getReproductionBuggyBuild() .setProjectRootPomPath(this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE); } return this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE; }
AbstractStep { protected String getPom() { if (!pomLocationTested) { testPomLocation(); this.inspector.getJobStatus().getProperties().getReproductionBuggyBuild() .setProjectRootPomPath(this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE); } return this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE; } }
AbstractStep { protected String getPom() { if (!pomLocationTested) { testPomLocation(); this.inspector.getJobStatus().getProperties().getReproductionBuggyBuild() .setProjectRootPomPath(this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE); } return this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE; } AbstractStep(ProjectInspector inspector, boolean blockingStep);  AbstractStep(ProjectInspector inspector, boolean blockingStep, String name); }
AbstractStep { protected String getPom() { if (!pomLocationTested) { testPomLocation(); this.inspector.getJobStatus().getProperties().getReproductionBuggyBuild() .setProjectRootPomPath(this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE); } return this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE; } AbstractStep(ProjectInspector inspector, boolean blockingStep);  AbstractStep(ProjectInspector inspector, boolean blockingStep, String name); void setBlockingStep(boolean blockingStep); boolean isBlockingStep(); void setNotifiers(List<AbstractNotifier> notifiers); String getName(); void setName(String name); StepStatus getStepStatus(); void setDataSerializer(List<AbstractDataSerializer> serializers); ProjectInspector getInspector(); AbstractStep addNextStep(AbstractStep nextStep); AbstractStep addBranchingStep(BranchingStep nextStep); void addStepError(String error); void addStepError(String error, Throwable exception); void setProjectInspector(ProjectInspector inspector); boolean isShouldStop(); void execute(); Date getDateBegin(); Date getDateEnd(); int getDuration(); RepairnatorConfig getConfig(); }
AbstractStep { protected String getPom() { if (!pomLocationTested) { testPomLocation(); this.inspector.getJobStatus().getProperties().getReproductionBuggyBuild() .setProjectRootPomPath(this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE); } return this.inspector.getJobStatus().getPomDirPath() + File.separator + Utils.POM_FILE; } AbstractStep(ProjectInspector inspector, boolean blockingStep);  AbstractStep(ProjectInspector inspector, boolean blockingStep, String name); void setBlockingStep(boolean blockingStep); boolean isBlockingStep(); void setNotifiers(List<AbstractNotifier> notifiers); String getName(); void setName(String name); StepStatus getStepStatus(); void setDataSerializer(List<AbstractDataSerializer> serializers); ProjectInspector getInspector(); AbstractStep addNextStep(AbstractStep nextStep); AbstractStep addBranchingStep(BranchingStep nextStep); void addStepError(String error); void addStepError(String error, Throwable exception); void setProjectInspector(ProjectInspector inspector); boolean isShouldStop(); void execute(); Date getDateBegin(); Date getDateEnd(); int getDuration(); RepairnatorConfig getConfig();  }