@Test public void should_set_relative_path_to_project_work_dir() throws Exception { File initialProjectDir = temp.getRoot(); p.put("sonar.task", "scan"); p.put(ScannerProperties.WORK_DIR, "relative/path"); p.put(ScanProperties.PROJECT_BASEDIR, initialProjectDir.getAbsolutePath()); new Dirs(mock(Logger.class)).init(p); File projectDir = new File(p.get(ScanProperties.PROJECT_BASEDIR)); File workDir = new File(p.get(ScannerProperties.WORK_DIR)); assertThat(projectDir).isNotNull().isDirectory(); assertThat(projectDir.getCanonicalPath()).isEqualTo(initialProjectDir.getCanonicalPath()); assertThat(workDir).isNotNull(); assertThat(workDir.getCanonicalPath()).isEqualTo(new File(projectDir, "relative/path").getCanonicalPath()); }
void init(Map<String, String> p) { boolean onProject = Utils.taskRequiresProject(p); if (onProject) { initProjectDirs(p); } else { initTaskDirs(p); } }
Dirs { void init(Map<String, String> p) { boolean onProject = Utils.taskRequiresProject(p); if (onProject) { initProjectDirs(p); } else { initTaskDirs(p); } } }
Dirs { void init(Map<String, String> p) { boolean onProject = Utils.taskRequiresProject(p); if (onProject) { initProjectDirs(p); } else { initTaskDirs(p); } } Dirs(Logger logger); }
Dirs { void init(Map<String, String> p) { boolean onProject = Utils.taskRequiresProject(p); if (onProject) { initProjectDirs(p); } else { initTaskDirs(p); } } Dirs(Logger logger);  }
Dirs { void init(Map<String, String> p) { boolean onProject = Utils.taskRequiresProject(p); if (onProject) { initProjectDirs(p); } else { initTaskDirs(p); } } Dirs(Logger logger);   }