List of usage examples for org.aspectj.util FileUtil listFiles
public static String[] listFiles(File srcDir)
From source file:com.thoughtworks.go.server.materials.MaterialDatabaseGitUpdaterTest.java
License:Apache License
@Test public void shouldRemoveFlyweightWhenConfiguredBranchDoesNotExist() throws Exception { File flyweightDir = new File("pipelines", "flyweight"); FileUtils.deleteQuietly(flyweightDir); material = new GitMaterial(testRepo.projectRepositoryUrl(), "bad-bad-branch"); try {//from w w w . j a v a 2 s . c o m updater.updateMaterial(material); fail("material update should have failed as given branch does not exist in repository"); } catch (Exception e) { //ignore } MaterialInstance materialInstance = materialRepository.findMaterialInstance(material); assertThat(materialInstance, is(nullValue())); assertThat(FileUtil.listFiles(flyweightDir).length, is(0));//no flyweight dir left behind }