use of org.sonar.scanner.scan.WorkDirectoryCleaner in project sonarqube by SonarSource.
the class WorkDirectoryCleanerTest method setUp.
@Before
public void setUp() throws IOException {
// create files to clean
temp.newFile();
File newFolder = temp.newFolder();
File fileInFolder = new File(newFolder, "test");
fileInFolder.createNewFile();
File lock = new File(temp.getRoot(), DirectoryLock.LOCK_FILE_NAME);
lock.createNewFile();
// mock project
ProjectReactor projectReactor = mock(ProjectReactor.class);
ProjectDefinition projectDefinition = mock(ProjectDefinition.class);
when(projectReactor.getRoot()).thenReturn(projectDefinition);
when(projectDefinition.getWorkDir()).thenReturn(temp.getRoot());
assertThat(temp.getRoot().list().length).isGreaterThan(1);
cleaner = new WorkDirectoryCleaner(projectReactor);
}
Aggregations